Tirumalesh_J2EE
Transcript of Tirumalesh_J2EE
-
7/31/2019 Tirumalesh_J2EE
1/7
J2EE
Tirumalesh Reddy
2
About This Presentation
SDLC
Application Server.
Web Server.
J2EE Architecture.
3
Sowtware Development Life Cycle (SDLC)
WaterFall Methodology
Spiral
Agile
WaterFall Methodology
5
Agile Processes
Requirements change.
Design evolves.
Documents are seldom current.
6
Agile Methodology
1. Introduction to Agile Java Development
2. Agile Processes
3. Agile Modeling
4. Agile Development Environment Setup: Directory Structure, JDK, Ant and JUnit
Using Hibernate For Persistent Objects
5. Beyond The Basics
-
7/31/2019 Tirumalesh_J2EE
2/7
7
What Is Agile Java Development? It CouldInclude
1. Agile Software Processes Iterative Development
Use an Agile method - Scrum, XP, etc.
2. Agile Architecture/Design Modeling
Incremental design with good enough models Use an agile method -Agile Model Driven Development (AMDD)
3. Agile Java Design/Development Simple design and coding!
Test-driven development (TDD)
Efficient frameworks and tools (Ant, JUnit, Hibernate, Spring, Eclipse)
Plain Old Java Objects (POJOs), whenever possible
8
Term Agile Incorporates a Wide Range of Methods
AM - Agile Modeling
ASD - Adaptive Software Development
AUP - Agile Unified Process
Crystal
FDD - Feature Driven Development
DSDM - Dynamic Systems Development Method
Lean Software Development
Scrum
Xbreed
XP - eXtreme Programming
Others
Agility- All About Smaller Chunks (Shorter/Frequent
Cycles)
...
Iteration
0
Iteration
1
Iteration
n
Release 1
...
Release 2
Iteration
0
Iteration
1
Iteration
n
...
software software software software software software
Incrementally Build Software - Highest Priority Features First!
10
Agile Method: Scrum
Simple process for product/project management
Product Backlog - List of known features/changes for product
Sprint - 1-month iterations (develop highest priority items)
Meetings
Sprint Planning Meeting Done at beginning of each sprint
(after planning, features moved from product backlog to sprint backlog)
Daily scrum meeting(short: 15 minutes)
Sprint review meeting
11
Agile Method: Extreme Programming (XP)
Shorter and Frequent Cycles (smaller chunks!)
Release - Quarterly Cycles (set a theme)
Iteration- Weekly Cycles (e.g. aim for last day of week)
10-minute builds Continuous integration (multiple times per day; manual or automatic)
Incremental Design and Planning (defer investment till needed)
Development in small increments using Test-First development
Communications - Sit Together, Informative Workspace, on-site customer
Flow - sustainable pace versus rigid phases; velocity, continuousintegration
Others visit extremeprogramming.org
12
Choices Of Release (High) Level Models
Model with a purpose -- shared understanding!
domain model user storiesUI prototype& flow map
architectureRelease
Level
Models
scope table,glossary, etc .
CRC cardsapplicationflow map
UMLdiagrams
databasemodel
Iteration
Level
Models
acceptancetests
-
7/31/2019 Tirumalesh_J2EE
3/7
13
Sample Scope Table
Shared understanding: what's in and what's out
Scope Functionality
Include Time Expression will provi de the capability to enter, approve, and
pay for hours worked by employees.
Defer Time Expression will not calculate deductions from paychecks, such
as federal/state taxes and medical expenses.
Defer Time Expression will not track vacation or sick leave.
14
Domain Model
Shared understanding: business concepts > key domain objects
15
User Stories Or Use Cases
Shared understanding: features required of software
3
XP Style User Story Card
Use Case: Login
Author
Anil Hemrajani
DescriptionThis processallows User to log into the System
Actors/Interfaces
FM TraderThe System
Trigger
User performs a Loginaction
Preconditions
N/A
Success/Basic Flow
1. The System displays the Login panelp rompting User for login details as specified inthe
2. User completes all required fields and performs a Submitaction.Failure/Alternative Flow
Invalid User ID and/or Password - The system notifies FM trader with the message Invalid UserID and/or Password . The system displays the Loginpanel to User with the contents of all fields
empty.
Use Case - Casual, Brief or Fully Dressed
16
User Interface (UI) Prototype
Shared understanding: functionality, look-and-feel, etc.
17
UI Flow Map (Storyboard)
Shared understanding: user interface navigation/flow
18
High-Level Architecture Diagram
Shared understanding: technologies, scalability, security, reliability
BEA WebLogic Server
Objects managed by Spring IoC Container
HTTP JDBC
View
JSP/HTML
Controller
Spring
DispatcherServlet
Web
Browser
Model
Business objects,
Hibernate beans
Spring
Scheduler
RDBMS
(Oracle)
-
7/31/2019 Tirumalesh_J2EE
4/7
19
Choices Of Iteration Level (Detailed) Models
domain model user storiesUI prototype& flow map
architectureRelease
Level
Models
scope table,glossary, etc.
CRC cardsapplicationflow map
UMLdiagrams
databasemodel
Iteration
Level
Models
acceptancetests
20
Iteration Level Details - Acceptance Tests & Active
Stakeholders
Sign In
The employee id can be up to 6 characters. The password
must be between 8 and 10 characters.
Only valid users can sign in.
Timesheet List
Only a user's personal timesheets can be accessed.
Enter Hours
Hours must contain numeric data.
Daily hours cannot exceed 16 hours. Weekly hours cannot
exceed 96 hours.
Hours must be billed to a department.
Hours can be entered as two decimal places.
Employees can only view and edit their own timesheets.
21
Exploring Classes Using CRC Cards
Class Name (Noun)
Responsibilities (obligations
of this class, such as business
methods, exception handling,
security methods,
attributes/variables).
Collaborators (other
classes required to
provide a complete
solution to a high-level
requirement)
TimesheetManager
Fetches timesheet(s) from
database
Saves timesheet to database
Timesheet
Timesheet
Knows of period ending date
Knows of time
Knows of department code
domain model
Timesheet List screen
First, let's reflect on what we know,domain model, UI and architecture
Second, let's explore classes on CRCcards using both as input models
TimesheetListController
Controller (in MVC) for
displaying a list of timesheets.
TimesheetManager
free-form architecture
22
Application Flow Map (Home Grown A rtifact)
Complementary to class diagrams and CRC cards
Can be extended using CRUD columns
Story Tag View Controller Class Collaborators TablesImpacted
Timesheet
List
timesheetlist TimeSheetListController TimesheetManager Timesheet
Enter
Hours
enterhours EnterHoursController TimesheetManager Timesheet
Department
23
UML Class and Package Diagrams
24
Focus Is On Working Software vs. Comprehensive Documentation
Physical Models
CRC cards
applicationflow map
UMLdiagrams
databasemodel
acceptancetests
Conceptual Models
user stories
architecture
problem
statement
domain model
scopetable
glossary
UI prototype& flow map
Implementation
Data Base Code Base
THE FINAL AND LASTING ARTIFAC TS!
UIprototypes Model in Small Increments
Depict Models Simply
Discard temporary models
Prove it with code
- agilemodeling.com
-
7/31/2019 Tirumalesh_J2EE
5/7
25
Shifting Some Upfront Design to Refactoring
26
Shifting Some Upfront Design T o Refactoring (Continuous Design)
Refactoring is not a new concept; the term is relatively new
refactoring.com
Refactoring is a disciplined technique for restructuring an existing body of
code, altering its internal structure without changing its external behavior.
- Martin Fowler
Over 100 refactoring techniques; for example:
Extract superclass
Extract interface
Move class
Move method
Application Server
What is an App Server?
Serves up web pages
Provides a container model for applications
Provides services for applications
Adheres to a specification controlled by industry
Distributes requests across multiple physical servers
Provides management and/or development tools
Eg :
Weblogic (8.1, 9.2, 10[11g])
Websphere(IBM)
Tomcat
Web Server
Acomputer that delivers (serves up) Web pages. Every Web serverhas an IP address and possibly a domain name. For example, if you
enter the URL http://www.egen.com/index.html in your browser,this sends a request to the server whose domain name is egen.com.The server then fetches the page named index.html and sends it toyour browser. Any computer can be turned into a Web server byinstalling server software and connecting the machine to theInternet. There are many Web server software applications ,including public domain software from NCSA and Apache.
Let's use Egen as an example. You decide to visit Egen by typing its
URL -- http://www.egen.com -- into your Web browser. Through anInternet connection, your browser initiates a connection to the Web
server that is storing the Egen files by first converting the domain
name into an IP address (through a domain name service) and thenlocating the server that is storing the information for that IP address
(also see Understanding IP Addressing).
29
J2EE Architecture and Components
http://www.webopedia.com/TERM/W/computer.htmlhttp://www.webopedia.com/TERM/W/computer.htmlhttp://www.webopedia.com/TERM/W/web_page.htmlhttp://www.webopedia.com/TERM/W/IP_address.htmlhttp://www.webopedia.com/TERM/W/domain_name.htmlhttp://www.webopedia.com/TERM/W/URL.htmlhttp://www.webopedia.com/TERM/W/browser.htmlhttp://www.webopedia.com/TERM/W/Web_server.htmlhttp://www.webopedia.com/TERM/W/software.htmlhttp://www.webopedia.com/TERM/W/Internet.htmlhttp://www.webopedia.com/TERM/W/Web_server.htmlhttp://www.webopedia.com/DidYouKnow/Internet/2003/HowWebServersWork.asphttp://www.webopedia.com/DidYouKnow/Internet/2003/HowWebServersWork.asphttp://www.webopedia.com/DidYouKnow/Internet/2003/HowWebServersWork.asphttp://www.webopedia.com/DidYouKnow/Internet/2003/domain_name.htmlhttp://www.webopedia.com/DidYouKnow/Internet/2003/domain_name.htmlhttp://www.webopedia.com/DidYouKnow/Internet/2003/IP_address.htmlhttp://www.webopedia.com/DidYouKnow/Internet/2003/DNS.htmlhttp://www.webopedia.com/DidYouKnow/Internet/2003/HowWebServersWork.asphttp://www.webopedia.com/DidYouKnow/Internet/2002/IPaddressing.asphttp://www.webopedia.com/DidYouKnow/Internet/2002/IPaddressing.asphttp://www.webopedia.com/DidYouKnow/Internet/2003/HowWebServersWork.asphttp://www.webopedia.com/DidYouKnow/Internet/2003/DNS.htmlhttp://www.webopedia.com/DidYouKnow/Internet/2003/IP_address.htmlhttp://www.webopedia.com/DidYouKnow/Internet/2003/domain_name.htmlhttp://www.webopedia.com/DidYouKnow/Internet/2003/domain_name.htmlhttp://www.webopedia.com/DidYouKnow/Internet/2003/HowWebServersWork.asphttp://www.webopedia.com/DidYouKnow/Internet/2003/HowWebServersWork.asphttp://www.webopedia.com/DidYouKnow/Internet/2003/HowWebServersWork.asphttp://www.webopedia.com/TERM/W/Web_server.htmlhttp://www.webopedia.com/TERM/W/Internet.htmlhttp://www.webopedia.com/TERM/W/software.htmlhttp://www.webopedia.com/TERM/W/Web_server.htmlhttp://www.webopedia.com/TERM/W/browser.htmlhttp://www.webopedia.com/TERM/W/URL.htmlhttp://www.webopedia.com/TERM/W/domain_name.htmlhttp://www.webopedia.com/TERM/W/IP_address.htmlhttp://www.webopedia.com/TERM/W/web_page.htmlhttp://www.webopedia.com/TERM/W/computer.html -
7/31/2019 Tirumalesh_J2EE
6/7
Containers Services
Containers are the interface between a component and the low-
level platform-specificfunctionality that supports the component.
Before it can be executed, a web, enterprise bean, or application
client component must be assembled into a Java EE module and
deployed into its container.
Container Types Container Types
Java EE server: The runtime portion of a Java EE product. A
Java EE server provides EJB and web containers.
Enterprise JavaBeans (EJB) container:Manages the
execution of enterprise beans for Java
Web container: Manages the execution of web pages,
servlets, and some EJB components for Java EE applications.
Web components and their container run on the Java EE server.
Application client container: Manages the execution of
application client components. Application clients and their
container run on the client.
Applet container:Manages the execution of applets. Consists
of a web browser and Java Plug-in running on the client together.
EJB Container Web Container
-
7/31/2019 Tirumalesh_J2EE
7/7
Packaging Applications
JAR(Java Archive)
WAR(Web Archive)
EAR(Enterprise Archive)