Top Banner
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
76

COMP9321 Web Application Engineering Design Patterns 1cs9321/16s1/lectures/lec06/Lec-06.pdf · Design Patterns COMP9321, 16s1, Week 6 3 A pattern is a proven solution to a problem

Nov 21, 2018

Download

Documents

lenhi
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: COMP9321 Web Application Engineering Design Patterns 1cs9321/16s1/lectures/lec06/Lec-06.pdf · Design Patterns COMP9321, 16s1, Week 6 3 A pattern is a proven solution to a problem

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

Page 2: COMP9321 Web Application Engineering Design Patterns 1cs9321/16s1/lectures/lec06/Lec-06.pdf · Design Patterns COMP9321, 16s1, Week 6 3 A pattern is a proven solution to a problem

Design Patterns

2 COMP9321, 16s1, Week 6

A pattern is a proven solution to a problem in a context.

Page 3: COMP9321 Web Application Engineering Design Patterns 1cs9321/16s1/lectures/lec06/Lec-06.pdf · Design Patterns COMP9321, 16s1, Week 6 3 A pattern is a proven solution to a problem

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.

Page 4: COMP9321 Web Application Engineering Design Patterns 1cs9321/16s1/lectures/lec06/Lec-06.pdf · Design Patterns COMP9321, 16s1, Week 6 3 A pattern is a proven solution to a problem

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.

Page 5: COMP9321 Web Application Engineering Design Patterns 1cs9321/16s1/lectures/lec06/Lec-06.pdf · Design Patterns COMP9321, 16s1, Week 6 3 A pattern is a proven solution to a problem

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

Page 6: COMP9321 Web Application Engineering Design Patterns 1cs9321/16s1/lectures/lec06/Lec-06.pdf · Design Patterns COMP9321, 16s1, Week 6 3 A pattern is a proven solution to a problem

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

Page 7: COMP9321 Web Application Engineering Design Patterns 1cs9321/16s1/lectures/lec06/Lec-06.pdf · Design Patterns COMP9321, 16s1, Week 6 3 A pattern is a proven solution to a problem

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.

Page 8: COMP9321 Web Application Engineering Design Patterns 1cs9321/16s1/lectures/lec06/Lec-06.pdf · Design Patterns COMP9321, 16s1, Week 6 3 A pattern is a proven solution to a problem

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

Page 9: COMP9321 Web Application Engineering Design Patterns 1cs9321/16s1/lectures/lec06/Lec-06.pdf · Design Patterns COMP9321, 16s1, Week 6 3 A pattern is a proven solution to a problem

J2EE Design Patterns

9 COMP9321, 16s1, Week 6

Page 10: COMP9321 Web Application Engineering Design Patterns 1cs9321/16s1/lectures/lec06/Lec-06.pdf · Design Patterns COMP9321, 16s1, Week 6 3 A pattern is a proven solution to a problem

J2EE Design Patterns

10 COMP9321, 16s1, Week 6

Page 11: COMP9321 Web Application Engineering Design Patterns 1cs9321/16s1/lectures/lec06/Lec-06.pdf · Design Patterns COMP9321, 16s1, Week 6 3 A pattern is a proven solution to a problem

Web Application Architecture

11 COMP9321, 16s1, Week 6

Page 12: COMP9321 Web Application Engineering Design Patterns 1cs9321/16s1/lectures/lec06/Lec-06.pdf · Design Patterns COMP9321, 16s1, Week 6 3 A pattern is a proven solution to a problem

Web Application Architecture

12 COMP9321, 16s1, Week 6

Page 13: COMP9321 Web Application Engineering Design Patterns 1cs9321/16s1/lectures/lec06/Lec-06.pdf · Design Patterns COMP9321, 16s1, Week 6 3 A pattern is a proven solution to a problem

Web Application Architecture

13 COMP9321, 16s1, Week 6

Page 14: COMP9321 Web Application Engineering Design Patterns 1cs9321/16s1/lectures/lec06/Lec-06.pdf · Design Patterns COMP9321, 16s1, Week 6 3 A pattern is a proven solution to a problem

Web Application Architecture

14 COMP9321, 16s1, Week 6

Page 15: COMP9321 Web Application Engineering Design Patterns 1cs9321/16s1/lectures/lec06/Lec-06.pdf · Design Patterns COMP9321, 16s1, Week 6 3 A pattern is a proven solution to a problem

Web Application Architecture

15 COMP9321, 16s1, Week 6

Page 16: COMP9321 Web Application Engineering Design Patterns 1cs9321/16s1/lectures/lec06/Lec-06.pdf · Design Patterns COMP9321, 16s1, Week 6 3 A pattern is a proven solution to a problem

Web Application Layers

16 COMP9321, 16s1, Week 6

Page 17: COMP9321 Web Application Engineering Design Patterns 1cs9321/16s1/lectures/lec06/Lec-06.pdf · Design Patterns COMP9321, 16s1, Week 6 3 A pattern is a proven solution to a problem

J2EE design guidelines: Web tier

17 COMP9321, 16s1, Week 6

Page 18: COMP9321 Web Application Engineering Design Patterns 1cs9321/16s1/lectures/lec06/Lec-06.pdf · Design Patterns COMP9321, 16s1, Week 6 3 A pattern is a proven solution to a problem

J2EE design guidelines: Web tier

18 COMP9321, 16s1, Week 6

Page 19: COMP9321 Web Application Engineering Design Patterns 1cs9321/16s1/lectures/lec06/Lec-06.pdf · Design Patterns COMP9321, 16s1, Week 6 3 A pattern is a proven solution to a problem

Servlet Design Guidelines

19 COMP9321, 16s1, Week 6

Page 20: COMP9321 Web Application Engineering Design Patterns 1cs9321/16s1/lectures/lec06/Lec-06.pdf · Design Patterns COMP9321, 16s1, Week 6 3 A pattern is a proven solution to a problem

Servlet design guidelines: When to use Servlets

20 COMP9321, 16s1, Week 6

Page 21: COMP9321 Web Application Engineering Design Patterns 1cs9321/16s1/lectures/lec06/Lec-06.pdf · Design Patterns COMP9321, 16s1, Week 6 3 A pattern is a proven solution to a problem

Servlet design guidelines: When to use Servlets

21 COMP9321, 16s1, Week 6

Page 22: COMP9321 Web Application Engineering Design Patterns 1cs9321/16s1/lectures/lec06/Lec-06.pdf · Design Patterns COMP9321, 16s1, Week 6 3 A pattern is a proven solution to a problem

JSP Design Guidelines

22 COMP9321, 16s1, Week 6

Page 23: COMP9321 Web Application Engineering Design Patterns 1cs9321/16s1/lectures/lec06/Lec-06.pdf · Design Patterns COMP9321, 16s1, Week 6 3 A pattern is a proven solution to a problem

JSP Design Guidelines

23 COMP9321, 16s1, Week 6

Page 24: COMP9321 Web Application Engineering Design Patterns 1cs9321/16s1/lectures/lec06/Lec-06.pdf · Design Patterns COMP9321, 16s1, Week 6 3 A pattern is a proven solution to a problem

JSP Design Guidelines

24 COMP9321, 16s1, Week 6

Page 25: COMP9321 Web Application Engineering Design Patterns 1cs9321/16s1/lectures/lec06/Lec-06.pdf · Design Patterns COMP9321, 16s1, Week 6 3 A pattern is a proven solution to a problem

JSP Design Guidelines

25 COMP9321, 16s1, Week 6

Page 26: COMP9321 Web Application Engineering Design Patterns 1cs9321/16s1/lectures/lec06/Lec-06.pdf · Design Patterns COMP9321, 16s1, Week 6 3 A pattern is a proven solution to a problem

JSP Design Guidelines

26 COMP9321, 16s1, Week 6

Page 27: COMP9321 Web Application Engineering Design Patterns 1cs9321/16s1/lectures/lec06/Lec-06.pdf · Design Patterns COMP9321, 16s1, Week 6 3 A pattern is a proven solution to a problem

JSP Design Guidelines

27 COMP9321, 16s1, Week 6

Page 28: COMP9321 Web Application Engineering Design Patterns 1cs9321/16s1/lectures/lec06/Lec-06.pdf · Design Patterns COMP9321, 16s1, Week 6 3 A pattern is a proven solution to a problem

JSP Design Guidelines

28 COMP9321, 16s1, Week 6

Page 29: COMP9321 Web Application Engineering Design Patterns 1cs9321/16s1/lectures/lec06/Lec-06.pdf · Design Patterns COMP9321, 16s1, Week 6 3 A pattern is a proven solution to a problem

JSP Design Guidelines

29 COMP9321, 16s1, Week 6

Page 30: COMP9321 Web Application Engineering Design Patterns 1cs9321/16s1/lectures/lec06/Lec-06.pdf · Design Patterns COMP9321, 16s1, Week 6 3 A pattern is a proven solution to a problem

General Guideline for Servlet/JSP/JavaBeans

30 COMP9321, 16s1, Week 6

Page 31: COMP9321 Web Application Engineering Design Patterns 1cs9321/16s1/lectures/lec06/Lec-06.pdf · Design Patterns COMP9321, 16s1, Week 6 3 A pattern is a proven solution to a problem

General Guideline for Servlet/JSP/JavaBeans

31 COMP9321, 16s1, Week 6

Page 32: COMP9321 Web Application Engineering Design Patterns 1cs9321/16s1/lectures/lec06/Lec-06.pdf · Design Patterns COMP9321, 16s1, Week 6 3 A pattern is a proven solution to a problem

General Guideline for Servlet/JSP/JavaBeans

32 COMP9321, 16s1, Week 6

Page 33: COMP9321 Web Application Engineering Design Patterns 1cs9321/16s1/lectures/lec06/Lec-06.pdf · Design Patterns COMP9321, 16s1, Week 6 3 A pattern is a proven solution to a problem

Structuring Web applications

Architectural Patterns

(MVC)

33 COMP9321, 16s1, Week 6

Page 34: COMP9321 Web Application Engineering Design Patterns 1cs9321/16s1/lectures/lec06/Lec-06.pdf · Design Patterns COMP9321, 16s1, Week 6 3 A pattern is a proven solution to a problem

Structuring Web applications

34 COMP9321, 16s1, Week 6

Page 35: COMP9321 Web Application Engineering Design Patterns 1cs9321/16s1/lectures/lec06/Lec-06.pdf · Design Patterns COMP9321, 16s1, Week 6 3 A pattern is a proven solution to a problem

Structuring Web applications

35 COMP9321, 16s1, Week 6

Page 36: COMP9321 Web Application Engineering Design Patterns 1cs9321/16s1/lectures/lec06/Lec-06.pdf · Design Patterns COMP9321, 16s1, Week 6 3 A pattern is a proven solution to a problem

Structuring Web applications

36 COMP9321, 16s1, Week 6

Page 37: COMP9321 Web Application Engineering Design Patterns 1cs9321/16s1/lectures/lec06/Lec-06.pdf · Design Patterns COMP9321, 16s1, Week 6 3 A pattern is a proven solution to a problem

Model 1 Example

37 COMP9321, 16s1, Week 6

Page 38: COMP9321 Web Application Engineering Design Patterns 1cs9321/16s1/lectures/lec06/Lec-06.pdf · Design Patterns COMP9321, 16s1, Week 6 3 A pattern is a proven solution to a problem

Model 1 Example

38 COMP9321, 16s1, Week 6

Page 39: COMP9321 Web Application Engineering Design Patterns 1cs9321/16s1/lectures/lec06/Lec-06.pdf · Design Patterns COMP9321, 16s1, Week 6 3 A pattern is a proven solution to a problem

Model 1 Example

39 COMP9321, 16s1, Week 6

Page 40: COMP9321 Web Application Engineering Design Patterns 1cs9321/16s1/lectures/lec06/Lec-06.pdf · Design Patterns COMP9321, 16s1, Week 6 3 A pattern is a proven solution to a problem

Model 1 Example

40 COMP9321, 16s1, Week 6

Page 41: COMP9321 Web Application Engineering Design Patterns 1cs9321/16s1/lectures/lec06/Lec-06.pdf · Design Patterns COMP9321, 16s1, Week 6 3 A pattern is a proven solution to a problem

Model 1 Example

41 COMP9321, 16s1, Week 6

Page 42: COMP9321 Web Application Engineering Design Patterns 1cs9321/16s1/lectures/lec06/Lec-06.pdf · Design Patterns COMP9321, 16s1, Week 6 3 A pattern is a proven solution to a problem

Model 1 Example

42 COMP9321, 16s1, Week 6

Page 43: COMP9321 Web Application Engineering Design Patterns 1cs9321/16s1/lectures/lec06/Lec-06.pdf · Design Patterns COMP9321, 16s1, Week 6 3 A pattern is a proven solution to a problem

Model 1 Architecture

43 COMP9321, 16s1, Week 6

Page 44: COMP9321 Web Application Engineering Design Patterns 1cs9321/16s1/lectures/lec06/Lec-06.pdf · Design Patterns COMP9321, 16s1, Week 6 3 A pattern is a proven solution to a problem

MVC

Model View Controller

44 COMP9321, 16s1, Week 6

Page 45: COMP9321 Web Application Engineering Design Patterns 1cs9321/16s1/lectures/lec06/Lec-06.pdf · Design Patterns COMP9321, 16s1, Week 6 3 A pattern is a proven solution to a problem

Model 2 Architecture = MVC pattern

45 COMP9321, 16s1, Week 6

Page 46: COMP9321 Web Application Engineering Design Patterns 1cs9321/16s1/lectures/lec06/Lec-06.pdf · Design Patterns COMP9321, 16s1, Week 6 3 A pattern is a proven solution to a problem

Model 2 Architecture = MVC pattern

46 COMP9321, 16s1, Week 6

Page 47: COMP9321 Web Application Engineering Design Patterns 1cs9321/16s1/lectures/lec06/Lec-06.pdf · Design Patterns COMP9321, 16s1, Week 6 3 A pattern is a proven solution to a problem

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

Page 48: COMP9321 Web Application Engineering Design Patterns 1cs9321/16s1/lectures/lec06/Lec-06.pdf · Design Patterns COMP9321, 16s1, Week 6 3 A pattern is a proven solution to a problem

MVC Components and Roles

48 COMP9321, 16s1, Week 6

http://www.oracle.com/technetwork/articles/javase/index-142890.html

Page 49: COMP9321 Web Application Engineering Design Patterns 1cs9321/16s1/lectures/lec06/Lec-06.pdf · Design Patterns COMP9321, 16s1, Week 6 3 A pattern is a proven solution to a problem

Model 2 Architecture = MVC pattern

49 COMP9321, 16s1, Week 6

Page 50: COMP9321 Web Application Engineering Design Patterns 1cs9321/16s1/lectures/lec06/Lec-06.pdf · Design Patterns COMP9321, 16s1, Week 6 3 A pattern is a proven solution to a problem

Model 2 Architecture = MVC pattern

50 COMP9321, 16s1, Week 6

Page 51: COMP9321 Web Application Engineering Design Patterns 1cs9321/16s1/lectures/lec06/Lec-06.pdf · Design Patterns COMP9321, 16s1, Week 6 3 A pattern is a proven solution to a problem

Model 2 Architecture = MVC pattern

51 COMP9321, 16s1, Week 6

Page 52: COMP9321 Web Application Engineering Design Patterns 1cs9321/16s1/lectures/lec06/Lec-06.pdf · Design Patterns COMP9321, 16s1, Week 6 3 A pattern is a proven solution to a problem

Model 2 Architecture = MVC pattern

52 COMP9321, 16s1, Week 6

Page 53: COMP9321 Web Application Engineering Design Patterns 1cs9321/16s1/lectures/lec06/Lec-06.pdf · Design Patterns COMP9321, 16s1, Week 6 3 A pattern is a proven solution to a problem

Case for a centralised controller

53 COMP9321, 16s1, Week 6

Page 54: COMP9321 Web Application Engineering Design Patterns 1cs9321/16s1/lectures/lec06/Lec-06.pdf · Design Patterns COMP9321, 16s1, Week 6 3 A pattern is a proven solution to a problem

Case for a centralised controller

54 COMP9321, 16s1, Week 6

Page 55: COMP9321 Web Application Engineering Design Patterns 1cs9321/16s1/lectures/lec06/Lec-06.pdf · Design Patterns COMP9321, 16s1, Week 6 3 A pattern is a proven solution to a problem

Case for multiple controllers

55 COMP9321, 16s1, Week 6

Page 56: COMP9321 Web Application Engineering Design Patterns 1cs9321/16s1/lectures/lec06/Lec-06.pdf · Design Patterns COMP9321, 16s1, Week 6 3 A pattern is a proven solution to a problem

FrontController Pattern

56 COMP9321, 16s1, Week 6

Page 57: COMP9321 Web Application Engineering Design Patterns 1cs9321/16s1/lectures/lec06/Lec-06.pdf · Design Patterns COMP9321, 16s1, Week 6 3 A pattern is a proven solution to a problem

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.

Page 58: COMP9321 Web Application Engineering Design Patterns 1cs9321/16s1/lectures/lec06/Lec-06.pdf · Design Patterns COMP9321, 16s1, Week 6 3 A pattern is a proven solution to a problem

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.

Page 59: COMP9321 Web Application Engineering Design Patterns 1cs9321/16s1/lectures/lec06/Lec-06.pdf · Design Patterns COMP9321, 16s1, Week 6 3 A pattern is a proven solution to a problem

FrontController implementation: Command Design Pattern

59 COMP9321, 16s1, Week 6

Page 60: COMP9321 Web Application Engineering Design Patterns 1cs9321/16s1/lectures/lec06/Lec-06.pdf · Design Patterns COMP9321, 16s1, Week 6 3 A pattern is a proven solution to a problem

Command Design Pattern

60 COMP9321, 16s1, Week 6

Page 61: COMP9321 Web Application Engineering Design Patterns 1cs9321/16s1/lectures/lec06/Lec-06.pdf · Design Patterns COMP9321, 16s1, Week 6 3 A pattern is a proven solution to a problem

Command Design Pattern

61 COMP9321, 16s1, Week 6

Page 62: COMP9321 Web Application Engineering Design Patterns 1cs9321/16s1/lectures/lec06/Lec-06.pdf · Design Patterns COMP9321, 16s1, Week 6 3 A pattern is a proven solution to a problem

Command Design Pattern

62 COMP9321, 16s1, Week 6

Page 63: COMP9321 Web Application Engineering Design Patterns 1cs9321/16s1/lectures/lec06/Lec-06.pdf · Design Patterns COMP9321, 16s1, Week 6 3 A pattern is a proven solution to a problem

Command Design Pattern

63 COMP9321, 16s1, Week 6

Page 64: COMP9321 Web Application Engineering Design Patterns 1cs9321/16s1/lectures/lec06/Lec-06.pdf · Design Patterns COMP9321, 16s1, Week 6 3 A pattern is a proven solution to a problem

Command Design Pattern

64 COMP9321, 16s1, Week 6

Page 65: COMP9321 Web Application Engineering Design Patterns 1cs9321/16s1/lectures/lec06/Lec-06.pdf · Design Patterns COMP9321, 16s1, Week 6 3 A pattern is a proven solution to a problem

Command Design Pattern

65 COMP9321, 16s1, Week 6

Page 66: COMP9321 Web Application Engineering Design Patterns 1cs9321/16s1/lectures/lec06/Lec-06.pdf · Design Patterns COMP9321, 16s1, Week 6 3 A pattern is a proven solution to a problem

Command Design Pattern

66 COMP9321, 16s1, Week 6

Page 67: COMP9321 Web Application Engineering Design Patterns 1cs9321/16s1/lectures/lec06/Lec-06.pdf · Design Patterns COMP9321, 16s1, Week 6 3 A pattern is a proven solution to a problem

Command Design Pattern

67 COMP9321, 16s1, Week 6

Page 68: COMP9321 Web Application Engineering Design Patterns 1cs9321/16s1/lectures/lec06/Lec-06.pdf · Design Patterns COMP9321, 16s1, Week 6 3 A pattern is a proven solution to a problem

Command Design Pattern

68 COMP9321, 16s1, Week 6

Page 69: COMP9321 Web Application Engineering Design Patterns 1cs9321/16s1/lectures/lec06/Lec-06.pdf · Design Patterns COMP9321, 16s1, Week 6 3 A pattern is a proven solution to a problem

Command Design Pattern

69 COMP9321, 16s1, Week 6

Page 70: COMP9321 Web Application Engineering Design Patterns 1cs9321/16s1/lectures/lec06/Lec-06.pdf · Design Patterns COMP9321, 16s1, Week 6 3 A pattern is a proven solution to a problem

Command Design Pattern

70 COMP9321, 16s1, Week 6

Page 71: COMP9321 Web Application Engineering Design Patterns 1cs9321/16s1/lectures/lec06/Lec-06.pdf · Design Patterns COMP9321, 16s1, Week 6 3 A pattern is a proven solution to a problem

Identifying the Command Pattern in the phonebook lab

71 COMP9321, 16s1, Week 6

Page 72: COMP9321 Web Application Engineering Design Patterns 1cs9321/16s1/lectures/lec06/Lec-06.pdf · Design Patterns COMP9321, 16s1, Week 6 3 A pattern is a proven solution to a problem

Implementing the Command Pattern

72 COMP9321, 16s1, Week 6

Page 73: COMP9321 Web Application Engineering Design Patterns 1cs9321/16s1/lectures/lec06/Lec-06.pdf · Design Patterns COMP9321, 16s1, Week 6 3 A pattern is a proven solution to a problem

Typical "Assignment 2" Architecture

73 COMP9321, 16s1, Week 6

Page 74: COMP9321 Web Application Engineering Design Patterns 1cs9321/16s1/lectures/lec06/Lec-06.pdf · Design Patterns COMP9321, 16s1, Week 6 3 A pattern is a proven solution to a problem

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)

Page 75: COMP9321 Web Application Engineering Design Patterns 1cs9321/16s1/lectures/lec06/Lec-06.pdf · Design Patterns COMP9321, 16s1, Week 6 3 A pattern is a proven solution to a problem

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

Page 76: COMP9321 Web Application Engineering Design Patterns 1cs9321/16s1/lectures/lec06/Lec-06.pdf · Design Patterns COMP9321, 16s1, Week 6 3 A pattern is a proven solution to a problem

76 COMP9321, 16s1, Week 6