Reusable Development Components from the Java(TM) 2

Download Report

Transcript Reusable Development Components from the Java(TM) 2

Reusable Development
Components from the
Java(TM) 2 Platform,
Enterprise Edition (J2EE(TM))
and Open Source Projects
Rob Weaver
Architect
Quovera
Session # 2645
Overall Presentation Goal
or Primary Purpose
Building reusable development
components helps us decrease time
to market and increase software
quality.
2
Session # 2645
Learning Objectives
• As a result of this presentation, you will
be able to:
– Understand “real world” reusable component
development
– Know about some of the strengths and
weaknesses of reusable code
– Learn some best practices.
3
Session # 2645
Qualifications
•
Quovera (formerly Millennia Vision Corporation)



•
Experience


•
Consultants with 10+ years experience
Over 200 clients for whom we have completed over 300
projects
Differentiators


4
Founded in 1995 as “Millennia Vision Corporation (MVC)”
Strong High-Tech Industry Background
Profitable 5 Years Without Outside Funding
Architecture Technology Office (ATO)
Program Management Office (PMO)
Session # 2645
Qualifications
• Rob Weaver is a Web Architect for Quovera
– Member of Quovera’s Architecture and
Technology Office.
– Proponent of the web since 1995 when he
joined Excite to become a webmaster.
5
Session # 2645
Qualifications
• Will Andrews
– Technical Director for Quovera
– Member of Quovera’s Architecture and Technology
Office.
– Has been web enabling applications since 1997 at
PricewaterhouseCoopers.
6
Session # 2645
Reuse: the Holy Grail of software
development
• We can be freed from making the same
mistakes over and over again, and happily
pursue finding entirely new ones.
• Reuse is one of the benefits of an object
oriented language because OO is built
around it.
7
Session # 2645
Agenda
• Introduction
• Example of using reusable components
• Design decisions and patterns
• Reference Framework
• Challenges
• Summary
• Q&A
8
Session # 2645
Reusable code – more design,
less development
• Architecture and Technology Office Modeled
Systems (ATOM)
• Reference Framework Architecture
– Technologies
– Reusable Components
– Additional Services
– Layers
– Design Pattern Information Flow
9
Session # 2645
Reusable code – more design,
less development
• Open Source projects
– Open source components need to be well
understood
• Design considerations
– Keep framework lightweight
– Components need to be flexible
10
Session # 2645
Open Source projects
• Apache (http://www.apache.org/)
• Tomcat (http://jakarta.apache.org/)
• Struts (http://jakarta.apache.org/)
• JDOM (http://www.jdom.org)
• Netbeans (http://www.netbeans.org/)
11
Session # 2645
Design considerations
• Keep framework lightweight
• Components need to be flexible
• Open source components need to be well
understood
12
Session # 2645
Agenda
• Introduction
• Example of using reusable components
• Design decisions and patterns
• Reference Framework
• Challenges
• Summary
• Q&A
13
Session # 2645
Eating our own dog food
Quovera Time and Accounting
• Secure web-deployed time and expense (TimeX) reporting module
– Mission-critical for a consulting company
– Replace Excel solution
• Easy to use
• Leverages reusable components
– Database design
– Back-end PL/SQL utilities (email, user security, etc.)
– Java classes
• Fast
– Light-weight client
– High availability
14
Session # 2645
Design Decisions
• JSP solution
– Fulfills high-availability, fast, web-enabled
requirements
• Base the system on Quovera ATOMS and
Reference Framework
– Architecture and Technology Office Modeled
Systems
• Uses Model-View-Controller architecture
15
Session # 2645
Model-View-Controller (MVC)
• SmallTalk strategy recently promoted by
Sun
• Model = data and values, validation, ranges
• View = display
• Controller = what happens
when user interacts with
the component
V
16
Session # 2645
M
C
More on MVC
• The MVC separation allows you to plug in different
front-end clients
• Provides a separation in development, too
– Model is driven by data design
– Controller is driven by process design
– View is driven by screen design
M
V
• Different development skills for different styles of
presentation (application vs JSP)
• Swing attempted this but ended up with a separable
model architecture
– View and Controller layer are merged
17
Session # 2645
C
Agenda
• Introduction
• Example of using reusable components
• Design decisions and patterns
• Reference Framework
• Challenges
• Summary
• Q&A
18
Session # 2645
Reference Framework Architecture
Design Pattern Information Flow
View
Controller
View
XML, Result Sets,
Data Objects
19
Session # 2645
Model
Reference Framework Architecture
Technologies
View
HTML, JavaScript,
Java Server Pages,
Servlets
View
Controller
Enterprise Java Beans,
Messaging-Oriented
Middleware, Java
20
Session # 2645
Model
Relational Database,
XML Data Store
Reference Framework Architecture
Reusable Components
View
Display Elements,
XSL Transformation,
Custom Tag Libraries,
Common Web Servlet
Controller
View
Common Validation Rules,
ACL Modeled Security,
Session Handler,
Generic Page Processor
21
Session # 2645
Model
User/Group Profiling,
Event Notification,
Messaging,
Business Rules,
Application Security
Reference Framework Architecture
Additional Services
Services
Java Mail,
DB Connection Pooling,
Generic Workflow,
Audit and Logging,
Job Scheduling,
External Security
Integration,
Data Driven Lookups,
JMS Messaging,
XML Message Broker,
JNDI Lookups
22
Session # 2645
Reference Framework Architecture
Layers
Web Server
Technology
Application Server
HTML,
JavaScript,
JSP, Servlets
EJB,
Message-Oriented
Middleware, Java
Relational
Database,
XML Data Store
Display Elements,
Common Validation
Rules,
ACL Modeled Security,
Session Handler,
Generic Page Processor
User/Group
Profiling,
Event Notification,
Messaging,
Business Rules,
Application Security
Reusable
XSL Transformation,
Components Custom Tag Libraries,
Common Web Servlet
Services
Information
Flow
23
Session # 2645
Database Server
Java Mail, DB Connection Pooling, Generic Workflow, Audit and
Logging, Job Scheduling, External Secuity Integration, Data Driven
Lookups, JMS Messaging, XML Message Broker, JNDI Lookups
XML, Result Sets, Data Objects
TimeX MVC Usage
• Single servlet for Controller function
– Business logic is provided by support
classes (Handlers)
• Handlers use data objects (classes) to
interact with the database (Model)
– Usually static methods to call a SQL
statement or database procedure
• One handler per JSP
– This supplies the View
24
Session # 2645
Process Summary
25
Session # 2645
Process Summary
1.
Call servlet
2.
Gather request parameters, store session info
3.
Check privileges
4.
Get the proper handler
5.
Initialize the handler, validate if necessary
6.
Check the request action sent (LOAD,
FORWARD,SAVE_FORWARD, SAVE_LOOP
26
7.
Get next handler if action is FORWARD or SAVE_FORWARD
8.
Dispatch request to the proper JSP
Session # 2645
Struts Components and Request
Lifecycle
27
Session # 2645
TimeX User Interface
• Login
• Select a time period
28
Session # 2645
Enter Time
• One day at a time
29
Session # 2645
Submit Time Report
• Employee is done with report
• Status changes to submitted
• Approver must review and approve
30
Session # 2645
Expense Report
• Follows similar flow up to the entry form
31
Session # 2645
Quovera Time and Expense Reporting
Requirements
• Secure web-deployed time and expense
(TimeX) reporting module
– Mission-critical for a consulting company
– Replace Excel solution
– Easy to use
32
Session # 2645
Quovera Time and Expense Reporting
Requirements
• Leverages reusable components
– Database design
– Back-end PL/SQL utilities (email, user
security, etc.)
– Java classes
• Fast
– Light-weight client
– High availability
33
Session # 2645
Design Decisions
• JSP solution
– Fulfills high-availability, fast, web-enabled
requirements
– Base the system on Quovera ATOMS and
Reference Framework
34
Session # 2645
Design Decisions
• Utilize Open source components
• Uses Model-View-Controller architecture
– Model-View-Controller (MVC)
• Model = data and values, validation, ranges
• View = display
• Controller = what happens when user
interacts with the component
35
Session # 2645
TimeX MVC Usage
• Single servlet for Controller function
– Business logic is provided by support classes
(Handlers)
• Handlers use data objects (classes) to
interact with the database (Model)
– Usually static methods to call a SQL statement or
database procedure
• One handler per JSP (View)
36
Session # 2645
Agenda
• Example of using reusable components
• Design decisions and patterns
• Reference Framework
• Challenges
• Summary
• Q&A
37
Session # 2645
Challenges in utilizing the
framework
• Client dictates technologies
• Components often have dependencies
• Some risk when compared to commercial
products
38
Session # 2645
Agenda
• Introduction
• Example of using reusable components
• Design decisions and patterns
• Reference Framework
• Challenges
• Summary
• Q&A
39
Session # 2645
Summary
• You are already using reusable
development components when you code in
Java !
• Design patterns are more reusable than
components
• Open source is useful and fun
• Blah, blah, blah …
End
40
Session # 2645
Agenda
• Introduction
• Example of using reusable components
• Design decisions and patterns
• Reference Framework
• Challenges
• Summary
• Q&A
41
Session # 2645
Session # 2645
Thank You !
http://www.quovera.com/
Corporate Headquarters
275 Shoreline Drive, Suite 520
Redwood City, CA 94065
Phone: 650-232-6300
Fax:
650-232-6301
43
Session # 2645
Session # 2645