comp9321 web application engineering design patterns 1cs9321/16s1/lectures/lec06/lec-06.pdf ·...
TRANSCRIPT
COMP9321 Web Application Engineering
Design Patterns 1
1 COMP9321, 16s1, Week 6
http://webapps.cse.unsw.edu.au/webcms2/course/index.php?cid=2442
Dr. Basem Suleiman
Service Oriented Computing Group, CSE, UNSW Australia
Semester 1, 2016, Week 6
Design Patterns
3 COMP9321, 16s1, Week 6
A pattern is a proven solution to a problem in a context.
Each pattern expresses a relation between a certain context, a problem, and a solution.
Design Patterns
4 COMP9321, 16s1, Week 6
A pattern is a proven solution to a problem in a context.
Each pattern expresses a relation between a certain context, a problem, and a solution.
A design pattern represents a solutions to problems that arise when developing a software.
Design Patterns
5 COMP9321, 16s1, Week 6
A pattern is a proven solution to a problem in a context.
Each pattern expresses a relation between a certain context, a problem, and a solution.
A design pattern represents a solutions to problems that arise when developing a software.
Design pattern are granular and applied at different levels such as: Frameworks Subsystems Sub-subsystems
Design Patterns
6 COMP9321, 16s1, Week 6
A pattern is a proven solution to a problem in a context.
Each pattern expresses a relation between a certain context, a problem, and a solution.
A design pattern represents a solutions to problems that arise when developing a software.
Design pattern are granular and applied at different levels such as: Frameworks Subsystems Sub-subsystems
Categories include:
Design
Architectural
Analysis
Creational
Structural
Behavioral
Design Patterns
7 COMP9321, 16s1, Week 6
A pattern is a proven solution to a problem in a context.
Each pattern expresses a relation between a certain context, a problem, and a solution.
A design pattern represents a solutions to problems that arise when developing a software.
Design pattern are granular and applied at different levels such as: Frameworks Subsystems Sub-subsystems
Categories include:
Design
Architectural
Analysis
Creational
Structural
Behavioral
MVC: Model View Controller e.g.
Design Patterns
8 COMP9321, 16s1, Week 6
A pattern is a proven solution to a problem in a context.
Each pattern expresses a relation between a certain context, a problem, and a solution.
A design pattern represents a solutions to problems that arise when developing a software.
Design pattern are granular and applied at different levels such as: Frameworks Subsystems Sub-subsystems
Categories include:
Design
Architectural
Analysis
Creational
Structural
Behavioral
Gamma et al (Gang of Four) produced a famous
book which listed 23 “Design” patterns
MVC Components and Roles
47 COMP9321, 16s1, Week 6
MVC can be broken down into three elements:
Model - The model represents data and the
rules that govern access to and updates of this
data.
View - The view renders the contents of a
model. It specifies exactly how the model data
should be presented.
Controller - The controller translates the user's
interactions with the view into actions that the
model will perform.
http://www.oracle.com/technetwork/articles/javase/index-142890.html
MVC Components and Roles
48 COMP9321, 16s1, Week 6
http://www.oracle.com/technetwork/articles/javase/index-142890.html
FrontController Pattern
57 COMP9321, 16s1, Week 6
• The Front Controller pattern is a software design pattern.
• The pattern relates to the design of web applications.
• It provides a centralized entry point for handling requests.
• Front controllers are often used in web applications to
implement workflows.
• The front controller may be implemented as a Java object.
FrontController Pattern
58 COMP9321, 16s1, Week 6
• The Front Controller pattern is a software design pattern.
• The pattern relates to the design of web applications.
• It provides a centralized entry point for handling requests.
• Front controllers are often used in web applications to
implement workflows.
• The front controller may be implemented as a Java object.
Last Week – DAO, JDBC and Hibernate
74 COMP9321, 16s1, Week 6
Hibernate Example
• Hibernate sessions (also JDBC connections)
• Data objects and database mappings
• Components mapping
• Inheritance, Associations, collection mapping, parent/child type
relationships
• Data source and Java Naming and Directory Interface (JNDI)
References
75 COMP9321, 16s1, Week 6
• Core J2EE patterns, Deepak Alur, John Crupi and Dan Marlks, Prentice
Hall
• Patterns of Enterprise Application Architecture, Martin Fowler, Addison-
Wesley
• http://java.sun.com/blueprints/patterns/
• http://www.oracle.com/technetwork/articles/javase/index-
142890.html