Professional Documents
Culture Documents
Definition
Properties
Page 1
Patterns
“Each pattern describes a problem which occurs over and over again in
our environment, and then describes the core of the solution to that
problem, in such a way that you can use this solution a million times
over, without ever doing it the same way twice”
– Christopher Alexander
(building architect)
Page 2
Object Technology
Patterns
A pattern is a named description of a problem and solution
that can be applied in new contexts.
Patterns codify the principles and idioms that guide
experienced developers in their creation of software.
What is and isn’t a pattern depends on your point of view.
Page 3
Object Technology
Patterns 2
Design patterns are not about structures such as vectors that can be
encoded in classes and reused as is, nor are they complex domain
specific designs.
Ideally, patterns should include guidance for how they can be applied in
novel situations.
Many patterns provide guidance for how responsibilities should be
assigned to objects.
Page 4
MVC
Page 5
Intent
Page 6
Advantages
Page 7
Architecture
Page 8
Applicability
Page 9
Model
Page 10
View
Page 11
Controller
Page 12
Collaboration - Model
Page 13
Collaboration – View
Page 14
Collaboration - Controller
Page 15
Consequences
Clarifies design by separating data modeling issues from data display and user interaction.
Allows the same data to be viewed in multiple ways.
Allows the same data to be viewed by multiple users.
Improves extensibility by simplifying impact analysis.
Improves maintainability by encapsulating application functions behind well-known APIs, and decreasing code
replication ("copy-paste-and-hack").
Enhances reusability by decoupling application functionality from presentation.
Makes applications easier to distribute, since MVC boundaries are natural distribution interface points.
Can be used to partition deployment and enable incremental updates.
Facilitates testability by forcing clear designation of responsibilities and functional consistency.
Enhances flexibility, because data model, user interaction, and data display can be made "pluggable."
Page 16
Implementation - Issues
Page 17
Example 1 – ULM
diagram
Page 18
Example 2 - Dynamics
Page 19
The Problem with
Servlets
From http://www.servlets.com/soapbox/problems-jsp.html
Page 20
JSP - Model 1
Architecture
Page 21
Strengths of Model 1
Page 22
Problems with Model 1
Page 23
Model 2 explanation
Page 24
Model 2 Architecture
Page 25
Advantages of Model 2
Page 26
Tomcat Moving Parts
JSP files
JSP engine
Engine
JSP servlets Completed servlets
Static documents
Servlet engine
Client
Page 28
Tomcat and JBOSS =
J2EE
(X)HTML HTTP(S) Tomcat web container JDBC RDBMS
XML Servlets JSPs
Tag
Mail
library JavaMail server
RMI / IIOP
Java mail
JNDI Java
JDBC
JTA
JAF
Applet RMI application
JMS
CORBA
IIOP server
EJB container
Client
application Session Entity
beans beans
JNDI
eDirectory™
Java mail
RMI / IIOP
JDBC
JNDI
JTA
JAF
JMS
JMS
Message queue
Page 29
A Tomcat Application
Tomcat
WebApps
examples
Web application images
JSP
JSP
JSP Meta-inf
Servlet
Servlet
Servlet servlets
Servlet
Web-inf
Classes
Lib
Page 30
Tomcat in Stand-Alone
Mode
When a servlet container is stand-
alone, it acts as its own web
server
– It completely bypasses the
traditional HTTP server Servlet
Container
Servlet
When running in stand-alone JVM
mode, special requests are Servlet
generally forwarded to port 8080
Page 31
In-Process Container
Web Java
server plug-in Servlet
JVM
Servlet
The plug-in and the container run in the server’s memory space, as does the JVM
that executes the servlet and its container
Page 32
Out-of Process Servlet
•
Container
This configuration option involves utilization of two memory spaces
• The first supports the web server and the Java plug-in
• The other supports the JVM and the servlet container
Web Java
server plug-in Servlet Container
JVM
Servlet Servlet
Page 33
MVC Architecture
Model View Controller
Model Data View
(Bean properties)
Beans JSPs
Event Event
(request) (forward)
Display info
Data <jsp:getProperty>
Controller Action URLs
Event
Servlets (request)
Browser
Page 34
MVC Architecture
JSP/servlet beans
(controller)
MVC
Page 36
Creating Dynamic
Content
Using Novell eDirectory™
Using eDirectory beans to Demonstration Sequence
dynamically create web
content
– Authentication
– Identity management
– Content management
Page 37
JSP Pages and the
useBean Tag
Demonstration Sequence
Page 38
Authorization Bean
Demonstration Sequence
<jsp:useBean id= "authBean"
class="com.novell.ecb.ldap.AuthenticateLdap" scope="request" />
// Call the execute method command bean
authBean.execute();
Page 39
Cooper’s Page after
Authentication
Page 40
CreateBean—New
Member Registration
Demonstration Sequence
Page 41
Page 42