SlideShare a Scribd company logo
1 of 57
Download to read offline
ICTA Technology Meetup 06
Enterprise Application
Design Patterns
(Part 01)

By Crishantha Nanayakkara
Agenda
Enterprise Design Patterns – An Introduction
Enterprise Design Pattern Catalogs
Gang Of Four (GOF) Patterns
What Next? ­ Enterprise Application 
Architecture Design Patterns

2
Design Patterns
An Introduction

3
4
●

“The gap between the best
software engineering
practice and the average
practice is very wide –
perhaps wider than the other
engineering ”
–

Fred Brooks (A
famous author, ACM
award winner)

5
What is a Pattern?
This means, a Design Pattern gives you a solution to a
common recurring design problem

However,
The Design Patterns are not meant to be laws or rules;
they are just guidelines that you can even alter to fit to
your needs

6
How to create your own design
pattern?
●

●

Firstly, get the complete design pattern
catalog and get familiar with them
If you find a new pattern, then apply,
The Rule of Three
Pattern can be called a pattern if it has been applied in real
world solution by at least three times

7
OO vs Design Patterns
●

Knowing the OO basics (abstraction,
encapsulation, inheritance, polymorphism)
will not make you a good designer!!!
Oh!!!
What should 
I do then?

8
OO vs Design Patterns
●

●

●

Patterns show you how to build systems with
good OO design qualities
Patterns do not give you code. They give
general solutions to design problems
Patterns are not invented they are
discovered

9
Are patterns always great?
●

NO
–

Patterns are a tool, which only be used when it is
needed

–

Heavy use of patterns will lead to complexity

–

Design patterns can be used as a shared
vocabulary for communicating the design to
others irrespective of the programming language

10
What are anti-patterns?
●

If a design pattern gives you a general
solution to a recurring problem in a particular
context then what does an anti-pattern give
u?
–

●

An anti-pattern tells you how to go from a
problem to a BAD solution

Why worry about finding anti-patterns?
–

To prevent other developers from making the
same mistake
11
(Reference: as3dp.com)
12
Enterprise Design 
Pattern Catalogs

13
GOF Design Patterns
Enterprise Application Architecture
Design Patterns 
Enterprise Integration Design Patterns 

SOA Patterns

Security Patterns
Cloud Patterns
14
What are Pattern Catalogs?
The much formal way of specifying pattern descriptions

The first and the
most definite
Fundamental
Design Pattern
Catalog is
GOF
(There are 23
fundamental
patterns in it!!)

Design Patterns: Elements of Reusable
Object-Oriented Software
(Addison-Wesley, 1995)
15
Gang of Four (GOF) Design Patterns Catalog

16
Enterprise Application Architecture Patterns
Catalog

(http://martinfowler.com/eaaCatalog)

17
Enterprise Intergration Patterns Catalog

http://www.eaipatterns.com/
18
GOF Design Patterns
An Introduction

19
20
Behavioural Patterns

21
GOF Design Pattern
Organization

22
GOF Design Pattern
Relationships

23
Strategy Pattern
●

Design Principle 1
Identify the aspects of your application that vary and
separate them from what stays the same

●

Design Principle 2
Program to an interface not to an implementation

●

Design Principle 3
Favor composition over inheritance

24
Strategy Pattern

25
Strategy Pattern

26
Strategy Pattern

Reference: Head First Design Patterns

27
Reference: Head First Design Patterns

28
Reference: Head First Design Patterns

29
The Observer Pattern
Observer 1

Observer 2

Subscribers

Subject

Publisher

Observer 3

When the in Subject changes, subscribers
are notified
●The observers are subscribed to the Subject
to receive updates when the Subject data
changes
●

Unsubscribed

30
Command Pattern

Concrete
Command
Objects
Invoker

Receiver

31
Creational Patterns

32
Singleton Pattern
This overcomes
the multiple
threading issue.

However, the synchronization is bit expensive
This way is good if the performance is not an issue

33
The Simple Factory

34
The Simple Factory

35
Simple Factory

36
The Factory Method
The factory method pattern encapsulates the object
creation by letting subclasses to decide what objects
to create

37
The Factory Method
This is the
“Factory Method”

Factory objects are created
through INHERITANCE

38
Dependency Inversion
Principle
This is all about reducing dependencies to concrete classes in
our code
●

Before Factory Method

●

After Factory Method

Abstract Class

Concrete
Classes

Though this principle is quite similar to “Program to an
interface” principle, this makes a bigger statement

39
Structural Patterns

40
Decorator Pattern

41
Decorator Pattern

42
Decorator Pattern

Cannot Connect

Can Connect
43
Decorator Pattern

44
Adapter vs Decorator Pattern
●

Adapter Pattern
“Adapter is used when you have an abstract
interface, and you want to map that interface to
another object, which has similar functional role,
but a different interface”
Basically it is used to
Convert the interface of an object into something
else

45
●

Decorator Pattern
“Decorator is used to extend the functionality of
an object while maintaining its own interface”

Since both “Decorator” and “Adapter” patterns
are used to “wrap” objects, they are basically
known as “Wrapper Patterns”

46
Facade Pattern

47
Facade Pattern
●

●

●

●

●

Facades don’t encapsulate the sub system
classes
They provide a simplified interface to their
functionality
The sub system classes still remain for direct
access to outside clients
One sub system can have any number of facades
linked to it
Decouples the client from a sub system – If you
change any of the sub systems, your client code
does not need to change.
48
Facade Pattern
●

Design Principle
The principle of least knowledge
Talk only to your immediate friends
This prevents us from creating a large number of classes
coupled together. Having too many dependencies creates a
fragile design

49
Proxy Pattern
Remote Proxy

●

There are different kinds of proxy types

●

The above is called the “Remote Proxy”

●

The “Remote Proxy” acts as a local representative for
an remote object. A method call on an “Remote Proxy”
results the call being transferred on the wire and the
result is returned back to the proxy and to the client
50
Local heap

Client
object

Proxy
object

Remote heap

Remote call

Remote
object

The “client object” acts like its making remote calls.
● The “proxy object” pretends to be like the “remote object”
● Actually what happens is, the “client object” calls methods
in the “proxy object” (in its local heap), which handles all
low level details of communication
●

51
Composite Pattern
Composites

Leaf Nodes

52
Composite Pattern
MenuComponent

Menu
MenuItem

MenuItems

53
Composite Pattern
All components must implement the MenuComponent
interface;
Why? In order for the composite to work transparently to the
client, you must implement the same interface for all objects in
the composite
Sometimes, the best possible way is to throw
Run-time Exceptions to all unrelated methods

54
The MenuComponent

Menu

Both Menu and
MenuItem components
should implement this
interface
Having default
implementation will be
difficult for each method

MenuItem

Hence, exceptions are
thrown if any invalid
method is called through
a component

Common

55
56
57

More Related Content

What's hot (7)

Effective Prototyping Process for Software Creation
Effective Prototyping Process for Software CreationEffective Prototyping Process for Software Creation
Effective Prototyping Process for Software Creation
 
Creational Patterns
Creational PatternsCreational Patterns
Creational Patterns
 
Make it or Break It: Evolutionary or Throwaway Prototyping
Make it or Break It: Evolutionary or Throwaway PrototypingMake it or Break It: Evolutionary or Throwaway Prototyping
Make it or Break It: Evolutionary or Throwaway Prototyping
 
Software prototyping
Software prototypingSoftware prototyping
Software prototyping
 
Software design principles
Software design principlesSoftware design principles
Software design principles
 
Software engineering -core topics
Software engineering -core topicsSoftware engineering -core topics
Software engineering -core topics
 
6. ch 5-understanding requirements
6. ch 5-understanding requirements6. ch 5-understanding requirements
6. ch 5-understanding requirements
 

Viewers also liked

Colombo Architecture Meetup - Enterprise Architectural Challenges in Large En...
Colombo Architecture Meetup - Enterprise Architectural Challenges in Large En...Colombo Architecture Meetup - Enterprise Architectural Challenges in Large En...
Colombo Architecture Meetup - Enterprise Architectural Challenges in Large En...
Crishantha Nanayakkara
 
Information Lifecycle Governance Leader Reference Guide
Information Lifecycle Governance Leader Reference GuideInformation Lifecycle Governance Leader Reference Guide
Information Lifecycle Governance Leader Reference Guide
Dan D'Angelo
 
Estrategia Information lifecycle Management
Estrategia Information lifecycle ManagementEstrategia Information lifecycle Management
Estrategia Information lifecycle Management
Jaime Contreras
 

Viewers also liked (20)

Colombo Architecture Meetup - Enterprise Architectural Challenges in Large En...
Colombo Architecture Meetup - Enterprise Architectural Challenges in Large En...Colombo Architecture Meetup - Enterprise Architectural Challenges in Large En...
Colombo Architecture Meetup - Enterprise Architectural Challenges in Large En...
 
ICTA Technology Meetup 03 - SOA Security
ICTA Technology Meetup 03 - SOA SecurityICTA Technology Meetup 03 - SOA Security
ICTA Technology Meetup 03 - SOA Security
 
ION Santiago: Lock It Up: TLS for Network Operators
ION Santiago: Lock It Up: TLS for Network OperatorsION Santiago: Lock It Up: TLS for Network Operators
ION Santiago: Lock It Up: TLS for Network Operators
 
Plsql les04
Plsql les04Plsql les04
Plsql les04
 
plsql les06
 plsql les06 plsql les06
plsql les06
 
plsql les01
 plsql les01 plsql les01
plsql les01
 
SSL: limitations, bad practices and how to do it right
SSL: limitations, bad practices  and how to do it rightSSL: limitations, bad practices  and how to do it right
SSL: limitations, bad practices and how to do it right
 
ICTA Technology Meetup 01 - Enterprise Application Integration
ICTA Technology Meetup 01 - Enterprise Application IntegrationICTA Technology Meetup 01 - Enterprise Application Integration
ICTA Technology Meetup 01 - Enterprise Application Integration
 
SOA for PL/SQL Developer (OPP 2010)
SOA for PL/SQL Developer (OPP 2010)SOA for PL/SQL Developer (OPP 2010)
SOA for PL/SQL Developer (OPP 2010)
 
Information Lifecycle Governance Leader Reference Guide
Information Lifecycle Governance Leader Reference GuideInformation Lifecycle Governance Leader Reference Guide
Information Lifecycle Governance Leader Reference Guide
 
Trends for 2014
Trends for 2014Trends for 2014
Trends for 2014
 
Creating Better Customer Experiences Online (with Top Tasks) presented by Ger...
Creating Better Customer Experiences Online (with Top Tasks) presented by Ger...Creating Better Customer Experiences Online (with Top Tasks) presented by Ger...
Creating Better Customer Experiences Online (with Top Tasks) presented by Ger...
 
How business analysts are catalysts for business change
How business analysts are catalysts for business changeHow business analysts are catalysts for business change
How business analysts are catalysts for business change
 
Data Vault Introduction
Data Vault IntroductionData Vault Introduction
Data Vault Introduction
 
3D printing en korte keten recyclage (Evi Swinnen, timelab)
3D printing en korte keten recyclage (Evi Swinnen, timelab)3D printing en korte keten recyclage (Evi Swinnen, timelab)
3D printing en korte keten recyclage (Evi Swinnen, timelab)
 
Pedro De Bruyckere Meetup Presentation
Pedro De Bruyckere Meetup PresentationPedro De Bruyckere Meetup Presentation
Pedro De Bruyckere Meetup Presentation
 
Smarter Eduction - Higher Education Summit 2011 - D Watt
Smarter Eduction - Higher Education Summit 2011 - D WattSmarter Eduction - Higher Education Summit 2011 - D Watt
Smarter Eduction - Higher Education Summit 2011 - D Watt
 
Google Glass UX Best Practices Presentation by Litrik De Roy (@litrik) at the...
Google Glass UX Best Practices Presentation by Litrik De Roy (@litrik) at the...Google Glass UX Best Practices Presentation by Litrik De Roy (@litrik) at the...
Google Glass UX Best Practices Presentation by Litrik De Roy (@litrik) at the...
 
Estrategia Information lifecycle Management
Estrategia Information lifecycle ManagementEstrategia Information lifecycle Management
Estrategia Information lifecycle Management
 
Information Lifecycle Management
Information Lifecycle ManagementInformation Lifecycle Management
Information Lifecycle Management
 

Similar to ICTA Technology Meetup 06 - Enterprise Application Design Patterns

12266422.ppt
12266422.ppt12266422.ppt
12266422.ppt
CSEC5
 

Similar to ICTA Technology Meetup 06 - Enterprise Application Design Patterns (20)

Design Patterns - General Introduction
Design Patterns - General IntroductionDesign Patterns - General Introduction
Design Patterns - General Introduction
 
OOSAD Chapter 6 Object Oriented Design.pptx
OOSAD Chapter 6 Object Oriented Design.pptxOOSAD Chapter 6 Object Oriented Design.pptx
OOSAD Chapter 6 Object Oriented Design.pptx
 
Software Design
Software DesignSoftware Design
Software Design
 
12266422.ppt
12266422.ppt12266422.ppt
12266422.ppt
 
The Role of the Architect
The Role of the ArchitectThe Role of the Architect
The Role of the Architect
 
Design final
Design finalDesign final
Design final
 
Code Craftsmanship Checklist
Code Craftsmanship ChecklistCode Craftsmanship Checklist
Code Craftsmanship Checklist
 
Software Architecture for Agile Development
Software Architecture for Agile DevelopmentSoftware Architecture for Agile Development
Software Architecture for Agile Development
 
Ch 9-design-engineering
Ch 9-design-engineeringCh 9-design-engineering
Ch 9-design-engineering
 
AntiPatterns
AntiPatternsAntiPatterns
AntiPatterns
 
Applying design patterns
Applying design patternsApplying design patterns
Applying design patterns
 
Design Pattern - Introduction
Design Pattern - IntroductionDesign Pattern - Introduction
Design Pattern - Introduction
 
UNIT 01 SMD.pptx
UNIT 01 SMD.pptxUNIT 01 SMD.pptx
UNIT 01 SMD.pptx
 
Introduction to software engineering
Introduction to software engineeringIntroduction to software engineering
Introduction to software engineering
 
Purpose Before Action: Why You Need a Design Language System
Purpose Before Action: Why You Need a Design Language SystemPurpose Before Action: Why You Need a Design Language System
Purpose Before Action: Why You Need a Design Language System
 
Software Engineering Primer
Software Engineering PrimerSoftware Engineering Primer
Software Engineering Primer
 
Domain Driven Design: Made Easy employing Systemic Approach
Domain Driven Design: Made Easy employing Systemic ApproachDomain Driven Design: Made Easy employing Systemic Approach
Domain Driven Design: Made Easy employing Systemic Approach
 
Online TechTalk  "Patterns in Embedded SW Design"
Online TechTalk  "Patterns in Embedded SW Design"Online TechTalk  "Patterns in Embedded SW Design"
Online TechTalk  "Patterns in Embedded SW Design"
 
ADUF - Adaptable Design Up Front
ADUF -  Adaptable Design Up FrontADUF -  Adaptable Design Up Front
ADUF - Adaptable Design Up Front
 
Modern software architect post the agile wave
Modern software architect post the agile waveModern software architect post the agile wave
Modern software architect post the agile wave
 

More from Crishantha Nanayakkara

More from Crishantha Nanayakkara (20)

Sri Lanka Government Enterprise Architecture
Sri Lanka Government Enterprise ArchitectureSri Lanka Government Enterprise Architecture
Sri Lanka Government Enterprise Architecture
 
Application Deployement Strategies
Application Deployement StrategiesApplication Deployement Strategies
Application Deployement Strategies
 
Azure for AWS Developers
Azure for AWS DevelopersAzure for AWS Developers
Azure for AWS Developers
 
Enterprise Integration in Cloud Native Microservices Architectures
Enterprise Integration in Cloud Native Microservices ArchitecturesEnterprise Integration in Cloud Native Microservices Architectures
Enterprise Integration in Cloud Native Microservices Architectures
 
AWS Systems Manager
AWS Systems ManagerAWS Systems Manager
AWS Systems Manager
 
AWS Big Data Landscape
AWS Big Data LandscapeAWS Big Data Landscape
AWS Big Data Landscape
 
1BT_Designing_Microservices
1BT_Designing_Microservices1BT_Designing_Microservices
1BT_Designing_Microservices
 
1BT_Tech_Talk_AWS_Cross_Account_Access
1BT_Tech_Talk_AWS_Cross_Account_Access1BT_Tech_Talk_AWS_Cross_Account_Access
1BT_Tech_Talk_AWS_Cross_Account_Access
 
AWS Security Hub
AWS Security HubAWS Security Hub
AWS Security Hub
 
Resiilient Architectures on AWS
Resiilient Architectures on AWSResiilient Architectures on AWS
Resiilient Architectures on AWS
 
Reactive Microservices
Reactive MicroservicesReactive Microservices
Reactive Microservices
 
Expectaions in IT industry
Expectaions in IT industryExpectaions in IT industry
Expectaions in IT industry
 
Towards Cloud Enabled Data Intensive Digital Transformation
Towards Cloud Enabled Data Intensive Digital TransformationTowards Cloud Enabled Data Intensive Digital Transformation
Towards Cloud Enabled Data Intensive Digital Transformation
 
Container Architecture
Container ArchitectureContainer Architecture
Container Architecture
 
Domain Driven Design and Hexagonal Architecture
Domain Driven Design and Hexagonal ArchitectureDomain Driven Design and Hexagonal Architecture
Domain Driven Design and Hexagonal Architecture
 
Microservices
MicroservicesMicroservices
Microservices
 
Enterprise architecture in the current e-Government context in Sri Lanka
Enterprise architecture in the current e-Government context in Sri LankaEnterprise architecture in the current e-Government context in Sri Lanka
Enterprise architecture in the current e-Government context in Sri Lanka
 
Modern Trends in IT
Modern Trends in ITModern Trends in IT
Modern Trends in IT
 
ICTA Meetup 12 - Message Brokers
ICTA Meetup 12 - Message BrokersICTA Meetup 12 - Message Brokers
ICTA Meetup 12 - Message Brokers
 
ICTA Meetup 11 - Big Data
ICTA Meetup 11 - Big DataICTA Meetup 11 - Big Data
ICTA Meetup 11 - Big Data
 

Recently uploaded

Recently uploaded (20)

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
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 

ICTA Technology Meetup 06 - Enterprise Application Design Patterns