SlideShare a Scribd company logo
1 of 42
Download to read offline
© People Strategists www.peoplestrategists.com Slide 1 of 42
Agile Development
and Design Patterns - II
© People Strategists www.peoplestrategists.com Slide 2 of 42
Objectives
In this session, you will learn to:
Identify the structural design pattern
Identify the behavioral design patterns
Identify the J2EE design patterns
Identify the Web application architecture
Explore the JEE architecture
© People Strategists www.peoplestrategists.com Slide 3 of 42
Identify the Structural Design Patterns
Structural design patterns:
Serve as a blueprint for how different classes and objects are combined to
form larger structures.
Provide a manner to define relationships between classes or objects.
Describes how data moves through the pattern.
Some of the common structural design patterns are:
 Adaptor
 Bridge
 Decorator
 Facade
© People Strategists www.peoplestrategists.com Slide 4 of 42
Adapter Design Pattern:
Defines a manner for creating relationships between classes.
Is a design pattern that is used to allow two incompatible types to
communicate.
Converts the interface of a class into another interface clients expect.
Identify the Structural Design Patterns (Contd.)
© People Strategists www.peoplestrategists.com Slide 5 of 42
The following figure depicts the implementation of the adapter design
pattern.
<<interface>>
ITarget
+MethodA(): void
Adapter
+MethodA(): void
-adaptee: Adaptee
Adaptee
+MethodB(): void
Client
adaptee.MethodB
Identify the Structural Design Patterns (Contd.)
© People Strategists www.peoplestrategists.com Slide 6 of 42
The classes/objects participating in the preceding adapter pattern are:
ITarget: Defines the domain-specific interface that Client uses.
Adapter: Adapts the interface Adaptee to the Target interface.
Adaptee: Defines an existing interface that needs adapting.
Client: Collaborates with objects conforming to the Target interface.
Implementation for the adapter design is given in the embedded code.
Identify the Structural Design Patterns (Contd.)
© People Strategists www.peoplestrategists.com Slide 7 of 42
Bridge Design Pattern:
Defines a manner for creating relationships between classes or entities.
Is used to separate the abstract elements of a class from the
implementation details.
Is used to share an implementation among multiple objects.
Hides implementation details from clients.
Identify the Structural Design Patterns (Contd.)
© People Strategists www.peoplestrategists.com Slide 8 of 42
The following figure depicts the implementation of the bridge design
pattern.
Implementation for the bridge design is given in the embedded code.
<<interface>>
DrawAPI
+drawCircle(): void
RedCircle
+drawCircle(): void
GreenCircle
Shape
Uses+drawAPI(): DrawAPI
+Shape(): void
+Draw(): String
BridgePatternDemo
+main(): void
Circle
+drawCircle(): void
-x, y, radius :int
+Shape(): void
+Draw(): String
Uses
implement
extends
Uses Uses
Identify the Structural Design Patterns (Contd.)
© People Strategists www.peoplestrategists.com Slide 9 of 42
Decorator Design Pattern:
Defines a manner for creating relationships between classes or entities.
Creates a decorator class which wraps the original class and provides
additional functionality keeping class methods signature intact.
Is used to extend or alter the functionality of objects at run-time by
wrapping them in an object of a decorator class.
Is used to extend the functionality of individual objects, not classes. This
means that the modifications are made at run-time rather than at design
time.
Provides a flexible alternative to using inheritance to modify behavior.
Identify the Structural Design Patterns (Contd.)
© People Strategists www.peoplestrategists.com Slide 10 of 42
The following figure depicts the implementation of the decorator
design pattern.
Implementation for the decorator design pattern is given in the
embedded code.
DecoratorPatternDemo
+main(): void
Circle
+draw(): void
Rectangle
Shape
Uses+Draw(): void
+draw(): void
implement
RedShapeDecorator
+shape: Shape
+RedShapeDecorator()
+draw(): void
-setRedBorder(): void
ShapeDecorator
+shape: Shape
+ShapeDecorator()
+draw(): void
<<Interface>>
Ask
implement
Identify the Structural Design Patterns (Contd.)
© People Strategists www.peoplestrategists.com Slide 11 of 42
Facade Design Pattern:
Defines a manner for creating relationships between classes or entities.
Is used to define a simplified interface to a more complex subsystem.
Is ideal when working with a large number of interdependent classes, or
with classes that require the use of multiple methods.
Is useful when wrapping subsystems that are poorly designed but cannot be
refactored because the source code is unavailable or the existing interface is
widely used.
Involves a single class which provides simplified methods required by client
and delegates calls to methods of existing system classes.
Identify the Structural Design Patterns (Contd.)
© People Strategists www.peoplestrategists.com Slide 12 of 42
The following figure depicts the implementation of the facade design
pattern.
Implementation for the facade design pattern is given in the embedded
code.
FacadePatternDemo
+main(): void
Circle
+draw(): void
Rectangle
Shape
<<interface>>
+Draw(): void
+draw(): void
implement
RedShapeDecorator
+circle: Shape
+rectangle: Shape
+square: shape
+ShapeMaker()
+drawCircle(): void
+drawRectangle(): void
+drawSquare(): void
Square
+draw(): void
implement
Creates
Identify the Structural Design Patterns (Contd.)
Ask
© People Strategists www.peoplestrategists.com Slide 13 of 42
Identify the Behavioral Design Patterns
Behavioral Design Pattern:
Explains how objects interact.
It describes how different objects and classes send messages to each other to
make things happen and how the steps of a task are divided among different
objects.
In this implementation and the client should be loosely coupled in order to
avoid hard-coding and dependencies.
This pattern characterizes object communication and simplifies the dynamic
control flow of object behavior.
If Creational pattern is about instantiation, and structural pattern is the
blueprint, then behavioral is the pattern of the relationship among objects.
Some of the common patterns come under it are:
 Strategy
 Command
 Iterator
© People Strategists www.peoplestrategists.com Slide 14 of 42
Identify the Behavioral Design Patterns (Contd.)
Strategy Design Pattern:
Defines a manner for controlling communication between classes or entities.
The strategy pattern is used to create an interchangeable family of algorithms
from which the required process is chosen at run-time.
This allows the behavior of a program to change dynamically according to
configuration details or user preferences.
It also increases flexibility by allowing new algorithms to be easily
incorporated in the future.
© People Strategists www.peoplestrategists.com Slide 15 of 42
The following figure depicts the implementation of the strategy design
pattern.
Implementation for the strategy design pattern is given in the embedded
code.
StrategyPatternDemo
+main(): void
OperationAdd
+doOperation(): int
OperationSubstract
Strategy
<<interface>>
+DoOpeation(): int
implement
Context
+strategy: Strategy
OperationMultiply
implement
Uses
Identify the Behavioral Design Patterns (Contd.)
+executeStrategy: int
+doOperation(): int+doOperation(): int
implement
Ask
© People Strategists www.peoplestrategists.com Slide 16 of 42
Identify the Behavioral Design Patterns (Contd.)
Command Design Pattern:
Defines a manner for controlling communication between classes or entities.
Is used to express a request, including the call to be made and all of its
required parameters, in a command object.
Is useful when supporting activities that require the execution of a series of
commands.
The command objects can be held in a queue and processed sequentially.
Use to decouple the object with its trigger.
Easily to be extensible by not touching the old structure.
© People Strategists www.peoplestrategists.com Slide 17 of 42
The following figure depicts the implementation of the command design
pattern.
Implementation for the command design pattern is given in the
embedded code.
Identify the Behavioral Design Patterns (Contd.)
CommandPatternDemo
+main(): void
Order
+execute(): void
<<interface>>
Broker
-orders: List
implement
Uses
+takeOrder(): void
+placeOrders(): void
BuyStock
+BuyStock()
+execute()
SellStock
+BuyStock()
+execute()
Uses
Stock
-name: String
-quantity: int
+buy(): void
+sell(): void
Uses
-stock: Stock -stock: Stock
© People Strategists www.peoplestrategists.com Slide 18 of 42
Iterator Pattern Design:
Is used to provide a standard interface for traversing a collection of items in
an aggregate object without understanding the underlying structure of that
object.
Is commonly used design pattern in Java and .Net programming environment.
Iterator should be implemented as an interface.
Identify the Behavioral Design Patterns (Contd.)
© People Strategists www.peoplestrategists.com Slide 19 of 42
The following figure depicts the implementation of the iterator design
pattern.
Implementation for the iterator design pattern is given in the
embedded code.
Identify the Behavioral Design Patterns (Contd.)
Iterator
+hasNext(): boolean
+next(): Object
<<interface>>
NameIteratorUsesNameRepository
+getIterator(): iterator
implement
Container
+getIterator(): iterator
Uses
-name: String []
+hasNext(): boolean
+next(): Object
main(): void
IteratorPatternDemo
Uses
<<interface>>
implement
© People Strategists www.peoplestrategists.com Slide 20 of 42
Identifying the Web application Architecture
Web applications:
are programs that are executed on a server and accessed from a Web
browser.
enable organizations to share and access information on the Internet.
are usually divided into the following logical chunks known as tiers:
 Presentation:
 It is the top-most tier in the Web application architecture.
 It provides a UI that allows the users to interact and communicate with the
applications.
 Business logic:
 It is the middle tier in the Web application architecture.
 It contains the logic related to the business decisions of the organization.
 Data access:
 It is the last tier in the Web application architecture.
 It contains the logic that enables you to access the data stored in various data
sources, such as
 Relational Database Management Systems (RDBMS), Extensible Markup
Language (XML), and text files.
© People Strategists www.peoplestrategists.com Slide 21 of 42
Identifying the Web application Architecture
The following figure depicts the example of Web applications.
© People Strategists www.peoplestrategists.com Slide 22 of 42
Identifying the Web application Architecture (Contd.)
Based on the complexity of the Web application, it might follow any of
the following Web application architecture:
Single-tier
Two-tier
Three/n-tier
© People Strategists www.peoplestrategists.com Slide 23 of 42
Identifying the Web application Architecture (Contd.)
Single-Tier Architecture:
Is also known as the monolithic architecture.
In this architecture, the presentation logic, the business logic, and the data
access logic are packaged on the same computer.
These layers are tightly coupled that means if you make changes to any
one of them, you also need to modify others.
The following figure depicts the single-tier application architecture.
© People Strategists www.peoplestrategists.com Slide 24 of 42
Identifying the Web application Architecture (Contd.)
Two-tier Architecture:
In this architecture, the presentation logic resides on the client.
The business logic may reside either on the client or on the server.
The data access logic resides on the server.
Depending on the business requirements, it can be of the following types:
 A fat client and thin server:
 In this type, the presentation logic and the business logic reside on the client,
and the data access logic resides on the server.
 This application architecture helps in reducing the load on the server.
 The following figure depicts a fat client and thin server application
architecture.
© People Strategists www.peoplestrategists.com Slide 25 of 42
Identifying the Web application Architecture (Contd.)
 A fat server and thin client:
 In this type, the client contains only the presentation logic.
 The business logic and the data access logic reside on the server.
 This type of architecture is easily managed, less prone to security risks, and
offers low maintenance and licensing costs.
 The following figure displays the layout of the layers in a fat server and thin
client application architecture.
© People Strategists www.peoplestrategists.com Slide 26 of 42
Identifying the Web application Architecture (Contd.)
Three-tier/N-tier Architecture:
In the three-tier architecture, the presentation logic, business logic, and
data access logic are separated into different layers, as shown in the
following figure.
© People Strategists www.peoplestrategists.com Slide 27 of 42
Java Enterprise Edition:
Is Oracle's enterprise Java computing platform.
Is an open and standard based platform for developing, deploying, and
managing n-tier, Web-enabled, server-centric, and
component-based enterprise applications.
Identifying Java Enterprise Edition (EE)
© People Strategists www.peoplestrategists.com Slide 28 of 42
Identify the J2EE Design Patterns
J2EE Design Patterns:
Identify potential problems encountered when using the various J2EE-
specified technologies and help developers construct an application
architecture's requirements.
Are specifically concerned with the presentation tier.
Are identified by Sun Java Center.
Some of the common J2EE patterns are :
 Data Access Object (DAO) design pattern
 Model-View-Design (MVC) design pattern
© People Strategists www.peoplestrategists.com Slide 29 of 42
Identify the J2EE Design Patterns (Contd.)
Data Access Object (DAO) Design Pattern:
Is used to separate low level data accessing API or operations from high
level business services. Adapt a uniform interface to access multiple
databases like relational, un-relational, object-oriented, etc.
Participants of the DAO pattern are.
 Data Access Object Interface: This interface defines the standard operations to
be performed on a model object(s).
 Data Access Object concrete class: This class implements above interface. This
class is responsible to get data from a data source which can be database / xml
or any other storage mechanism.
 Model Object or Value Object: This object is simple POJO containing get/set
methods to store data retrieved using DAO class.
© People Strategists www.peoplestrategists.com Slide 30 of 42
The following figure depicts the implementation of the DAO design pattern.
Implementation for the DAO design pattern is given in the
embedded code.
Identify the J2EE Design Patterns (Contd.)
StudentDao DAOPatternDemo
Uses
+getAllStudents(): List
+updateStudent(): void
+deleteStudent(): void
+addStudent(): void
StudentDaoImpl
+studentDaoImpl()
+getAllStudent(): List
+updateStudent(): void
+deleteStudent(): void
+addStudent(): void
-student: List
+main(): void
+Student()
+getName(): String
+setName(): void
+getRollNo(): int
+setRollNo(): String
Student
Implement
<<interface>>
-name: String
-Rollno: int
Uses
© People Strategists www.peoplestrategists.com Slide 31 of 42
Identify the J2EE Design Patterns (Contd.)
MVC Design Pattern:
Is a design pattern for the architecture of Web applications.
Is mainly is to achieve a clean separation between three components
of most any Web application.
Three components of MVC pattern are:
 Model:
 Is Java beans with their properties and methods.
 It contain the business logics and functions that manipulate the business
data.
 View:
 Is the Java Server Pages (JSP's) or HTML pages.
 It only takes care of the presentation of the data and are known as
presentation layer.
 Controller:
 It accepts and intercepts user requests and controls the business objects
to fulfill these requests.
 Is a JSP or servlet file.
© People Strategists www.peoplestrategists.com Slide 32 of 42
The following figure depicts the implementation of the MVC design pattern.
Implementation for the MVC design pattern is given in the
embedded code.
Identify the J2EE Design Patterns (Contd.)
StudentController
-model: Student
-view: StudentView
MVCPatternDemo
Uses
+StudentController()
+setStudentName(): void
+getStudentName(): String
+setStudentRollNo(): void
+getStudentRollNo(): String
+updateView(): void
Student
+getName(): String
+setName(): void
+getRollNo(): String
+setRollNo(): void
-rollno: String
-name: String
+main(): void
+retriveStudentFromDat
abase(): Student
+printStudentDetails(): void
StudentView
Updates
Uses
© People Strategists www.peoplestrategists.com Slide 33 of 42
Java EE comprises of the following application architecture:
Web-centric architecture
EJB component-centric architecture
Business-to-business (B2B) application architecture
Web service application architecture
Exploring Java EE Application Architecture
© People Strategists www.peoplestrategists.com Slide 34 of 42
The following figure depicts the Web-centric configuration of the
Java EE application server (Java EE server) middle tier.
In this architecture, the Web container of the Java EE technology
server hosts all of the components that are required to generate the
client view, process the business logic, and connect with the
back-end data store.
Java EE Web-Centric Architecture
Java EE Web-Centric Architecture
© People Strategists www.peoplestrategists.com Slide 35 of 42
The following figure depicts the EJB component-based
configuration of the Java EE application server (Java EE server).
This architecture uses both the Web container and EJB containers of
the Java EE server.
In this model, the business logic and data access components are
located in the EJB container.
Java EE EJB Component–Centric Architecture
Java EE EJB Component-Centric Architecture
© People Strategists www.peoplestrategists.com Slide 36 of 42
The following figure depicts the Java EE technology B2B application
architecture.
It is an extension of the Java EE technology EJB component–based
architecture and involves two EJB servers, one in each business
location.
Each Java EE server hosts a web container and an EJB container.
This architecture allows for peer-to-peer communications between
the corresponding containers in the two Java EE servers.
Java EE B2B Application Architecture
Java EE B2B Application Architecture
© People Strategists www.peoplestrategists.com Slide 37 of 42
The following figure depicts Java EE Web service application architecture.
It starts with the Java™ 2 Platform, Enterprise Edition (J2EE™) 1.4 platform.
Java EE component developer can expose the functionality of Java EE
business components by using Web service technology.
Java EE Web Service Application Architecture
Java EE Web Service Architecture
© People Strategists www.peoplestrategists.com Slide 38 of 42
Identifying MVC Architecture
MVC is a software architectural pattern for implementing user interfaces.
It’s main aim is to separate the business logic and application data from
the presentation data to the user.
The following figure displays the MVC architecture.
MVC Architecture
© People Strategists www.peoplestrategists.com Slide 39 of 42
Summary
Structural design patterns serve as a blueprint for how different classes
and objects are combined to form larger structures.
Adapter design pattern defines a manner for creating relationships
between classes.
Bridge design is used to separate the abstract elements of a class from the
implementation details.
Decorator design pattern creates a decorator class which wraps the
original class and provides additional functionality keeping class methods
signature intact.
Facade design pattern is used to define a simplified interface to a more
complex subsystem.
Behavioral design pattern Explains how objects interact.
Strategy design pattern is used to create an interchangeable family of
algorithms from which the required process is chosen at run-time.
© People Strategists www.peoplestrategists.com Slide 40 of 42
Summary (Contd.)
Command design pattern is used to express a request, including the call to
be made and all of its required parameters, in a command object.
Iterator pattern design is used to provide a standard interface for
traversing a collection of items in an aggregate object without
understanding the underlying structure of that object.
Web applications are programs that are executed on a server and accessed
from a Web browser.
Presentation tier provides a UI that allows the users to interact and
communicate with the applications.
Business logic tier contains the logic related to the business decisions of
the organization.
Data access tier contains the logic that enables you to access the data
stored in various data sources.
In single-tier architecture, the presentation logic, the business logic,
and the data access logic are packaged on the same computer.
© People Strategists www.peoplestrategists.com Slide 41 of 42
Summary (Contd.)
In two-tier architecture, the presentation logic resides on the client, the
business logic may reside either on the client or on the server, and the
data access logic resides on the server.
J2EE design patterns identify potential problems encountered when using
the various J2EE-specified technologies and help developers construct an
application architecture's requirements.
DAO) design pattern is used to separate low level data accessing API or
operations from high level business services.
MVC design pattern is a design pattern for the architecture of Web
applications and mainly is to achieve a clean separation between three
components of most any Web application.
In Java EE Web-centric architecture, the Web container of the Java EE
technology server hosts all of the components that are required to
generate the client view, process the business logic, and connect with the
back-end data store.
© People Strategists www.peoplestrategists.com Slide 42 of 42
Summary (Contd.)
Java EE EJB component-centric architecture uses both the Web container
and EJB containers of the Java EE server.
Java EE B2B application architecture is an extension of the Java EE
technology EJB component–based architecture and involves two EJB
servers, one in each business location.
Java EE Web Service Application Architecture starts with the Java™ 2
Platform, Enterprise Edition (J2EE™) 1.4 platform.

More Related Content

What's hot

MAPPING OF TRADITIONAL SOFTWARE DEVELOPMENT METHODS TO AGILE METHODOLOGY
MAPPING OF TRADITIONAL SOFTWARE DEVELOPMENT METHODS TO AGILE METHODOLOGYMAPPING OF TRADITIONAL SOFTWARE DEVELOPMENT METHODS TO AGILE METHODOLOGY
MAPPING OF TRADITIONAL SOFTWARE DEVELOPMENT METHODS TO AGILE METHODOLOGYcscpconf
 
04 designing architectures
04 designing architectures04 designing architectures
04 designing architecturesMajong DevJfu
 
Organizing Design-Driven Development Using Rational Requirements Composer
Organizing Design-Driven Development Using Rational Requirements ComposerOrganizing Design-Driven Development Using Rational Requirements Composer
Organizing Design-Driven Development Using Rational Requirements ComposerKurt Solarte
 
White paper - Adhoc 2.0
White paper - Adhoc 2.0White paper - Adhoc 2.0
White paper - Adhoc 2.0Nuno Brito
 
Microsoft Abbreviations Dictionary
Microsoft Abbreviations DictionaryMicrosoft Abbreviations Dictionary
Microsoft Abbreviations DictionaryIAMCP MENTORING
 
DevOps shifting software engineering strategy Value based perspective
DevOps shifting software engineering strategy Value based perspectiveDevOps shifting software engineering strategy Value based perspective
DevOps shifting software engineering strategy Value based perspectiveiosrjce
 
Modernizing the Enterprise Monolith: EQengineered Consulting Green Paper
Modernizing the Enterprise Monolith: EQengineered Consulting Green PaperModernizing the Enterprise Monolith: EQengineered Consulting Green Paper
Modernizing the Enterprise Monolith: EQengineered Consulting Green PaperMark Hewitt
 
An Agile Software Development Framework
An Agile Software Development FrameworkAn Agile Software Development Framework
An Agile Software Development FrameworkWaqas Tariq
 
Product Overview & Client Presentation August 2018
Product Overview & Client Presentation August 2018Product Overview & Client Presentation August 2018
Product Overview & Client Presentation August 2018Skillslive
 

What's hot (18)

MAPPING OF TRADITIONAL SOFTWARE DEVELOPMENT METHODS TO AGILE METHODOLOGY
MAPPING OF TRADITIONAL SOFTWARE DEVELOPMENT METHODS TO AGILE METHODOLOGYMAPPING OF TRADITIONAL SOFTWARE DEVELOPMENT METHODS TO AGILE METHODOLOGY
MAPPING OF TRADITIONAL SOFTWARE DEVELOPMENT METHODS TO AGILE METHODOLOGY
 
Writwik (1)
Writwik (1)Writwik (1)
Writwik (1)
 
04 designing architectures
04 designing architectures04 designing architectures
04 designing architectures
 
Organizing Design-Driven Development Using Rational Requirements Composer
Organizing Design-Driven Development Using Rational Requirements ComposerOrganizing Design-Driven Development Using Rational Requirements Composer
Organizing Design-Driven Development Using Rational Requirements Composer
 
Agile.usability
Agile.usabilityAgile.usability
Agile.usability
 
White paper - Adhoc 2.0
White paper - Adhoc 2.0White paper - Adhoc 2.0
White paper - Adhoc 2.0
 
Bharath Kumar C
Bharath Kumar CBharath Kumar C
Bharath Kumar C
 
synergy project white paper
synergy project white papersynergy project white paper
synergy project white paper
 
Microsoft Abbreviations Dictionary
Microsoft Abbreviations DictionaryMicrosoft Abbreviations Dictionary
Microsoft Abbreviations Dictionary
 
Subhadra Banerjee_latest
Subhadra Banerjee_latestSubhadra Banerjee_latest
Subhadra Banerjee_latest
 
Vb ch 1-introduction
Vb ch 1-introductionVb ch 1-introduction
Vb ch 1-introduction
 
Articulo acm
Articulo acmArticulo acm
Articulo acm
 
Ravindra Prasad
Ravindra PrasadRavindra Prasad
Ravindra Prasad
 
DevOps shifting software engineering strategy Value based perspective
DevOps shifting software engineering strategy Value based perspectiveDevOps shifting software engineering strategy Value based perspective
DevOps shifting software engineering strategy Value based perspective
 
Modernizing the Enterprise Monolith: EQengineered Consulting Green Paper
Modernizing the Enterprise Monolith: EQengineered Consulting Green PaperModernizing the Enterprise Monolith: EQengineered Consulting Green Paper
Modernizing the Enterprise Monolith: EQengineered Consulting Green Paper
 
An Agile Software Development Framework
An Agile Software Development FrameworkAn Agile Software Development Framework
An Agile Software Development Framework
 
Veera-Profile
Veera-ProfileVeera-Profile
Veera-Profile
 
Product Overview & Client Presentation August 2018
Product Overview & Client Presentation August 2018Product Overview & Client Presentation August 2018
Product Overview & Client Presentation August 2018
 

Viewers also liked (20)

Java Day-2
Java Day-2Java Day-2
Java Day-2
 
Java Day-4
Java Day-4Java Day-4
Java Day-4
 
Android - Day 2
Android - Day 2Android - Day 2
Android - Day 2
 
Java Day-7
Java Day-7Java Day-7
Java Day-7
 
Identifing Listeners and Filters
Identifing Listeners and FiltersIdentifing Listeners and Filters
Identifing Listeners and Filters
 
MongoDB Session 1
MongoDB Session 1MongoDB Session 1
MongoDB Session 1
 
Working with Servlets
Working with ServletsWorking with Servlets
Working with Servlets
 
Hibernate III
Hibernate IIIHibernate III
Hibernate III
 
JSP Technology II
JSP Technology IIJSP Technology II
JSP Technology II
 
MongoDB Session 2
MongoDB Session 2MongoDB Session 2
MongoDB Session 2
 
Java Day-6
Java Day-6Java Day-6
Java Day-6
 
Final Table of Content
Final Table of ContentFinal Table of Content
Final Table of Content
 
RDBMS with MySQL
RDBMS with MySQLRDBMS with MySQL
RDBMS with MySQL
 
JSP Technology I
JSP Technology IJSP Technology I
JSP Technology I
 
Spring Framework-II
Spring Framework-IISpring Framework-II
Spring Framework-II
 
Exploring Maven SVN GIT
Exploring Maven SVN GITExploring Maven SVN GIT
Exploring Maven SVN GIT
 
Hibernate presentation
Hibernate presentationHibernate presentation
Hibernate presentation
 
Basic Hibernate Final
Basic Hibernate FinalBasic Hibernate Final
Basic Hibernate Final
 
Hibernate I
Hibernate IHibernate I
Hibernate I
 
JDBC
JDBCJDBC
JDBC
 

Similar to Agile Dev. I

Object oriented sad-5 part i
Object oriented sad-5 part iObject oriented sad-5 part i
Object oriented sad-5 part iBisrat Girma
 
Software Architecture and Project Management module III : PATTERN OF ENTERPRISE
Software Architecture and Project Management module III : PATTERN OF ENTERPRISESoftware Architecture and Project Management module III : PATTERN OF ENTERPRISE
Software Architecture and Project Management module III : PATTERN OF ENTERPRISEsreeja_rajesh
 
Cs 1023 lec 4 (week 1)
Cs 1023 lec 4 (week 1)Cs 1023 lec 4 (week 1)
Cs 1023 lec 4 (week 1)stanbridge
 
Typescript design patterns applied to sharepoint framework - Sharepoint Satur...
Typescript design patterns applied to sharepoint framework - Sharepoint Satur...Typescript design patterns applied to sharepoint framework - Sharepoint Satur...
Typescript design patterns applied to sharepoint framework - Sharepoint Satur...Luis Valencia
 
Prophecy Of Design Patterns
Prophecy Of Design PatternsProphecy Of Design Patterns
Prophecy Of Design Patternspradeepkothiyal
 
Simon Brown: Software Architecture as Code at I T.A.K.E. Unconference 2015
Simon Brown: Software Architecture as Code at I T.A.K.E. Unconference 2015Simon Brown: Software Architecture as Code at I T.A.K.E. Unconference 2015
Simon Brown: Software Architecture as Code at I T.A.K.E. Unconference 2015Mozaic Works
 
Exploiting the Data / Code Duality with Dali
Exploiting the Data / Code Duality with DaliExploiting the Data / Code Duality with Dali
Exploiting the Data / Code Duality with DaliCarl Steinbach
 
How to design an application correctly ?
How to design an application correctly ?How to design an application correctly ?
How to design an application correctly ?Guillaume AGIS
 
C4_Architecture_Diagrams_CE_Karunagappally.pptx
C4_Architecture_Diagrams_CE_Karunagappally.pptxC4_Architecture_Diagrams_CE_Karunagappally.pptx
C4_Architecture_Diagrams_CE_Karunagappally.pptxDileep Kumar K
 
Design concepts and principle,
Design concepts and principle, Design concepts and principle,
Design concepts and principle, awikhan12
 
Naviswork - Self study work.pdf
Naviswork - Self study work.pdfNaviswork - Self study work.pdf
Naviswork - Self study work.pdfrasheed513926
 

Similar to Agile Dev. I (20)

Object oriented sad-5 part i
Object oriented sad-5 part iObject oriented sad-5 part i
Object oriented sad-5 part i
 
Software Architecture and Project Management module III : PATTERN OF ENTERPRISE
Software Architecture and Project Management module III : PATTERN OF ENTERPRISESoftware Architecture and Project Management module III : PATTERN OF ENTERPRISE
Software Architecture and Project Management module III : PATTERN OF ENTERPRISE
 
Ch09
Ch09Ch09
Ch09
 
Ch09
Ch09Ch09
Ch09
 
06 fse design
06 fse design06 fse design
06 fse design
 
Bridge Pattern
Bridge PatternBridge Pattern
Bridge Pattern
 
Cs 1023 lec 4 (week 1)
Cs 1023 lec 4 (week 1)Cs 1023 lec 4 (week 1)
Cs 1023 lec 4 (week 1)
 
The Perfect Couple
The Perfect CoupleThe Perfect Couple
The Perfect Couple
 
Typescript design patterns applied to sharepoint framework - Sharepoint Satur...
Typescript design patterns applied to sharepoint framework - Sharepoint Satur...Typescript design patterns applied to sharepoint framework - Sharepoint Satur...
Typescript design patterns applied to sharepoint framework - Sharepoint Satur...
 
Prophecy Of Design Patterns
Prophecy Of Design PatternsProphecy Of Design Patterns
Prophecy Of Design Patterns
 
Simon Brown: Software Architecture as Code at I T.A.K.E. Unconference 2015
Simon Brown: Software Architecture as Code at I T.A.K.E. Unconference 2015Simon Brown: Software Architecture as Code at I T.A.K.E. Unconference 2015
Simon Brown: Software Architecture as Code at I T.A.K.E. Unconference 2015
 
Design patterns
Design patternsDesign patterns
Design patterns
 
Design Patterns
Design PatternsDesign Patterns
Design Patterns
 
Exploiting the Data / Code Duality with Dali
Exploiting the Data / Code Duality with DaliExploiting the Data / Code Duality with Dali
Exploiting the Data / Code Duality with Dali
 
Slides chapter 9
Slides chapter 9Slides chapter 9
Slides chapter 9
 
How to design an application correctly ?
How to design an application correctly ?How to design an application correctly ?
How to design an application correctly ?
 
C4_Architecture_Diagrams_CE_Karunagappally.pptx
C4_Architecture_Diagrams_CE_Karunagappally.pptxC4_Architecture_Diagrams_CE_Karunagappally.pptx
C4_Architecture_Diagrams_CE_Karunagappally.pptx
 
Design concepts and principle,
Design concepts and principle, Design concepts and principle,
Design concepts and principle,
 
Decorator design pattern
Decorator design patternDecorator design pattern
Decorator design pattern
 
Naviswork - Self study work.pdf
Naviswork - Self study work.pdfNaviswork - Self study work.pdf
Naviswork - Self study work.pdf
 

More from People Strategists (13)

MongoDB Session 3
MongoDB Session 3MongoDB Session 3
MongoDB Session 3
 
Android - Day 1
Android - Day 1Android - Day 1
Android - Day 1
 
Overview of web services
Overview of web servicesOverview of web services
Overview of web services
 
Spring Framework - III
Spring Framework - IIISpring Framework - III
Spring Framework - III
 
Spring Framework -I
Spring Framework -ISpring Framework -I
Spring Framework -I
 
Hibernate II
Hibernate IIHibernate II
Hibernate II
 
Overview of JEE Technology
Overview of JEE TechnologyOverview of JEE Technology
Overview of JEE Technology
 
XML Schemas
XML SchemasXML Schemas
XML Schemas
 
JSON and XML
JSON and XMLJSON and XML
JSON and XML
 
Ajax and Jquery
Ajax and JqueryAjax and Jquery
Ajax and Jquery
 
CSS
CSSCSS
CSS
 
HTML/HTML5
HTML/HTML5HTML/HTML5
HTML/HTML5
 
Java Day-3
Java Day-3Java Day-3
Java Day-3
 

Recently uploaded

Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetEnjoy Anytime
 

Recently uploaded (20)

Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 

Agile Dev. I

  • 1. © People Strategists www.peoplestrategists.com Slide 1 of 42 Agile Development and Design Patterns - II
  • 2. © People Strategists www.peoplestrategists.com Slide 2 of 42 Objectives In this session, you will learn to: Identify the structural design pattern Identify the behavioral design patterns Identify the J2EE design patterns Identify the Web application architecture Explore the JEE architecture
  • 3. © People Strategists www.peoplestrategists.com Slide 3 of 42 Identify the Structural Design Patterns Structural design patterns: Serve as a blueprint for how different classes and objects are combined to form larger structures. Provide a manner to define relationships between classes or objects. Describes how data moves through the pattern. Some of the common structural design patterns are:  Adaptor  Bridge  Decorator  Facade
  • 4. © People Strategists www.peoplestrategists.com Slide 4 of 42 Adapter Design Pattern: Defines a manner for creating relationships between classes. Is a design pattern that is used to allow two incompatible types to communicate. Converts the interface of a class into another interface clients expect. Identify the Structural Design Patterns (Contd.)
  • 5. © People Strategists www.peoplestrategists.com Slide 5 of 42 The following figure depicts the implementation of the adapter design pattern. <<interface>> ITarget +MethodA(): void Adapter +MethodA(): void -adaptee: Adaptee Adaptee +MethodB(): void Client adaptee.MethodB Identify the Structural Design Patterns (Contd.)
  • 6. © People Strategists www.peoplestrategists.com Slide 6 of 42 The classes/objects participating in the preceding adapter pattern are: ITarget: Defines the domain-specific interface that Client uses. Adapter: Adapts the interface Adaptee to the Target interface. Adaptee: Defines an existing interface that needs adapting. Client: Collaborates with objects conforming to the Target interface. Implementation for the adapter design is given in the embedded code. Identify the Structural Design Patterns (Contd.)
  • 7. © People Strategists www.peoplestrategists.com Slide 7 of 42 Bridge Design Pattern: Defines a manner for creating relationships between classes or entities. Is used to separate the abstract elements of a class from the implementation details. Is used to share an implementation among multiple objects. Hides implementation details from clients. Identify the Structural Design Patterns (Contd.)
  • 8. © People Strategists www.peoplestrategists.com Slide 8 of 42 The following figure depicts the implementation of the bridge design pattern. Implementation for the bridge design is given in the embedded code. <<interface>> DrawAPI +drawCircle(): void RedCircle +drawCircle(): void GreenCircle Shape Uses+drawAPI(): DrawAPI +Shape(): void +Draw(): String BridgePatternDemo +main(): void Circle +drawCircle(): void -x, y, radius :int +Shape(): void +Draw(): String Uses implement extends Uses Uses Identify the Structural Design Patterns (Contd.)
  • 9. © People Strategists www.peoplestrategists.com Slide 9 of 42 Decorator Design Pattern: Defines a manner for creating relationships between classes or entities. Creates a decorator class which wraps the original class and provides additional functionality keeping class methods signature intact. Is used to extend or alter the functionality of objects at run-time by wrapping them in an object of a decorator class. Is used to extend the functionality of individual objects, not classes. This means that the modifications are made at run-time rather than at design time. Provides a flexible alternative to using inheritance to modify behavior. Identify the Structural Design Patterns (Contd.)
  • 10. © People Strategists www.peoplestrategists.com Slide 10 of 42 The following figure depicts the implementation of the decorator design pattern. Implementation for the decorator design pattern is given in the embedded code. DecoratorPatternDemo +main(): void Circle +draw(): void Rectangle Shape Uses+Draw(): void +draw(): void implement RedShapeDecorator +shape: Shape +RedShapeDecorator() +draw(): void -setRedBorder(): void ShapeDecorator +shape: Shape +ShapeDecorator() +draw(): void <<Interface>> Ask implement Identify the Structural Design Patterns (Contd.)
  • 11. © People Strategists www.peoplestrategists.com Slide 11 of 42 Facade Design Pattern: Defines a manner for creating relationships between classes or entities. Is used to define a simplified interface to a more complex subsystem. Is ideal when working with a large number of interdependent classes, or with classes that require the use of multiple methods. Is useful when wrapping subsystems that are poorly designed but cannot be refactored because the source code is unavailable or the existing interface is widely used. Involves a single class which provides simplified methods required by client and delegates calls to methods of existing system classes. Identify the Structural Design Patterns (Contd.)
  • 12. © People Strategists www.peoplestrategists.com Slide 12 of 42 The following figure depicts the implementation of the facade design pattern. Implementation for the facade design pattern is given in the embedded code. FacadePatternDemo +main(): void Circle +draw(): void Rectangle Shape <<interface>> +Draw(): void +draw(): void implement RedShapeDecorator +circle: Shape +rectangle: Shape +square: shape +ShapeMaker() +drawCircle(): void +drawRectangle(): void +drawSquare(): void Square +draw(): void implement Creates Identify the Structural Design Patterns (Contd.) Ask
  • 13. © People Strategists www.peoplestrategists.com Slide 13 of 42 Identify the Behavioral Design Patterns Behavioral Design Pattern: Explains how objects interact. It describes how different objects and classes send messages to each other to make things happen and how the steps of a task are divided among different objects. In this implementation and the client should be loosely coupled in order to avoid hard-coding and dependencies. This pattern characterizes object communication and simplifies the dynamic control flow of object behavior. If Creational pattern is about instantiation, and structural pattern is the blueprint, then behavioral is the pattern of the relationship among objects. Some of the common patterns come under it are:  Strategy  Command  Iterator
  • 14. © People Strategists www.peoplestrategists.com Slide 14 of 42 Identify the Behavioral Design Patterns (Contd.) Strategy Design Pattern: Defines a manner for controlling communication between classes or entities. The strategy pattern is used to create an interchangeable family of algorithms from which the required process is chosen at run-time. This allows the behavior of a program to change dynamically according to configuration details or user preferences. It also increases flexibility by allowing new algorithms to be easily incorporated in the future.
  • 15. © People Strategists www.peoplestrategists.com Slide 15 of 42 The following figure depicts the implementation of the strategy design pattern. Implementation for the strategy design pattern is given in the embedded code. StrategyPatternDemo +main(): void OperationAdd +doOperation(): int OperationSubstract Strategy <<interface>> +DoOpeation(): int implement Context +strategy: Strategy OperationMultiply implement Uses Identify the Behavioral Design Patterns (Contd.) +executeStrategy: int +doOperation(): int+doOperation(): int implement Ask
  • 16. © People Strategists www.peoplestrategists.com Slide 16 of 42 Identify the Behavioral Design Patterns (Contd.) Command Design Pattern: Defines a manner for controlling communication between classes or entities. Is used to express a request, including the call to be made and all of its required parameters, in a command object. Is useful when supporting activities that require the execution of a series of commands. The command objects can be held in a queue and processed sequentially. Use to decouple the object with its trigger. Easily to be extensible by not touching the old structure.
  • 17. © People Strategists www.peoplestrategists.com Slide 17 of 42 The following figure depicts the implementation of the command design pattern. Implementation for the command design pattern is given in the embedded code. Identify the Behavioral Design Patterns (Contd.) CommandPatternDemo +main(): void Order +execute(): void <<interface>> Broker -orders: List implement Uses +takeOrder(): void +placeOrders(): void BuyStock +BuyStock() +execute() SellStock +BuyStock() +execute() Uses Stock -name: String -quantity: int +buy(): void +sell(): void Uses -stock: Stock -stock: Stock
  • 18. © People Strategists www.peoplestrategists.com Slide 18 of 42 Iterator Pattern Design: Is used to provide a standard interface for traversing a collection of items in an aggregate object without understanding the underlying structure of that object. Is commonly used design pattern in Java and .Net programming environment. Iterator should be implemented as an interface. Identify the Behavioral Design Patterns (Contd.)
  • 19. © People Strategists www.peoplestrategists.com Slide 19 of 42 The following figure depicts the implementation of the iterator design pattern. Implementation for the iterator design pattern is given in the embedded code. Identify the Behavioral Design Patterns (Contd.) Iterator +hasNext(): boolean +next(): Object <<interface>> NameIteratorUsesNameRepository +getIterator(): iterator implement Container +getIterator(): iterator Uses -name: String [] +hasNext(): boolean +next(): Object main(): void IteratorPatternDemo Uses <<interface>> implement
  • 20. © People Strategists www.peoplestrategists.com Slide 20 of 42 Identifying the Web application Architecture Web applications: are programs that are executed on a server and accessed from a Web browser. enable organizations to share and access information on the Internet. are usually divided into the following logical chunks known as tiers:  Presentation:  It is the top-most tier in the Web application architecture.  It provides a UI that allows the users to interact and communicate with the applications.  Business logic:  It is the middle tier in the Web application architecture.  It contains the logic related to the business decisions of the organization.  Data access:  It is the last tier in the Web application architecture.  It contains the logic that enables you to access the data stored in various data sources, such as  Relational Database Management Systems (RDBMS), Extensible Markup Language (XML), and text files.
  • 21. © People Strategists www.peoplestrategists.com Slide 21 of 42 Identifying the Web application Architecture The following figure depicts the example of Web applications.
  • 22. © People Strategists www.peoplestrategists.com Slide 22 of 42 Identifying the Web application Architecture (Contd.) Based on the complexity of the Web application, it might follow any of the following Web application architecture: Single-tier Two-tier Three/n-tier
  • 23. © People Strategists www.peoplestrategists.com Slide 23 of 42 Identifying the Web application Architecture (Contd.) Single-Tier Architecture: Is also known as the monolithic architecture. In this architecture, the presentation logic, the business logic, and the data access logic are packaged on the same computer. These layers are tightly coupled that means if you make changes to any one of them, you also need to modify others. The following figure depicts the single-tier application architecture.
  • 24. © People Strategists www.peoplestrategists.com Slide 24 of 42 Identifying the Web application Architecture (Contd.) Two-tier Architecture: In this architecture, the presentation logic resides on the client. The business logic may reside either on the client or on the server. The data access logic resides on the server. Depending on the business requirements, it can be of the following types:  A fat client and thin server:  In this type, the presentation logic and the business logic reside on the client, and the data access logic resides on the server.  This application architecture helps in reducing the load on the server.  The following figure depicts a fat client and thin server application architecture.
  • 25. © People Strategists www.peoplestrategists.com Slide 25 of 42 Identifying the Web application Architecture (Contd.)  A fat server and thin client:  In this type, the client contains only the presentation logic.  The business logic and the data access logic reside on the server.  This type of architecture is easily managed, less prone to security risks, and offers low maintenance and licensing costs.  The following figure displays the layout of the layers in a fat server and thin client application architecture.
  • 26. © People Strategists www.peoplestrategists.com Slide 26 of 42 Identifying the Web application Architecture (Contd.) Three-tier/N-tier Architecture: In the three-tier architecture, the presentation logic, business logic, and data access logic are separated into different layers, as shown in the following figure.
  • 27. © People Strategists www.peoplestrategists.com Slide 27 of 42 Java Enterprise Edition: Is Oracle's enterprise Java computing platform. Is an open and standard based platform for developing, deploying, and managing n-tier, Web-enabled, server-centric, and component-based enterprise applications. Identifying Java Enterprise Edition (EE)
  • 28. © People Strategists www.peoplestrategists.com Slide 28 of 42 Identify the J2EE Design Patterns J2EE Design Patterns: Identify potential problems encountered when using the various J2EE- specified technologies and help developers construct an application architecture's requirements. Are specifically concerned with the presentation tier. Are identified by Sun Java Center. Some of the common J2EE patterns are :  Data Access Object (DAO) design pattern  Model-View-Design (MVC) design pattern
  • 29. © People Strategists www.peoplestrategists.com Slide 29 of 42 Identify the J2EE Design Patterns (Contd.) Data Access Object (DAO) Design Pattern: Is used to separate low level data accessing API or operations from high level business services. Adapt a uniform interface to access multiple databases like relational, un-relational, object-oriented, etc. Participants of the DAO pattern are.  Data Access Object Interface: This interface defines the standard operations to be performed on a model object(s).  Data Access Object concrete class: This class implements above interface. This class is responsible to get data from a data source which can be database / xml or any other storage mechanism.  Model Object or Value Object: This object is simple POJO containing get/set methods to store data retrieved using DAO class.
  • 30. © People Strategists www.peoplestrategists.com Slide 30 of 42 The following figure depicts the implementation of the DAO design pattern. Implementation for the DAO design pattern is given in the embedded code. Identify the J2EE Design Patterns (Contd.) StudentDao DAOPatternDemo Uses +getAllStudents(): List +updateStudent(): void +deleteStudent(): void +addStudent(): void StudentDaoImpl +studentDaoImpl() +getAllStudent(): List +updateStudent(): void +deleteStudent(): void +addStudent(): void -student: List +main(): void +Student() +getName(): String +setName(): void +getRollNo(): int +setRollNo(): String Student Implement <<interface>> -name: String -Rollno: int Uses
  • 31. © People Strategists www.peoplestrategists.com Slide 31 of 42 Identify the J2EE Design Patterns (Contd.) MVC Design Pattern: Is a design pattern for the architecture of Web applications. Is mainly is to achieve a clean separation between three components of most any Web application. Three components of MVC pattern are:  Model:  Is Java beans with their properties and methods.  It contain the business logics and functions that manipulate the business data.  View:  Is the Java Server Pages (JSP's) or HTML pages.  It only takes care of the presentation of the data and are known as presentation layer.  Controller:  It accepts and intercepts user requests and controls the business objects to fulfill these requests.  Is a JSP or servlet file.
  • 32. © People Strategists www.peoplestrategists.com Slide 32 of 42 The following figure depicts the implementation of the MVC design pattern. Implementation for the MVC design pattern is given in the embedded code. Identify the J2EE Design Patterns (Contd.) StudentController -model: Student -view: StudentView MVCPatternDemo Uses +StudentController() +setStudentName(): void +getStudentName(): String +setStudentRollNo(): void +getStudentRollNo(): String +updateView(): void Student +getName(): String +setName(): void +getRollNo(): String +setRollNo(): void -rollno: String -name: String +main(): void +retriveStudentFromDat abase(): Student +printStudentDetails(): void StudentView Updates Uses
  • 33. © People Strategists www.peoplestrategists.com Slide 33 of 42 Java EE comprises of the following application architecture: Web-centric architecture EJB component-centric architecture Business-to-business (B2B) application architecture Web service application architecture Exploring Java EE Application Architecture
  • 34. © People Strategists www.peoplestrategists.com Slide 34 of 42 The following figure depicts the Web-centric configuration of the Java EE application server (Java EE server) middle tier. In this architecture, the Web container of the Java EE technology server hosts all of the components that are required to generate the client view, process the business logic, and connect with the back-end data store. Java EE Web-Centric Architecture Java EE Web-Centric Architecture
  • 35. © People Strategists www.peoplestrategists.com Slide 35 of 42 The following figure depicts the EJB component-based configuration of the Java EE application server (Java EE server). This architecture uses both the Web container and EJB containers of the Java EE server. In this model, the business logic and data access components are located in the EJB container. Java EE EJB Component–Centric Architecture Java EE EJB Component-Centric Architecture
  • 36. © People Strategists www.peoplestrategists.com Slide 36 of 42 The following figure depicts the Java EE technology B2B application architecture. It is an extension of the Java EE technology EJB component–based architecture and involves two EJB servers, one in each business location. Each Java EE server hosts a web container and an EJB container. This architecture allows for peer-to-peer communications between the corresponding containers in the two Java EE servers. Java EE B2B Application Architecture Java EE B2B Application Architecture
  • 37. © People Strategists www.peoplestrategists.com Slide 37 of 42 The following figure depicts Java EE Web service application architecture. It starts with the Java™ 2 Platform, Enterprise Edition (J2EE™) 1.4 platform. Java EE component developer can expose the functionality of Java EE business components by using Web service technology. Java EE Web Service Application Architecture Java EE Web Service Architecture
  • 38. © People Strategists www.peoplestrategists.com Slide 38 of 42 Identifying MVC Architecture MVC is a software architectural pattern for implementing user interfaces. It’s main aim is to separate the business logic and application data from the presentation data to the user. The following figure displays the MVC architecture. MVC Architecture
  • 39. © People Strategists www.peoplestrategists.com Slide 39 of 42 Summary Structural design patterns serve as a blueprint for how different classes and objects are combined to form larger structures. Adapter design pattern defines a manner for creating relationships between classes. Bridge design is used to separate the abstract elements of a class from the implementation details. Decorator design pattern creates a decorator class which wraps the original class and provides additional functionality keeping class methods signature intact. Facade design pattern is used to define a simplified interface to a more complex subsystem. Behavioral design pattern Explains how objects interact. Strategy design pattern is used to create an interchangeable family of algorithms from which the required process is chosen at run-time.
  • 40. © People Strategists www.peoplestrategists.com Slide 40 of 42 Summary (Contd.) Command design pattern is used to express a request, including the call to be made and all of its required parameters, in a command object. Iterator pattern design is used to provide a standard interface for traversing a collection of items in an aggregate object without understanding the underlying structure of that object. Web applications are programs that are executed on a server and accessed from a Web browser. Presentation tier provides a UI that allows the users to interact and communicate with the applications. Business logic tier contains the logic related to the business decisions of the organization. Data access tier contains the logic that enables you to access the data stored in various data sources. In single-tier architecture, the presentation logic, the business logic, and the data access logic are packaged on the same computer.
  • 41. © People Strategists www.peoplestrategists.com Slide 41 of 42 Summary (Contd.) In two-tier architecture, the presentation logic resides on the client, the business logic may reside either on the client or on the server, and the data access logic resides on the server. J2EE design patterns identify potential problems encountered when using the various J2EE-specified technologies and help developers construct an application architecture's requirements. DAO) design pattern is used to separate low level data accessing API or operations from high level business services. MVC design pattern is a design pattern for the architecture of Web applications and mainly is to achieve a clean separation between three components of most any Web application. In Java EE Web-centric architecture, the Web container of the Java EE technology server hosts all of the components that are required to generate the client view, process the business logic, and connect with the back-end data store.
  • 42. © People Strategists www.peoplestrategists.com Slide 42 of 42 Summary (Contd.) Java EE EJB component-centric architecture uses both the Web container and EJB containers of the Java EE server. Java EE B2B application architecture is an extension of the Java EE technology EJB component–based architecture and involves two EJB servers, one in each business location. Java EE Web Service Application Architecture starts with the Java™ 2 Platform, Enterprise Edition (J2EE™) 1.4 platform.