SlideShare une entreprise Scribd logo
1  sur  43
Télécharger pour lire hors ligne
GOF
Naveen Kumar K S
Adith.Naveen@gmail.com
Introduction
¡ Design patterns represent the best practices used
by experienced object-oriented software
developers.
¡ Design patterns are solutions to general problems
that software developers faced during software
development
¡ All Design Patterns are got based on trial and
error by software engineers.
GOF?
¡ Discussed in 1994
¡ By Four people
¡ Erich Gamma
¡ Richard Helm
¡ Ralph Johnson
¡ John Vlissides
¡ To encourage people to go with reusable coding
Types of Design Patterns
¡ There are 23 design patterns which can be
classified in three categories: Creational,
Structural and Behavioral patterns.
¡ Another design pattern J2EE will be discussed in
other course
Creational Patterns
Abstract Factory Creates an instance of several families of classes
Builder Separates object construction from its representation
Factory Method Creates an instance of several derived classes
Prototype A fully initialized instance to be copied or cloned
Singleton A class of which only a single instance can exist
Structural Patterns
Adapter Match interfaces of different classes
Bridge Separates an object’s interface from its implementation
Composite A tree structure of simple and composite objects
Decorator Add responsibilities to objects dynamically
Facade A single class that represents an entire subsystem
Flyweight A fine-grained instance used for efficient sharing
Proxy An object representing another object
Behavioral Patterns
Chain of Resp. A way of passing a request between a chain of objects
Command Encapsulate a command request as an object
Interpreter A way to include language elements in a program
Iterator Sequentially access the elements of a collection
Mediator Defines simplified communication between classes
Memento Capture and restore an object's internal state
Observer A way of notifying change to a number of classes
State Alter an object's behavior when its state changes
Strategy Encapsulates an algorithm inside a class
Template Method Defer the exact steps of an algorithm to a subclass
Visitor Defines a new operation to a class without change
Singleton
¡ Singleton pattern is one of the simplest design
patterns in Java. This type of design pattern
comes under creational pattern as this pattern
provides one of the best ways to create an
object.
Factory Pattern
¡ Factory pattern is one of most used design
pattern in Java. This type of design pattern
comes under creational pattern as this pattern
provides one of the best ways to create an
object.
¡ In Factory pattern, we create object without
exposing the creation logic to the client and
refer to newly created object using a common
interface.
Abstract Factory Pattern
¡ Abstract Factory patterns work around a super-
factory which creates other factories. This factory
is also called as factory of factories. This type of
design pattern comes under creational pattern
as this pattern provides one of the best ways to
create an object.
Prototype Pattern
¡ Prototype pattern refers to creating duplicate
object while keeping performance in mind. This
type of design pattern comes under creational
pattern as this pattern provides one of the best
ways to create an object.
Bridge Pattern
¡ Bridge is used when we need to decouple an
abstraction from its implementation so that the
two can vary independently. This type of design
pattern comes under structural pattern as this
pattern decouples implementation class and
abstract class by providing a bridge structure
between them.
Need for Bridge Pattern
Bridge Pattern
Filter Pattern
¡ Filter pattern or Criteria pattern is a design
pattern that enables developers to filter a set of
objects using different criteria and chaining them
in a decoupled way through logical operations.
This type of design pattern comes under
structural pattern as this pattern combines
multiple criteria to obtain single criteria.
Decorator Pattern
¡ Decorator pattern allows a user to add new
functionality to an existing object without altering
its structure. This type of design pattern comes
under structural pattern as this pattern acts as a
wrapper to existing class.
Façade Pattern
¡ Facade pattern hides the complexities of the
system and provides an interface to the client
using which the client can access the system. This
type of design pattern comes under structural
pattern as this pattern adds an interface to
existing system to hide its complexities.
Observer Pattern
¡ Observer pattern is used when there is one-to-
many relationship between objects such as if one
object is modified, its dependent objects are to
be notified automatically. Observer pattern falls
under behavioral pattern category.
Delegate Pattern
¡ Business Delegate Pattern is used to decouple
presentation tier and business tier. It is basically
use to reduce communication or remote lookup
functionality to business tier code in presentation
tier code. In business tier we have following
entities.
Thank You
J2EE Design Pattern
J2EE Patterns
¡ Presentation Tier Patterns
¡ Business Tier Patterns
¡ Integration Tier Patterns
Intercepting Filter
¡ intercepts incoming requests and outgoing
responses and applies a filter.
¡ These filters may be added and removed in a
declarative manner
¡ For an incoming request, this is often a Front
Controller
Intercepting Filter
Front Controller
¡ Is a container to hold the common processing
logic that occurs within the presentation tier
¡ A controller handles requests and manages
content retrieval, security, view management,
and navigation, delegating to a Dispatcher
component to dispatch to a View.
¡ The Front Controller pattern creates central
control logic for presentation request handling.
Front controller
Dispatcher View
¡ Combines a controller and dispatcher with views
and helpers to handle client requests and
prepare a dynamic presentation as the response.
¡ A dispatcher is responsible for view management
and navigation and can be encapsulated either
within a controller, a view, or a separate
component.
¡ The Dispatcher View pattern handles the request
and generates a response while managing
limited business processing.
Dispatcher View
Business Tier
Patterns
Business Delegate
¡ Reduces coupling between remote tiers and
provides an entry point for accessing remote
services in the business tier.
¡ A Business Delegate might also cache data as
necessary to improve performance.
¡ A Business Delegate encapsulates a Session
Façade and maintains a one-to-one relationship
with that Session Façade.
¡ You want to hide clients from the complexity of
remote communication with business service
components.
Business Delegate
Session Façade
¡ Provides coarse-grained services to the clients by
hiding the complexities of the business service
interactions.
¡ This is the same as a Façade pattern as
described in GOF Design Patterns, but just
provides an interface to a service instead of
code.
Session Façade
Composite Entity
¡ Implements a Business Object using local entity
beans and POJOs.
¡ When implemented with bean-managed
persistence, a Composite Entity uses Data Access
Objects to facilitate persistence.
¡ to avoid the drawbacks of remote entity beans,
such as network overhead and remote inter-
entity bean relationships.
Composite Entity
Transfer Object
¡ You want clients to access components in other
tiers to retrieve and update data.
¡ You want to reduce remote requests across the
network.
¡ You want to avoid network performance
degradation caused by chattier applications
that have high network traffic.
¡ Reduces network traffic
¡ Simplifies remote object and remote interface
Transfer Object
Integration Tier
Patterns
Data Access Object
¡ Enables loose coupling between the business
and resource tiers.
¡ Data Access Object encapsulates all the data
access logic to create, retrieve, delete, and
update data from a persistent store.
¡ Data Access Object uses Transfer Object to send
and receive data.
Data Access Object
Web Service Broker
¡ Exposes and brokers one or more services in your
application to external clients as a web service
using XML and standard web protocols.
¡ A Web Service Broker can interact with
Application Service and Session Façade.
¡ A Web Service Broker uses one or more Service
Activators to perform asynchronous processing of
a request.
¡ The Web Service Broker pattern exposes and
brokers services using XML and web protocols.
Web Service Broker
Question??

Contenu connexe

Tendances

Tendances (20)

Uml - An Overview
Uml - An OverviewUml - An Overview
Uml - An Overview
 
Builder pattern
Builder patternBuilder pattern
Builder pattern
 
Design pattern-presentation
Design pattern-presentationDesign pattern-presentation
Design pattern-presentation
 
Design pattern
Design patternDesign pattern
Design pattern
 
Overview of UML Diagrams
Overview of UML DiagramsOverview of UML Diagrams
Overview of UML Diagrams
 
Design Patterns
Design PatternsDesign Patterns
Design Patterns
 
Design patterns tutorials
Design patterns tutorialsDesign patterns tutorials
Design patterns tutorials
 
Uml diagrams
Uml diagramsUml diagrams
Uml diagrams
 
Introduction to UML
Introduction to UMLIntroduction to UML
Introduction to UML
 
Advanced Structural Modeling
Advanced Structural ModelingAdvanced Structural Modeling
Advanced Structural Modeling
 
Adapter pattern
Adapter patternAdapter pattern
Adapter pattern
 
Design pattern & categories
Design pattern & categoriesDesign pattern & categories
Design pattern & categories
 
Introduction to SOFTWARE ARCHITECTURE
Introduction to SOFTWARE ARCHITECTUREIntroduction to SOFTWARE ARCHITECTURE
Introduction to SOFTWARE ARCHITECTURE
 
Introduction to design patterns
Introduction to design patternsIntroduction to design patterns
Introduction to design patterns
 
Design Patterns - 01 Introduction and Decorator Pattern
Design Patterns - 01 Introduction and Decorator PatternDesign Patterns - 01 Introduction and Decorator Pattern
Design Patterns - 01 Introduction and Decorator Pattern
 
UML
UMLUML
UML
 
Creational pattern
Creational patternCreational pattern
Creational pattern
 
Software Design Patterns
Software Design PatternsSoftware Design Patterns
Software Design Patterns
 
Uml
UmlUml
Uml
 
Software Architecture
Software ArchitectureSoftware Architecture
Software Architecture
 

Similaire à Gof design pattern

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
 
Bartlesville Dot Net User Group Design Patterns
Bartlesville Dot Net User Group Design PatternsBartlesville Dot Net User Group Design Patterns
Bartlesville Dot Net User Group Design PatternsJason Townsend, MBA
 
Design Patterns For 70% Of Programmers In The World
Design Patterns For 70% Of Programmers In The WorldDesign Patterns For 70% Of Programmers In The World
Design Patterns For 70% Of Programmers In The WorldSaurabh Moody
 
C# Design Patterns | Design Pattern Tutorial For Beginners | C# Programming T...
C# Design Patterns | Design Pattern Tutorial For Beginners | C# Programming T...C# Design Patterns | Design Pattern Tutorial For Beginners | C# Programming T...
C# Design Patterns | Design Pattern Tutorial For Beginners | C# Programming T...Simplilearn
 
Software design and Architecture.pptx
Software design and Architecture.pptxSoftware design and Architecture.pptx
Software design and Architecture.pptxSHAHZAIBABBAS13
 
Design Pattern in Software Engineering
Design Pattern in Software Engineering Design Pattern in Software Engineering
Design Pattern in Software Engineering Bilal Hassan
 
Patterns (contd)Software Development ProcessDesign patte.docx
Patterns (contd)Software Development ProcessDesign patte.docxPatterns (contd)Software Development ProcessDesign patte.docx
Patterns (contd)Software Development ProcessDesign patte.docxdanhaley45372
 
P Training Presentation
P Training PresentationP Training Presentation
P Training PresentationGaurav Tyagi
 
Design patterns fast track
Design patterns fast trackDesign patterns fast track
Design patterns fast trackBinu Bhasuran
 
Design Pattern For C# Part 1
Design Pattern For C# Part 1Design Pattern For C# Part 1
Design Pattern For C# Part 1Shahzad
 
UNIT IV DESIGN PATTERNS.pptx
UNIT IV DESIGN PATTERNS.pptxUNIT IV DESIGN PATTERNS.pptx
UNIT IV DESIGN PATTERNS.pptxanguraju1
 
Gang of Four in Java
Gang of Four in Java Gang of Four in Java
Gang of Four in Java Mina Tafreshi
 
Introduction To Design Patterns
Introduction To Design PatternsIntroduction To Design Patterns
Introduction To Design Patternssukumarraju6
 
Design Pattern with Actionscript
Design Pattern with ActionscriptDesign Pattern with Actionscript
Design Pattern with ActionscriptDaniel Swid
 

Similaire à Gof design pattern (20)

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...
 
Bartlesville Dot Net User Group Design Patterns
Bartlesville Dot Net User Group Design PatternsBartlesville Dot Net User Group Design Patterns
Bartlesville Dot Net User Group Design Patterns
 
Design Patterns For 70% Of Programmers In The World
Design Patterns For 70% Of Programmers In The WorldDesign Patterns For 70% Of Programmers In The World
Design Patterns For 70% Of Programmers In The World
 
C# Design Patterns | Design Pattern Tutorial For Beginners | C# Programming T...
C# Design Patterns | Design Pattern Tutorial For Beginners | C# Programming T...C# Design Patterns | Design Pattern Tutorial For Beginners | C# Programming T...
C# Design Patterns | Design Pattern Tutorial For Beginners | C# Programming T...
 
Design pattern
Design patternDesign pattern
Design pattern
 
Software design and Architecture.pptx
Software design and Architecture.pptxSoftware design and Architecture.pptx
Software design and Architecture.pptx
 
Design Pattern in Software Engineering
Design Pattern in Software Engineering Design Pattern in Software Engineering
Design Pattern in Software Engineering
 
Design patterns
Design patternsDesign patterns
Design patterns
 
Design patterns
Design patternsDesign patterns
Design patterns
 
Patterns (contd)Software Development ProcessDesign patte.docx
Patterns (contd)Software Development ProcessDesign patte.docxPatterns (contd)Software Development ProcessDesign patte.docx
Patterns (contd)Software Development ProcessDesign patte.docx
 
J2EE pattern 5
J2EE pattern 5J2EE pattern 5
J2EE pattern 5
 
P Training Presentation
P Training PresentationP Training Presentation
P Training Presentation
 
Design patterns fast track
Design patterns fast trackDesign patterns fast track
Design patterns fast track
 
Design Pattern For C# Part 1
Design Pattern For C# Part 1Design Pattern For C# Part 1
Design Pattern For C# Part 1
 
UNIT IV DESIGN PATTERNS.pptx
UNIT IV DESIGN PATTERNS.pptxUNIT IV DESIGN PATTERNS.pptx
UNIT IV DESIGN PATTERNS.pptx
 
Gang of Four in Java
Gang of Four in Java Gang of Four in Java
Gang of Four in Java
 
Introduction To Design Patterns
Introduction To Design PatternsIntroduction To Design Patterns
Introduction To Design Patterns
 
Design patterns
Design patternsDesign patterns
Design patterns
 
Design Pattern with Actionscript
Design Pattern with ActionscriptDesign Pattern with Actionscript
Design Pattern with Actionscript
 
Software Design Patterns
Software Design PatternsSoftware Design Patterns
Software Design Patterns
 

Dernier

Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024Elizabeth Walsh
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxJisc
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxDr. Ravikiran H M Gowda
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jisc
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...Nguyen Thanh Tu Collection
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxAmanpreet Kaur
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxCeline George
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 

Dernier (20)

Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 

Gof design pattern

  • 1. GOF Naveen Kumar K S Adith.Naveen@gmail.com
  • 2. Introduction ¡ Design patterns represent the best practices used by experienced object-oriented software developers. ¡ Design patterns are solutions to general problems that software developers faced during software development ¡ All Design Patterns are got based on trial and error by software engineers.
  • 3. GOF? ¡ Discussed in 1994 ¡ By Four people ¡ Erich Gamma ¡ Richard Helm ¡ Ralph Johnson ¡ John Vlissides ¡ To encourage people to go with reusable coding
  • 4. Types of Design Patterns ¡ There are 23 design patterns which can be classified in three categories: Creational, Structural and Behavioral patterns. ¡ Another design pattern J2EE will be discussed in other course
  • 5. Creational Patterns Abstract Factory Creates an instance of several families of classes Builder Separates object construction from its representation Factory Method Creates an instance of several derived classes Prototype A fully initialized instance to be copied or cloned Singleton A class of which only a single instance can exist
  • 6. Structural Patterns Adapter Match interfaces of different classes Bridge Separates an object’s interface from its implementation Composite A tree structure of simple and composite objects Decorator Add responsibilities to objects dynamically Facade A single class that represents an entire subsystem Flyweight A fine-grained instance used for efficient sharing Proxy An object representing another object
  • 7. Behavioral Patterns Chain of Resp. A way of passing a request between a chain of objects Command Encapsulate a command request as an object Interpreter A way to include language elements in a program Iterator Sequentially access the elements of a collection Mediator Defines simplified communication between classes Memento Capture and restore an object's internal state Observer A way of notifying change to a number of classes State Alter an object's behavior when its state changes Strategy Encapsulates an algorithm inside a class Template Method Defer the exact steps of an algorithm to a subclass Visitor Defines a new operation to a class without change
  • 8. Singleton ¡ Singleton pattern is one of the simplest design patterns in Java. This type of design pattern comes under creational pattern as this pattern provides one of the best ways to create an object.
  • 9. Factory Pattern ¡ Factory pattern is one of most used design pattern in Java. This type of design pattern comes under creational pattern as this pattern provides one of the best ways to create an object. ¡ In Factory pattern, we create object without exposing the creation logic to the client and refer to newly created object using a common interface.
  • 10. Abstract Factory Pattern ¡ Abstract Factory patterns work around a super- factory which creates other factories. This factory is also called as factory of factories. This type of design pattern comes under creational pattern as this pattern provides one of the best ways to create an object.
  • 11. Prototype Pattern ¡ Prototype pattern refers to creating duplicate object while keeping performance in mind. This type of design pattern comes under creational pattern as this pattern provides one of the best ways to create an object.
  • 12. Bridge Pattern ¡ Bridge is used when we need to decouple an abstraction from its implementation so that the two can vary independently. This type of design pattern comes under structural pattern as this pattern decouples implementation class and abstract class by providing a bridge structure between them.
  • 13. Need for Bridge Pattern
  • 15. Filter Pattern ¡ Filter pattern or Criteria pattern is a design pattern that enables developers to filter a set of objects using different criteria and chaining them in a decoupled way through logical operations. This type of design pattern comes under structural pattern as this pattern combines multiple criteria to obtain single criteria.
  • 16. Decorator Pattern ¡ Decorator pattern allows a user to add new functionality to an existing object without altering its structure. This type of design pattern comes under structural pattern as this pattern acts as a wrapper to existing class.
  • 17. Façade Pattern ¡ Facade pattern hides the complexities of the system and provides an interface to the client using which the client can access the system. This type of design pattern comes under structural pattern as this pattern adds an interface to existing system to hide its complexities.
  • 18. Observer Pattern ¡ Observer pattern is used when there is one-to- many relationship between objects such as if one object is modified, its dependent objects are to be notified automatically. Observer pattern falls under behavioral pattern category.
  • 19. Delegate Pattern ¡ Business Delegate Pattern is used to decouple presentation tier and business tier. It is basically use to reduce communication or remote lookup functionality to business tier code in presentation tier code. In business tier we have following entities.
  • 22. J2EE Patterns ¡ Presentation Tier Patterns ¡ Business Tier Patterns ¡ Integration Tier Patterns
  • 23. Intercepting Filter ¡ intercepts incoming requests and outgoing responses and applies a filter. ¡ These filters may be added and removed in a declarative manner ¡ For an incoming request, this is often a Front Controller
  • 25. Front Controller ¡ Is a container to hold the common processing logic that occurs within the presentation tier ¡ A controller handles requests and manages content retrieval, security, view management, and navigation, delegating to a Dispatcher component to dispatch to a View. ¡ The Front Controller pattern creates central control logic for presentation request handling.
  • 27. Dispatcher View ¡ Combines a controller and dispatcher with views and helpers to handle client requests and prepare a dynamic presentation as the response. ¡ A dispatcher is responsible for view management and navigation and can be encapsulated either within a controller, a view, or a separate component. ¡ The Dispatcher View pattern handles the request and generates a response while managing limited business processing.
  • 30. Business Delegate ¡ Reduces coupling between remote tiers and provides an entry point for accessing remote services in the business tier. ¡ A Business Delegate might also cache data as necessary to improve performance. ¡ A Business Delegate encapsulates a Session Façade and maintains a one-to-one relationship with that Session Façade. ¡ You want to hide clients from the complexity of remote communication with business service components.
  • 32. Session Façade ¡ Provides coarse-grained services to the clients by hiding the complexities of the business service interactions. ¡ This is the same as a Façade pattern as described in GOF Design Patterns, but just provides an interface to a service instead of code.
  • 34. Composite Entity ¡ Implements a Business Object using local entity beans and POJOs. ¡ When implemented with bean-managed persistence, a Composite Entity uses Data Access Objects to facilitate persistence. ¡ to avoid the drawbacks of remote entity beans, such as network overhead and remote inter- entity bean relationships.
  • 36. Transfer Object ¡ You want clients to access components in other tiers to retrieve and update data. ¡ You want to reduce remote requests across the network. ¡ You want to avoid network performance degradation caused by chattier applications that have high network traffic. ¡ Reduces network traffic ¡ Simplifies remote object and remote interface
  • 39. Data Access Object ¡ Enables loose coupling between the business and resource tiers. ¡ Data Access Object encapsulates all the data access logic to create, retrieve, delete, and update data from a persistent store. ¡ Data Access Object uses Transfer Object to send and receive data.
  • 41. Web Service Broker ¡ Exposes and brokers one or more services in your application to external clients as a web service using XML and standard web protocols. ¡ A Web Service Broker can interact with Application Service and Session Façade. ¡ A Web Service Broker uses one or more Service Activators to perform asynchronous processing of a request. ¡ The Web Service Broker pattern exposes and brokers services using XML and web protocols.