際際滷

際際滷Share a Scribd company logo
Introduction to Design Patterns Raju Golla  ..
What are Design Patterns General and reusable solutions to common problems in  software design. Solutions to problems that have already been resolved Structure or interfaces how the source code should be organised. Interaction  between Classes i.e., collaboration .NET Framework BCL already makes extensive use of patterns. Deal with higher level application and software design (Enterprise architecture) as well as low level abstractions on top  of the source code. It is a dialect for programmers, use templates  rather than reinventing  the wheel, improves system and application design.
Activity
What they are not? Reusable components  such as assemblies, algorithms or class specifications
History Success architect Christopher Alexander book 'A Pattern Language: Towns, builds, construction, 1977' (Non IT) Design patterns: Elements of Reusable Object Oriented Software Gang of Four: Erich Gamma, Richard Helm, Ralph Johnson  and John Vlissides (1995). First time documented successful design patterns.
Classifications Design patterns for  Object oriented programming. Functional programming. Creational Structural Behavioral Security Concurrency Sql User interface Relational Social Distributed
Singleton pattern Member of Creational family of patterns The intention of this pattern is to ensure that a class has only one instance Make the class itself is responsible for keeping  track of its sole instance The class must be accessible to clients There can be only one
Singleton implementation classic
Thread safe
Outcome The default implementation of Singleton pattern is not thread-safe, it should not be used in multi threaded applications i.e., ASP.NET web apps. Introduces tight coupling among collaborating classes. Difficult to test It is feasible to use IOC (Inversion of Control) to avoid tight coupling and testability issues.
Strategy Encapsulate related algorithms Lets the algorithm vary and evolve from the class using it Allows the class to maintain a separate purpose Separates the implementation from the delivery of its results.
Strategy  when to be used? Switch statements. Decouple algorithm implementation from a class. Adding a new method (Calculation) requires class modification.
Strategy implementation Interface Implementing classes
Implementation continued.. Client
Decorator Structural design pattern Allows to add functionality to objects at run time. Alternative to sub classing. Design flexibility Allows adding behaviour to objects at run time. Supports open closed principle.
When to consider? Legacy systems Add functionality to UI controls (Controls, buttons etc) Sealed classes (it is feasible to add
Implementation Classic implementation -Base class Derived classes
Implementation continued Client Output
Decorator class
Implementation continued Concrete decorator
Implementation continued Client Output
Implementation continued
Continued Client
State Member of behavioral pattern Allows object to change methods behaviour based on state of the object, not the configuration. Encapsulate the logic of each state into a single object Allows for dynamic state discovery Makes unit testing easier and efficient
Example Jira issue Object
State  class diagram
Benefits Separation of concerns Transition between sates is explicit and clear. Reuse of the state object. Simplify the program Easier maintainability.
References Microsoft Patterns and practices at  http://msdn.microsoft.com/en-us/practices/default Microsoft Patterns and practices team: Application architecture guide http://apparchguide.codeplex.com/ Head First design patterns C# in depth
Ad

Recommended

1 introduction of OOAD
1 introduction of OOAD
Manish Chaurasia
Reusibility vs Extensibility in OOAD
Reusibility vs Extensibility in OOAD
Shivani Kapoor
Software Architecture Patterns
Software Architecture Patterns
Assaf Gannon
Design patterns
Design patterns
Ahmed Elharouny
NoSQL Introduction, Theory, Implementations
NoSQL Introduction, Theory, Implementations
Firat Atagun
Observer
Observer
Kugaa Sivaa
Structural patterns
Structural patterns
Himanshu
Programing Style
Programing Style
Sumit Kumar
MexADL
MexADL
jccastrejon
[2017/2018] Introduction to Software Architecture
[2017/2018] Introduction to Software Architecture
Ivano Malavolta
LINQ 2 SQL Presentation To Palmchip And Trg, Technology Resource Group
LINQ 2 SQL Presentation To Palmchip And Trg, Technology Resource Group
Shahzad
System Development Life Cycle (SDLC)
System Development Life Cycle (SDLC)
Animesh Chaturvedi
Architectural patterns part 1
Architectural patterns part 1
assinha
Software architecture
Software architecture
Ahmad Raza Aslam
Software architecture
Software architecture
nazn
Typescript design patterns applied to sharepoint framework - Sharepoint Satur...
Typescript design patterns applied to sharepoint framework - Sharepoint Satur...
Luis Valencia
Lecture 17 design concepts (2)
Lecture 17 design concepts (2)
IIUI
Architectural styles and patterns
Architectural styles and patterns
deep sharma
Object Oriented, Design patterns and data modelling worshop
Object Oriented, Design patterns and data modelling worshop
Mohammad Shawahneh
Architectural styles 2
Architectural styles 2
Dr Reeja S R
Chapter 1
Chapter 1
Sarath Srivatsan
Model-Driven Testing with UML 2.0
Model-Driven Testing with UML 2.0
Asanka Dilruk
Essential Software Architecture - Chapter 1 Understanding Software Architectu...
Essential Software Architecture - Chapter 1 Understanding Software Architectu...
John Ortiz
BIS2311Topic2
BIS2311Topic2
Middlesex University EIS
From use case to software architecture
From use case to software architecture
Ahmad karawash
Ch10
Ch10
guest50f28c
Innoslate Overview
Innoslate Overview
Elizabeth Steiner
Week 3 Objectives
Week 3 Objectives
barkeshli
5 Design Patterns Explained
5 Design Patterns Explained
Prabhjit Singh
Design patterns
Design patterns
Binu Bhasuran

More Related Content

What's hot (20)

MexADL
MexADL
jccastrejon
[2017/2018] Introduction to Software Architecture
[2017/2018] Introduction to Software Architecture
Ivano Malavolta
LINQ 2 SQL Presentation To Palmchip And Trg, Technology Resource Group
LINQ 2 SQL Presentation To Palmchip And Trg, Technology Resource Group
Shahzad
System Development Life Cycle (SDLC)
System Development Life Cycle (SDLC)
Animesh Chaturvedi
Architectural patterns part 1
Architectural patterns part 1
assinha
Software architecture
Software architecture
Ahmad Raza Aslam
Software architecture
Software architecture
nazn
Typescript design patterns applied to sharepoint framework - Sharepoint Satur...
Typescript design patterns applied to sharepoint framework - Sharepoint Satur...
Luis Valencia
Lecture 17 design concepts (2)
Lecture 17 design concepts (2)
IIUI
Architectural styles and patterns
Architectural styles and patterns
deep sharma
Object Oriented, Design patterns and data modelling worshop
Object Oriented, Design patterns and data modelling worshop
Mohammad Shawahneh
Architectural styles 2
Architectural styles 2
Dr Reeja S R
Chapter 1
Chapter 1
Sarath Srivatsan
Model-Driven Testing with UML 2.0
Model-Driven Testing with UML 2.0
Asanka Dilruk
Essential Software Architecture - Chapter 1 Understanding Software Architectu...
Essential Software Architecture - Chapter 1 Understanding Software Architectu...
John Ortiz
BIS2311Topic2
BIS2311Topic2
Middlesex University EIS
From use case to software architecture
From use case to software architecture
Ahmad karawash
Ch10
Ch10
guest50f28c
Innoslate Overview
Innoslate Overview
Elizabeth Steiner
Week 3 Objectives
Week 3 Objectives
barkeshli
[2017/2018] Introduction to Software Architecture
[2017/2018] Introduction to Software Architecture
Ivano Malavolta
LINQ 2 SQL Presentation To Palmchip And Trg, Technology Resource Group
LINQ 2 SQL Presentation To Palmchip And Trg, Technology Resource Group
Shahzad
System Development Life Cycle (SDLC)
System Development Life Cycle (SDLC)
Animesh Chaturvedi
Architectural patterns part 1
Architectural patterns part 1
assinha
Software architecture
Software architecture
nazn
Typescript design patterns applied to sharepoint framework - Sharepoint Satur...
Typescript design patterns applied to sharepoint framework - Sharepoint Satur...
Luis Valencia
Lecture 17 design concepts (2)
Lecture 17 design concepts (2)
IIUI
Architectural styles and patterns
Architectural styles and patterns
deep sharma
Object Oriented, Design patterns and data modelling worshop
Object Oriented, Design patterns and data modelling worshop
Mohammad Shawahneh
Architectural styles 2
Architectural styles 2
Dr Reeja S R
Model-Driven Testing with UML 2.0
Model-Driven Testing with UML 2.0
Asanka Dilruk
Essential Software Architecture - Chapter 1 Understanding Software Architectu...
Essential Software Architecture - Chapter 1 Understanding Software Architectu...
John Ortiz
From use case to software architecture
From use case to software architecture
Ahmad karawash
Week 3 Objectives
Week 3 Objectives
barkeshli

Similar to Introduction To Design Patterns (20)

5 Design Patterns Explained
5 Design Patterns Explained
Prabhjit Singh
Design patterns
Design patterns
Binu Bhasuran
Software Patterns
Software Patterns
bonej010
Introduction to Design Patterns
Introduction to Design Patterns
Prageeth Sandakalum
Design Patterns For 70% Of Programmers In The World
Design Patterns For 70% Of Programmers In The World
Saurabh Moody
Sofwear deasign and need of design pattern
Sofwear deasign and need of design pattern
chetankane
Design patterns
Design patterns
mudabbirwarsi
Architecture and design
Architecture and design
himanshu_airon
Design pattern and their application
Design pattern and their application
Hi畛p Ti畉n
Benefits of using software design patterns and when to use design pattern
Benefits of using software design patterns and when to use design pattern
Beroza Paul
Let us understand design pattern
Let us understand design pattern
Mindfire Solutions
Bartlesville Dot Net User Group Design Patterns
Bartlesville Dot Net User Group Design Patterns
Jason Townsend, MBA
Design pattern of software words computer .pptx
Design pattern of software words computer .pptx
muslimpari2503
The maze of Design Patterns & SOLID Principles
The maze of Design Patterns & SOLID Principles
Muhammad Raza
Design Patterns
Design Patterns
Rafael Coutinho
Design patterns for fun & profit - CoderCruise 2018
Design patterns for fun & profit - CoderCruise 2018
David Litvak Bruno
OOPSDesign PPT ( introduction to opps and design (
OOPSDesign PPT ( introduction to opps and design (
bhfcvh531
Design pattern & categories
Design pattern & categories
Himanshu
Final sdp ppt
Final sdp ppt
nancy_17
Day5
Day5
madamewoolf
5 Design Patterns Explained
5 Design Patterns Explained
Prabhjit Singh
Software Patterns
Software Patterns
bonej010
Introduction to Design Patterns
Introduction to Design Patterns
Prageeth Sandakalum
Design Patterns For 70% Of Programmers In The World
Design Patterns For 70% Of Programmers In The World
Saurabh Moody
Sofwear deasign and need of design pattern
Sofwear deasign and need of design pattern
chetankane
Architecture and design
Architecture and design
himanshu_airon
Design pattern and their application
Design pattern and their application
Hi畛p Ti畉n
Benefits of using software design patterns and when to use design pattern
Benefits of using software design patterns and when to use design pattern
Beroza Paul
Let us understand design pattern
Let us understand design pattern
Mindfire Solutions
Bartlesville Dot Net User Group Design Patterns
Bartlesville Dot Net User Group Design Patterns
Jason Townsend, MBA
Design pattern of software words computer .pptx
Design pattern of software words computer .pptx
muslimpari2503
The maze of Design Patterns & SOLID Principles
The maze of Design Patterns & SOLID Principles
Muhammad Raza
Design patterns for fun & profit - CoderCruise 2018
Design patterns for fun & profit - CoderCruise 2018
David Litvak Bruno
OOPSDesign PPT ( introduction to opps and design (
OOPSDesign PPT ( introduction to opps and design (
bhfcvh531
Design pattern & categories
Design pattern & categories
Himanshu
Final sdp ppt
Final sdp ppt
nancy_17
Ad

Introduction To Design Patterns

  • 1. Introduction to Design Patterns Raju Golla ..
  • 2. What are Design Patterns General and reusable solutions to common problems in software design. Solutions to problems that have already been resolved Structure or interfaces how the source code should be organised. Interaction between Classes i.e., collaboration .NET Framework BCL already makes extensive use of patterns. Deal with higher level application and software design (Enterprise architecture) as well as low level abstractions on top of the source code. It is a dialect for programmers, use templates rather than reinventing the wheel, improves system and application design.
  • 4. What they are not? Reusable components such as assemblies, algorithms or class specifications
  • 5. History Success architect Christopher Alexander book 'A Pattern Language: Towns, builds, construction, 1977' (Non IT) Design patterns: Elements of Reusable Object Oriented Software Gang of Four: Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides (1995). First time documented successful design patterns.
  • 6. Classifications Design patterns for Object oriented programming. Functional programming. Creational Structural Behavioral Security Concurrency Sql User interface Relational Social Distributed
  • 7. Singleton pattern Member of Creational family of patterns The intention of this pattern is to ensure that a class has only one instance Make the class itself is responsible for keeping track of its sole instance The class must be accessible to clients There can be only one
  • 10. Outcome The default implementation of Singleton pattern is not thread-safe, it should not be used in multi threaded applications i.e., ASP.NET web apps. Introduces tight coupling among collaborating classes. Difficult to test It is feasible to use IOC (Inversion of Control) to avoid tight coupling and testability issues.
  • 11. Strategy Encapsulate related algorithms Lets the algorithm vary and evolve from the class using it Allows the class to maintain a separate purpose Separates the implementation from the delivery of its results.
  • 12. Strategy when to be used? Switch statements. Decouple algorithm implementation from a class. Adding a new method (Calculation) requires class modification.
  • 13. Strategy implementation Interface Implementing classes
  • 15. Decorator Structural design pattern Allows to add functionality to objects at run time. Alternative to sub classing. Design flexibility Allows adding behaviour to objects at run time. Supports open closed principle.
  • 16. When to consider? Legacy systems Add functionality to UI controls (Controls, buttons etc) Sealed classes (it is feasible to add
  • 17. Implementation Classic implementation -Base class Derived classes
  • 24. State Member of behavioral pattern Allows object to change methods behaviour based on state of the object, not the configuration. Encapsulate the logic of each state into a single object Allows for dynamic state discovery Makes unit testing easier and efficient
  • 26. State class diagram
  • 27. Benefits Separation of concerns Transition between sates is explicit and clear. Reuse of the state object. Simplify the program Easier maintainability.
  • 28. References Microsoft Patterns and practices at http://msdn.microsoft.com/en-us/practices/default Microsoft Patterns and practices team: Application architecture guide http://apparchguide.codeplex.com/ Head First design patterns C# in depth