SlideShare a Scribd company logo
Copyright © 2017, edureka and/or its affiliates. All rights reserved.
www.edureka.co
TYPES OF DESIGN PATTERNS
STRUCTURE OF DESIGN PATTERNS
WHAT ARE DESIGN PATTERNS?
WHY DO WE NEED DESIGN PATTERNS IN JAVA?
OVERVIEW OF DESIGN PATTERNS
WHY DO WE NEED DESIGN PATTERNS?
www.edureka.co
WHY DO WE NEED DESIGN PATTERNS?
www.edureka.co
OOP solutions
Easy to Maintain
Efficient
WHAT ARE DESIGN PATTERNS?
www.edureka.co
WHAT ARE DESIGN PATTERNS?
Software Design Pattern can be defined as a software
template or a description to solve a problem that
occurs in multiple instances while designing a Software
Application or a Software Framework.
DESIGNPATTERN
www.edureka.co
STRUCTURE OF DESIGN PATTERNS
www.edureka.co
STRUCTURE OF DESIGN PATTERNS
Structure of Design Patterns can be described as a graphical representation of the classes
involved in the pattern following the notations of Object Modeling Technique (OMT).
Term Description
Pattern Name Describes the essence of the pattern in a short, but expressive name.
Intent Describes what the Pattern Does
Also, known as List any synonyms of the pattern
Motivation Provides an example of the problem and describes the solution to it
Applicability Lists the situations where the pattern is applicable
Structure Set of diagrams of the classes and objects that depict the pattern
Participants Describes the classes and objects that participate in the design
Collaborations Describes the Participants collaboration and their responsibilities.
Consequences Describes the forces that exist with the pattern and the benefits
www.edureka.co
TYPES OF DESIGN PATTERNS
www.edureka.co
TYPES OF DESIGN PATTERNS
Creational Design Patterns
Structural Design Patterns
Behavioral Design Patterns
JEE Design Patterns
www.edureka.co
Creational Design Patterns
Creational Design Patterns are concerned with the method of
creating Objects.
The Creational Design Patterns are classified as follows:
• Factory Design Pattern
• Abstract Factory Pattern
• Singleton Pattern
• Prototype Pattern
• Builder Pattern.
• Object Pool Pattern
www.edureka.co
CREATIONAL DESIGN PATTERNS
Factory Design Pattern
Factory Design Pattern: It follows the principle of “Define an interface or
abstract class for creating an object but let the subclasses decide which
class to instantiate“. The Factory Method Pattern is also known as Virtual
Constructor.
www.edureka.co
CREATIONAL DESIGN PATTERNS
Factory Design Pattern Example
Example: We have three Cellular Network
Plan which describes the call cost per minute.
Here we have three different networks
namely, abcNetwork, pqrNetwork, and
xyzNetwork along with their charges per
minute. Let us find out the cost of a certain
number of minutes on each network.
www.edureka.co
Java Design Patterns Tutorial | Edureka
CREATIONAL DESIGN PATTERNS
Singleton Design Pattern
Singleton Design Pattern: It follows “define a class that has only one
instance and provides a global point of access to it“. The class must ensure
that only a single instance should be created, and a single object can be
used by all other classes.
www.edureka.co
CREATIONAL DESIGN PATTERNS
Singleton Design Pattern Example
www.edureka.co
Example: We have a MySQL Database. Let us
insert data into the database using one single
object instance. Here, we have 4 different
operations that are performed onto the
database and all of those operations use
one single object instance.
Java Design Patterns Tutorial | Edureka
Structural Design Patterns
Structural Design Patterns deal with the composition of classes
and objects which form larger structures.
The Structural Design Patterns are further classified as follows:
• Facade Pattern
• Bridge Pattern
• Composite Pattern
• Decorator Pattern
• Adapter Pattern
• Flyweight Pattern
• Proxy Pattern
• Filter Pattern
www.edureka.co
STRUCTURAL DESIGN PATTERNS
Facade Design Pattern
Facade Design Pattern: Describes a higher-level interface that makes the
subsystem easier to use. Every Abstract Factory is a Facade Design Pattern.
It protects the end-users from the complex sub-system components.
www.edureka.co
STRUCTURAL DESIGN PATTERNS
Facade Design Pattern Example
www.edureka.co
Example: Now, let us use the Facade Design
pattern to find out the cost of the franchise you
wish to buy.
Java Design Patterns Tutorial | Edureka
STRUCTURAL DESIGN PATTERNS
Adapter Design Pattern
Adapter Design Pattern: Provides the interface according to client
requirement while using the services of a class with a different
interface. The Adapter Pattern is also known as Wrapper. It is designed to
enable two or more previously incompatible objects to interact with each
other.
www.edureka.co
STRUCTURAL DESIGN PATTERNS
Adapter Design Pattern Example
www.edureka.co
Example: Here is a simple Library Card example
which is designed to issue a Library card to a
new user of the library which includes all the
details like a book holder ID, Account number
and many more. Let us execute this
using Adapter Design Pattern.
Java Design Patterns Tutorial | Edureka
Behavioural Design Patterns
Behavior Design Patterns are concerned with the responsibility
and interaction between the objects.
The Behavioural Design Patterns are further classified as follows:
• Strategy Pattern
• Iterator Pattern
• Mediator Pattern
• Command Pattern
• State Pattern
• Observer Pattern
• Template Pattern
• Visitor Pattern
www.edureka.co
BEHAVIOURAL DESIGN PATTERNS
Strategy Design Pattern
Strategy Design Pattern: It defines a family of functionality and encapsulates
each one and make them interchangeable. The Strategy Pattern is also known
as Policy.
www.edureka.co
BEHAVIOURAL DESIGN PATTERNS
Strategy Design Pattern Example
www.edureka.co
Example: we are going to consider a simple
example of a calculator. We need to perform five
different operations. We shall encapsulate all
those five operations into Calculator class and
execute the program using the Strategy Design
Pattern.
Java Design Patterns Tutorial | Edureka
BEHAVIOURAL DESIGN PATTERNS
Command Design Pattern
Command Design Pattern: It encapsulates a request under an object as a
command and passes it to the invoker object. Invoker object looks for the
appropriate object which can handle this command and pass the command
to the corresponding object and that object executes the command. It is
also known as Action or Transaction.
www.edureka.co
BEHAVIOURAL DESIGN PATTERNS
Command Design Pattern Example
www.edureka.co
Example: This example demonstrates a simple
command execution cycle where the user
requires to exhibit switching on and off the
various electronic devices in his houses like
a bulb and stereo player. He invokes the
command through an invoker object called
a simple remote control.
Java Design Patterns Tutorial | Edureka
BEHAVIOURAL DESIGN PATTERNS
Observer Design Pattern
Observer Design Pattern: It defines a one-to-one dependency so that
when one object changes state, all its dependents are notified and updated
automatically.
www.edureka.co
BEHAVIOURAL DESIGN PATTERNS
Observer Design Pattern Example
www.edureka.co
Example: We are going to execute a program
using the Observer Design Pattern to display
the current average score and the current
predictable score of a cricket match.
Java Design Patterns Tutorial | Edureka
JEE Design Patterns
JEE Design Patterns are concerned with providing solutions to the
Java EE-based software applications and frameworks.
The JEE Design Patterns are further classified as follows:
• MVC Design Pattern
• Dependency Injection Pattern
• DAO Design Pattern
• Business Delegate Pattern
• Intercepting Filter Pattern
• Service Locator Pattern
• Transfer Object Pattern
www.edureka.co
JEE DESIGN PATTERNS
MVC Design Pattern
MVC Design Pattern: MVC Design Pattern is defined as follows:
• Models are basically objects used as blueprints for all of the objects that
will be used in the application.
• Views are used to represent the presentational aspect of the
information and data located in the models.
• Controllers control and act as both of the Models as well as Views. They
serve as a connection between the Models and Views.
www.edureka.co
JEE DESIGN PATTERNS
MVC Design Pattern Example
www.edureka.co
Example: We are going to use MVC Design
Pattern to set and print the data of the school
students.
Java Design Patterns Tutorial | Edureka
JEE DESIGN PATTERNS
DAO Design Pattern
DAO Design Pattern: DAO is a pattern in which objects are dedicated to the
communication with the Data Layer. These objects instantiate “Session
Factories” and handle all of the logic behind communicating with the
database.
www.edureka.co
JEE DESIGN PATTERNS
DAO Design Pattern Example
www.edureka.co
Example: We are going display the Developer
details of a certain IT company using the DAO
Design Pattern.
Java Design Patterns Tutorial | Edureka
OVERVIEW OF DESIGN PATTERNS
www.edureka.co
OVERVIEW OF DESIGN PATTERNS
• They are designed to be reusable in multiple projects.
• Their solutions help to define system architecture with ease.
• Design Patterns can capture the software engineering experiences.
• They provide transparency to the design of an application.
• Design Patterns are well-proven solutions given by Experts.
• Java Design Patterns provide clarity to the System Architecture
• They provide the possibility of building a better system.
www.edureka.co
Copyright © 2017, edureka and/or its affiliates. All rights reserved.
www.edureka.co

More Related Content

What's hot (20)

PDF
Java Course 11: Design Patterns
Anton Keks
 
PDF
Introduction to Design Pattern
Sanae BEKKAR
 
PDF
ORM: Object-relational mapping
Abhilash M A
 
PPTX
Java - Generic programming
Riccardo Cardin
 
PPTX
Java Server Pages(jsp)
Manisha Keim
 
PPTX
Multithreading in java
Raghu nath
 
PDF
Design patterns
abhisheksagi
 
PPT
android layouts
Deepa Rani
 
PPT
Spring ppt
Mumbai Academisc
 
ODP
OOP java
xball977
 
PPTX
Introduction to Spring Framework
Serhat Can
 
PDF
SOLID Design Principles applied in Java
Ionut Bilica
 
PPTX
Java Spring Framework
Mehul Jariwala
 
PPTX
SOLID Principles
Surendra Shukla
 
PPTX
Intro to React
Eric Westfall
 
PPTX
Constructor in java
SIVASHANKARIRAJAN
 
PDF
Spring boot jpa
Hamid Ghorbani
 
PDF
Java Basic Oops Concept
atozknowledge .com
 
PDF
Asp.net state management
priya Nithya
 
PPTX
React workshop
Imran Sayed
 
Java Course 11: Design Patterns
Anton Keks
 
Introduction to Design Pattern
Sanae BEKKAR
 
ORM: Object-relational mapping
Abhilash M A
 
Java - Generic programming
Riccardo Cardin
 
Java Server Pages(jsp)
Manisha Keim
 
Multithreading in java
Raghu nath
 
Design patterns
abhisheksagi
 
android layouts
Deepa Rani
 
Spring ppt
Mumbai Academisc
 
OOP java
xball977
 
Introduction to Spring Framework
Serhat Can
 
SOLID Design Principles applied in Java
Ionut Bilica
 
Java Spring Framework
Mehul Jariwala
 
SOLID Principles
Surendra Shukla
 
Intro to React
Eric Westfall
 
Constructor in java
SIVASHANKARIRAJAN
 
Spring boot jpa
Hamid Ghorbani
 
Java Basic Oops Concept
atozknowledge .com
 
Asp.net state management
priya Nithya
 
React workshop
Imran Sayed
 

Similar to Java Design Patterns Tutorial | Edureka (20)

PPTX
Design patterns
Kolade Ibrahim Arowolo
 
PPTX
Design Pattern - Introduction
Mudasir Qazi
 
PPT
Design patterns
Mobicules Technologies
 
PDF
Webinar: Design Patterns : Tailor-made solutions for Software Development
Edureka!
 
PDF
Design Patterns Java programming language.pdf
totallyrealmail420
 
PPTX
Let us understand design pattern
Mindfire Solutions
 
PPT
5 Design Patterns Explained
Prabhjit Singh
 
PPS
Design Patterns For 70% Of Programmers In The World
Saurabh Moody
 
PDF
Design Patterns - The Ultimate Blueprint for Software
Edureka!
 
PDF
Java Design Patterns Interview Questions PDF By ScholarHat
Scholarhat
 
PPT
Introduction to design patterns
Amit Kabra
 
PPTX
Design patterns Structural
UMAR ALI
 
PPTX
Design patterns
Akhilesh Gupta
 
PPTX
C# Design Patterns | Design Pattern Tutorial For Beginners | C# Programming T...
Simplilearn
 
PPTX
Sofwear deasign and need of design pattern
chetankane
 
PPTX
Design Patterns - General Introduction
Asma CHERIF
 
PPTX
ap assignmnet presentation.pptx
AwanAdhikari
 
PPTX
sample Pattern Design explaine .pptx
mbabaqi2020
 
PPTX
Design pattern of software words computer .pptx
muslimpari2503
 
PDF
software engineering Design Patterns.pdf
mulugetaberihun3
 
Design patterns
Kolade Ibrahim Arowolo
 
Design Pattern - Introduction
Mudasir Qazi
 
Design patterns
Mobicules Technologies
 
Webinar: Design Patterns : Tailor-made solutions for Software Development
Edureka!
 
Design Patterns Java programming language.pdf
totallyrealmail420
 
Let us understand design pattern
Mindfire Solutions
 
5 Design Patterns Explained
Prabhjit Singh
 
Design Patterns For 70% Of Programmers In The World
Saurabh Moody
 
Design Patterns - The Ultimate Blueprint for Software
Edureka!
 
Java Design Patterns Interview Questions PDF By ScholarHat
Scholarhat
 
Introduction to design patterns
Amit Kabra
 
Design patterns Structural
UMAR ALI
 
Design patterns
Akhilesh Gupta
 
C# Design Patterns | Design Pattern Tutorial For Beginners | C# Programming T...
Simplilearn
 
Sofwear deasign and need of design pattern
chetankane
 
Design Patterns - General Introduction
Asma CHERIF
 
ap assignmnet presentation.pptx
AwanAdhikari
 
sample Pattern Design explaine .pptx
mbabaqi2020
 
Design pattern of software words computer .pptx
muslimpari2503
 
software engineering Design Patterns.pdf
mulugetaberihun3
 
Ad

More from Edureka! (20)

PDF
What to learn during the 21 days Lockdown | Edureka
Edureka!
 
PDF
Top 10 Dying Programming Languages in 2020 | Edureka
Edureka!
 
PDF
Top 5 Trending Business Intelligence Tools | Edureka
Edureka!
 
PDF
Tableau Tutorial for Data Science | Edureka
Edureka!
 
PDF
Python Programming Tutorial | Edureka
Edureka!
 
PDF
Top 5 PMP Certifications | Edureka
Edureka!
 
PDF
Top Maven Interview Questions in 2020 | Edureka
Edureka!
 
PDF
Linux Mint Tutorial | Edureka
Edureka!
 
PDF
How to Deploy Java Web App in AWS| Edureka
Edureka!
 
PDF
Importance of Digital Marketing | Edureka
Edureka!
 
PDF
RPA in 2020 | Edureka
Edureka!
 
PDF
Email Notifications in Jenkins | Edureka
Edureka!
 
PDF
EA Algorithm in Machine Learning | Edureka
Edureka!
 
PDF
Cognitive AI Tutorial | Edureka
Edureka!
 
PDF
AWS Cloud Practitioner Tutorial | Edureka
Edureka!
 
PDF
Blue Prism Top Interview Questions | Edureka
Edureka!
 
PDF
Big Data on AWS Tutorial | Edureka
Edureka!
 
PDF
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
Edureka!
 
PDF
Kubernetes Installation on Ubuntu | Edureka
Edureka!
 
PDF
Introduction to DevOps | Edureka
Edureka!
 
What to learn during the 21 days Lockdown | Edureka
Edureka!
 
Top 10 Dying Programming Languages in 2020 | Edureka
Edureka!
 
Top 5 Trending Business Intelligence Tools | Edureka
Edureka!
 
Tableau Tutorial for Data Science | Edureka
Edureka!
 
Python Programming Tutorial | Edureka
Edureka!
 
Top 5 PMP Certifications | Edureka
Edureka!
 
Top Maven Interview Questions in 2020 | Edureka
Edureka!
 
Linux Mint Tutorial | Edureka
Edureka!
 
How to Deploy Java Web App in AWS| Edureka
Edureka!
 
Importance of Digital Marketing | Edureka
Edureka!
 
RPA in 2020 | Edureka
Edureka!
 
Email Notifications in Jenkins | Edureka
Edureka!
 
EA Algorithm in Machine Learning | Edureka
Edureka!
 
Cognitive AI Tutorial | Edureka
Edureka!
 
AWS Cloud Practitioner Tutorial | Edureka
Edureka!
 
Blue Prism Top Interview Questions | Edureka
Edureka!
 
Big Data on AWS Tutorial | Edureka
Edureka!
 
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
Edureka!
 
Kubernetes Installation on Ubuntu | Edureka
Edureka!
 
Introduction to DevOps | Edureka
Edureka!
 
Ad

Recently uploaded (20)

PDF
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
PDF
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
PPTX
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
PDF
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PDF
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PPTX
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
PDF
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
PDF
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
PDF
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PDF
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
PDF
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
PPTX
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 

Java Design Patterns Tutorial | Edureka

  • 1. Copyright © 2017, edureka and/or its affiliates. All rights reserved.
  • 2. www.edureka.co TYPES OF DESIGN PATTERNS STRUCTURE OF DESIGN PATTERNS WHAT ARE DESIGN PATTERNS? WHY DO WE NEED DESIGN PATTERNS IN JAVA? OVERVIEW OF DESIGN PATTERNS
  • 3. WHY DO WE NEED DESIGN PATTERNS? www.edureka.co
  • 4. WHY DO WE NEED DESIGN PATTERNS? www.edureka.co OOP solutions Easy to Maintain Efficient
  • 5. WHAT ARE DESIGN PATTERNS? www.edureka.co
  • 6. WHAT ARE DESIGN PATTERNS? Software Design Pattern can be defined as a software template or a description to solve a problem that occurs in multiple instances while designing a Software Application or a Software Framework. DESIGNPATTERN www.edureka.co
  • 7. STRUCTURE OF DESIGN PATTERNS www.edureka.co
  • 8. STRUCTURE OF DESIGN PATTERNS Structure of Design Patterns can be described as a graphical representation of the classes involved in the pattern following the notations of Object Modeling Technique (OMT). Term Description Pattern Name Describes the essence of the pattern in a short, but expressive name. Intent Describes what the Pattern Does Also, known as List any synonyms of the pattern Motivation Provides an example of the problem and describes the solution to it Applicability Lists the situations where the pattern is applicable Structure Set of diagrams of the classes and objects that depict the pattern Participants Describes the classes and objects that participate in the design Collaborations Describes the Participants collaboration and their responsibilities. Consequences Describes the forces that exist with the pattern and the benefits www.edureka.co
  • 9. TYPES OF DESIGN PATTERNS www.edureka.co
  • 10. TYPES OF DESIGN PATTERNS Creational Design Patterns Structural Design Patterns Behavioral Design Patterns JEE Design Patterns www.edureka.co
  • 11. Creational Design Patterns Creational Design Patterns are concerned with the method of creating Objects. The Creational Design Patterns are classified as follows: • Factory Design Pattern • Abstract Factory Pattern • Singleton Pattern • Prototype Pattern • Builder Pattern. • Object Pool Pattern www.edureka.co
  • 12. CREATIONAL DESIGN PATTERNS Factory Design Pattern Factory Design Pattern: It follows the principle of “Define an interface or abstract class for creating an object but let the subclasses decide which class to instantiate“. The Factory Method Pattern is also known as Virtual Constructor. www.edureka.co
  • 13. CREATIONAL DESIGN PATTERNS Factory Design Pattern Example Example: We have three Cellular Network Plan which describes the call cost per minute. Here we have three different networks namely, abcNetwork, pqrNetwork, and xyzNetwork along with their charges per minute. Let us find out the cost of a certain number of minutes on each network. www.edureka.co
  • 15. CREATIONAL DESIGN PATTERNS Singleton Design Pattern Singleton Design Pattern: It follows “define a class that has only one instance and provides a global point of access to it“. The class must ensure that only a single instance should be created, and a single object can be used by all other classes. www.edureka.co
  • 16. CREATIONAL DESIGN PATTERNS Singleton Design Pattern Example www.edureka.co Example: We have a MySQL Database. Let us insert data into the database using one single object instance. Here, we have 4 different operations that are performed onto the database and all of those operations use one single object instance.
  • 18. Structural Design Patterns Structural Design Patterns deal with the composition of classes and objects which form larger structures. The Structural Design Patterns are further classified as follows: • Facade Pattern • Bridge Pattern • Composite Pattern • Decorator Pattern • Adapter Pattern • Flyweight Pattern • Proxy Pattern • Filter Pattern www.edureka.co
  • 19. STRUCTURAL DESIGN PATTERNS Facade Design Pattern Facade Design Pattern: Describes a higher-level interface that makes the subsystem easier to use. Every Abstract Factory is a Facade Design Pattern. It protects the end-users from the complex sub-system components. www.edureka.co
  • 20. STRUCTURAL DESIGN PATTERNS Facade Design Pattern Example www.edureka.co Example: Now, let us use the Facade Design pattern to find out the cost of the franchise you wish to buy.
  • 22. STRUCTURAL DESIGN PATTERNS Adapter Design Pattern Adapter Design Pattern: Provides the interface according to client requirement while using the services of a class with a different interface. The Adapter Pattern is also known as Wrapper. It is designed to enable two or more previously incompatible objects to interact with each other. www.edureka.co
  • 23. STRUCTURAL DESIGN PATTERNS Adapter Design Pattern Example www.edureka.co Example: Here is a simple Library Card example which is designed to issue a Library card to a new user of the library which includes all the details like a book holder ID, Account number and many more. Let us execute this using Adapter Design Pattern.
  • 25. Behavioural Design Patterns Behavior Design Patterns are concerned with the responsibility and interaction between the objects. The Behavioural Design Patterns are further classified as follows: • Strategy Pattern • Iterator Pattern • Mediator Pattern • Command Pattern • State Pattern • Observer Pattern • Template Pattern • Visitor Pattern www.edureka.co
  • 26. BEHAVIOURAL DESIGN PATTERNS Strategy Design Pattern Strategy Design Pattern: It defines a family of functionality and encapsulates each one and make them interchangeable. The Strategy Pattern is also known as Policy. www.edureka.co
  • 27. BEHAVIOURAL DESIGN PATTERNS Strategy Design Pattern Example www.edureka.co Example: we are going to consider a simple example of a calculator. We need to perform five different operations. We shall encapsulate all those five operations into Calculator class and execute the program using the Strategy Design Pattern.
  • 29. BEHAVIOURAL DESIGN PATTERNS Command Design Pattern Command Design Pattern: It encapsulates a request under an object as a command and passes it to the invoker object. Invoker object looks for the appropriate object which can handle this command and pass the command to the corresponding object and that object executes the command. It is also known as Action or Transaction. www.edureka.co
  • 30. BEHAVIOURAL DESIGN PATTERNS Command Design Pattern Example www.edureka.co Example: This example demonstrates a simple command execution cycle where the user requires to exhibit switching on and off the various electronic devices in his houses like a bulb and stereo player. He invokes the command through an invoker object called a simple remote control.
  • 32. BEHAVIOURAL DESIGN PATTERNS Observer Design Pattern Observer Design Pattern: It defines a one-to-one dependency so that when one object changes state, all its dependents are notified and updated automatically. www.edureka.co
  • 33. BEHAVIOURAL DESIGN PATTERNS Observer Design Pattern Example www.edureka.co Example: We are going to execute a program using the Observer Design Pattern to display the current average score and the current predictable score of a cricket match.
  • 35. JEE Design Patterns JEE Design Patterns are concerned with providing solutions to the Java EE-based software applications and frameworks. The JEE Design Patterns are further classified as follows: • MVC Design Pattern • Dependency Injection Pattern • DAO Design Pattern • Business Delegate Pattern • Intercepting Filter Pattern • Service Locator Pattern • Transfer Object Pattern www.edureka.co
  • 36. JEE DESIGN PATTERNS MVC Design Pattern MVC Design Pattern: MVC Design Pattern is defined as follows: • Models are basically objects used as blueprints for all of the objects that will be used in the application. • Views are used to represent the presentational aspect of the information and data located in the models. • Controllers control and act as both of the Models as well as Views. They serve as a connection between the Models and Views. www.edureka.co
  • 37. JEE DESIGN PATTERNS MVC Design Pattern Example www.edureka.co Example: We are going to use MVC Design Pattern to set and print the data of the school students.
  • 39. JEE DESIGN PATTERNS DAO Design Pattern DAO Design Pattern: DAO is a pattern in which objects are dedicated to the communication with the Data Layer. These objects instantiate “Session Factories” and handle all of the logic behind communicating with the database. www.edureka.co
  • 40. JEE DESIGN PATTERNS DAO Design Pattern Example www.edureka.co Example: We are going display the Developer details of a certain IT company using the DAO Design Pattern.
  • 42. OVERVIEW OF DESIGN PATTERNS
  • 43. www.edureka.co OVERVIEW OF DESIGN PATTERNS • They are designed to be reusable in multiple projects. • Their solutions help to define system architecture with ease. • Design Patterns can capture the software engineering experiences. • They provide transparency to the design of an application. • Design Patterns are well-proven solutions given by Experts. • Java Design Patterns provide clarity to the System Architecture • They provide the possibility of building a better system. www.edureka.co
  • 44. Copyright © 2017, edureka and/or its affiliates. All rights reserved.