SlideShare a Scribd company logo
1 of 56
Design  Patterns  Dr. K. Priyantha Hewagamage Advanced Software Engineering
What is Design Pattern? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],University of Colombo School of Computing Advanced Software Engineering
Introduction ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],University of Colombo School of Computing Advanced Software Engineering
Pattern origins and history ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],University of Colombo School of Computing Advanced Software Engineering
Definitions ,[object Object],[object Object],[object Object],University of Colombo School of Computing Advanced Software Engineering
Definitions ….. ,[object Object],[object Object],University of Colombo School of Computing Advanced Software Engineering
Properties ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],University of Colombo School of Computing Advanced Software Engineering
Properties (2) ,[object Object],[object Object],[object Object],[object Object],University of Colombo School of Computing Advanced Software Engineering
Ingredients  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],University of Colombo School of Computing Advanced Software Engineering
Pattern description (Pattern template) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],University of Colombo School of Computing Advanced Software Engineering
Types of software patterns ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],University of Colombo School of Computing Advanced Software Engineering
Pattern language ,[object Object],[object Object],[object Object],University of Colombo School of Computing Advanced Software Engineering
Pattern catalogs and systems ,[object Object],[object Object],[object Object],[object Object],University of Colombo School of Computing Advanced Software Engineering
Types of Design Patterns ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],University of Colombo School of Computing Advanced Software Engineering
Pattern Scope ,[object Object],[object Object],[object Object],[object Object],[object Object],University of Colombo School of Computing Advanced Software Engineering
Design pattern catalog  University of Colombo School of Computing Advanced Software Engineering
The Singleton Pattern ,[object Object],[object Object],[object Object],[object Object],University of Colombo School of Computing Advanced Software Engineering
The Singleton Pattern ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],University of Colombo School of Computing Advanced Software Engineering
Singleton ,[object Object],University of Colombo School of Computing Advanced Software Engineering public class Singleton {  static Singleton theInstance  = new Singleton();  private Singleton() { }  public static Singleton getInstance()  {  return theInstance;  }  } « Singleton » theInstance getInstance
Exercise ,[object Object],[object Object],[object Object],[object Object],University of Colombo School of Computing Advanced Software Engineering
The Abstraction-Occurrence Pattern ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],University of Colombo School of Computing Advanced Software Engineering
Abstraction-Occurrence  ,[object Object],University of Colombo School of Computing Advanced Software Engineering TVSeries seriesName producer Episode number title storySynopsis * * * * * * «Occurrence» «Abstraction» * * * * * * Title name author LibraryItem barCodeNumber * * * * * * isbn publicationDate libOfCongress
Abstraction-Occurrence  ,[object Object],University of Colombo School of Computing Advanced Software Engineering name author LibraryItem barCodeNumber isbn publicationDate libOfCongress Title name author LibraryItem barCodeNumber isbn publicationDate libOfCongress name author LibraryItem barCodeNumber isbn publicationDate libOfCongress GulliversTravels MobyDick
Abstraction-Occurrence ,[object Object],University of Colombo School of Computing Advanced Software Engineering ScheduledTrain number SpecificTrain date * * * * ScheduledLeg SpecificLeg actualDepTime * actualArrTime scheduledDepTime scheduledArrTime Station origin destination * *
The General Hierarchy  Pattern ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],University of Colombo School of Computing Advanced Software Engineering
General Hierarchy ,[object Object],University of Colombo School of Computing Advanced Software Engineering «subordinate» * «Node» «SuperiorNode» «NonSuperiorNode» 0..1 * supervises Manager Employee Technician Secretary 0..1 * contains Directory FileSystemItem File 0..1
General Hierarchy ,[object Object],University of Colombo School of Computing Advanced Software Engineering RockRecording BluesRecording ClassicalRecording JazzRecording MusicVideo VideoRecoding AudioRecording Recording
The Player-Role Pattern ,[object Object],[object Object],[object Object],[object Object],[object Object],University of Colombo School of Computing Advanced Software Engineering
Player-Role ,[object Object],[object Object],[object Object],[object Object],[object Object],University of Colombo School of Computing Advanced Software Engineering «Player» «Role1» «Role2» «AbstractRole»
Player-Role ,[object Object],University of Colombo School of Computing Advanced Software Engineering
Player-Role ,[object Object],University of Colombo School of Computing Advanced Software Engineering
Player-Role ,[object Object],[object Object],[object Object],University of Colombo School of Computing Advanced Software Engineering
The Observer Pattern ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],University of Colombo School of Computing Advanced Software Engineering
Observer ,[object Object],University of Colombo School of Computing Advanced Software Engineering WeatherViewer * * * * * * * Observers are  notified when a new  prediction is ready Forecaster Observable «ConcreteObservable» «ConcreteObserver» «Observable» addObserver notifyObservers «interface» «Observer» update * * * * * * * «interface» Observer
University of Colombo School of Computing Advanced Software Engineering
University of Colombo School of Computing Advanced Software Engineering
Observer ,[object Object],[object Object],[object Object],University of Colombo School of Computing Advanced Software Engineering
The Delegation Pattern ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],University of Colombo School of Computing Advanced Software Engineering
Delegation ,[object Object],University of Colombo School of Computing Advanced Software Engineering delegate.method();  « Delegate » « Delegator » delegatingMethod()  {  }  delegatingMethod method LinkedList addFirst addLast addAfter removeFirst removeLast delete isEmpty Stack push pop isEmpty push() {  list.addFirst(); }
Delegation University of Colombo School of Computing Advanced Software Engineering Example: two levels of delegation
Delegation ,[object Object],[object Object],[object Object],[object Object],[object Object],University of Colombo School of Computing Advanced Software Engineering return specificFlight.regularFlight.flightNumber(); return getRegularFlight().flightNumber();
The Adapter Pattern ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],University of Colombo School of Computing Advanced Software Engineering
Adapter ,[object Object],University of Colombo School of Computing Advanced Software Engineering «Adaptee» adaptedMethod «Superclass» polymorphicMethod «Adapter» polymorphicMethod() return  adaptee.adaptedMethod(); {  }
Adapter ,[object Object],University of Colombo School of Computing Advanced Software Engineering TimsTorus calcVolume ThreeDShape volume Sphere Torus volume() return  TimsTorus.calcVolume(); {  }
Adapters ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],University of Colombo School of Computing Advanced Software Engineering
The Façade Pattern ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],University of Colombo School of Computing Advanced Software Engineering
Façade ,[object Object],University of Colombo School of Computing Advanced Software Engineering «PackageClass3» «PackageClass2» «PackageClass1» * * * * * * RegularFlight * * * * * * Reservation Airline findFlight makeBooking deleteBooking «Facade»
The Immutable Pattern ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],University of Colombo School of Computing Advanced Software Engineering
The Read-only Interface Pattern ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],University of Colombo School of Computing Advanced Software Engineering
Read-only Interface ,[object Object],University of Colombo School of Computing Advanced Software Engineering «UnprivilegedClass» * * * * * * «Mutator» «Mutable» attribute «private» getAttribute setAttribute «interface» «ReadOnlyInterface» getAttribute * * * * *
Read-only Interface ,[object Object],University of Colombo School of Computing Advanced Software Engineering Mutableperson firstName lastName setFirstName setLastName getName «interface» Person getName
The Proxy Pattern ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],University of Colombo School of Computing Advanced Software Engineering
Proxy ,[object Object],University of Colombo School of Computing Advanced Software Engineering «interface» «ClassIF» * * * * * * * «Client» «HeavyWeight» «Proxy»
Proxy ,[object Object],University of Colombo School of Computing Advanced Software Engineering «interface» ListIF The list elements will  be loaded into local  memory only when  needed. ListProxy PersistentList «interface» Student PersistentStudent StudentProxy
Difficulties and Risks When Creating Class Diagrams  ,[object Object],[object Object],[object Object],[object Object],[object Object],University of Colombo School of Computing Advanced Software Engineering
Difficulties and Risks When Creating Class Diagrams ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],University of Colombo School of Computing Advanced Software Engineering

More Related Content

What's hot

Design Patterns Presentation - Chetan Gole
Design Patterns Presentation -  Chetan GoleDesign Patterns Presentation -  Chetan Gole
Design Patterns Presentation - Chetan GoleChetan Gole
 
Design Patterns - General Introduction
Design Patterns - General IntroductionDesign Patterns - General Introduction
Design Patterns - General IntroductionAsma CHERIF
 
Design patterns ppt
Design patterns pptDesign patterns ppt
Design patterns pptAman Jain
 
Design Patterns
Design PatternsDesign Patterns
Design Patternssoms_1
 
User Interface Design in Software Engineering SE15
User Interface Design in Software Engineering SE15User Interface Design in Software Engineering SE15
User Interface Design in Software Engineering SE15koolkampus
 
Uml in software engineering
Uml in software engineeringUml in software engineering
Uml in software engineeringMubashir Jutt
 
The Singleton Pattern Presentation
The Singleton Pattern PresentationThe Singleton Pattern Presentation
The Singleton Pattern PresentationJAINIK PATEL
 
UML diagrams and symbols
UML diagrams and symbolsUML diagrams and symbols
UML diagrams and symbolsKumar
 
Design concept -Software Engineering
Design concept -Software EngineeringDesign concept -Software Engineering
Design concept -Software EngineeringVarsha Ajith
 
Design Pattern For C# Part 1
Design Pattern For C# Part 1Design Pattern For C# Part 1
Design Pattern For C# Part 1Shahzad
 
Architecture design in software engineering
Architecture design in software engineeringArchitecture design in software engineering
Architecture design in software engineeringPreeti Mishra
 

What's hot (20)

Design Patterns Presentation - Chetan Gole
Design Patterns Presentation -  Chetan GoleDesign Patterns Presentation -  Chetan Gole
Design Patterns Presentation - Chetan Gole
 
Design Patterns - General Introduction
Design Patterns - General IntroductionDesign Patterns - General Introduction
Design Patterns - General Introduction
 
Gof design patterns
Gof design patternsGof design patterns
Gof design patterns
 
Design pattern-presentation
Design pattern-presentationDesign pattern-presentation
Design pattern-presentation
 
Design pattern
Design patternDesign pattern
Design pattern
 
Software Design Patterns
Software Design PatternsSoftware Design Patterns
Software Design Patterns
 
Introduction to UML
Introduction to UMLIntroduction to UML
Introduction to UML
 
Design patterns ppt
Design patterns pptDesign patterns ppt
Design patterns ppt
 
Design Pattern
Design PatternDesign Pattern
Design Pattern
 
Design Patterns
Design PatternsDesign Patterns
Design Patterns
 
Cohesion and coupling
Cohesion and couplingCohesion and coupling
Cohesion and coupling
 
User Interface Design in Software Engineering SE15
User Interface Design in Software Engineering SE15User Interface Design in Software Engineering SE15
User Interface Design in Software Engineering SE15
 
Software Architecture
Software ArchitectureSoftware Architecture
Software Architecture
 
Uml in software engineering
Uml in software engineeringUml in software engineering
Uml in software engineering
 
UML Diagrams
UML DiagramsUML Diagrams
UML Diagrams
 
The Singleton Pattern Presentation
The Singleton Pattern PresentationThe Singleton Pattern Presentation
The Singleton Pattern Presentation
 
UML diagrams and symbols
UML diagrams and symbolsUML diagrams and symbols
UML diagrams and symbols
 
Design concept -Software Engineering
Design concept -Software EngineeringDesign concept -Software Engineering
Design concept -Software Engineering
 
Design Pattern For C# Part 1
Design Pattern For C# Part 1Design Pattern For C# Part 1
Design Pattern For C# Part 1
 
Architecture design in software engineering
Architecture design in software engineeringArchitecture design in software engineering
Architecture design in software engineering
 

Similar to Design Patterns

Cs 1023 lec 9 design pattern (week 2)
Cs 1023 lec 9 design pattern (week 2)Cs 1023 lec 9 design pattern (week 2)
Cs 1023 lec 9 design pattern (week 2)stanbridge
 
Design pattern & categories
Design pattern & categoriesDesign pattern & categories
Design pattern & categoriesHimanshu
 
Module 2 design patterns-2
Module 2   design patterns-2Module 2   design patterns-2
Module 2 design patterns-2Ankit Dubey
 
Prophecy Of Design Patterns
Prophecy Of Design PatternsProphecy Of Design Patterns
Prophecy Of Design Patternspradeepkothiyal
 
dotnet stuff.com tutorials-design-patterns_exploring-net-design-patterns-in-s...
dotnet stuff.com tutorials-design-patterns_exploring-net-design-patterns-in-s...dotnet stuff.com tutorials-design-patterns_exploring-net-design-patterns-in-s...
dotnet stuff.com tutorials-design-patterns_exploring-net-design-patterns-in-s...Anil Sharma
 
Oops design pattern intro
Oops design pattern intro Oops design pattern intro
Oops design pattern intro anshu_atri
 
5 Design Patterns Explained
5 Design Patterns Explained5 Design Patterns Explained
5 Design Patterns ExplainedPrabhjit Singh
 
SADP PPTs of all modules - Shanthi D.L.pdf
SADP PPTs of all modules - Shanthi D.L.pdfSADP PPTs of all modules - Shanthi D.L.pdf
SADP PPTs of all modules - Shanthi D.L.pdfB.T.L.I.T
 
Software Patterns
Software PatternsSoftware Patterns
Software Patternskim.mens
 
Introduction To Design Patterns
Introduction To Design PatternsIntroduction To Design Patterns
Introduction To Design Patternssukumarraju6
 
Software design and Architecture.pptx
Software design and Architecture.pptxSoftware design and Architecture.pptx
Software design and Architecture.pptxSHAHZAIBABBAS13
 
Patterns for the People
Patterns for the PeoplePatterns for the People
Patterns for the PeopleKevlin Henney
 

Similar to Design Patterns (20)

Cs 1023 lec 9 design pattern (week 2)
Cs 1023 lec 9 design pattern (week 2)Cs 1023 lec 9 design pattern (week 2)
Cs 1023 lec 9 design pattern (week 2)
 
Design pattern & categories
Design pattern & categoriesDesign pattern & categories
Design pattern & categories
 
Module 2 design patterns-2
Module 2   design patterns-2Module 2   design patterns-2
Module 2 design patterns-2
 
Introduction to Design Patterns
Introduction to Design PatternsIntroduction to Design Patterns
Introduction to Design Patterns
 
Design Patterns
Design PatternsDesign Patterns
Design Patterns
 
Prophecy Of Design Patterns
Prophecy Of Design PatternsProphecy Of Design Patterns
Prophecy Of Design Patterns
 
dotnet stuff.com tutorials-design-patterns_exploring-net-design-patterns-in-s...
dotnet stuff.com tutorials-design-patterns_exploring-net-design-patterns-in-s...dotnet stuff.com tutorials-design-patterns_exploring-net-design-patterns-in-s...
dotnet stuff.com tutorials-design-patterns_exploring-net-design-patterns-in-s...
 
Design patterns
Design patternsDesign patterns
Design patterns
 
Oops design pattern intro
Oops design pattern intro Oops design pattern intro
Oops design pattern intro
 
5 Design Patterns Explained
5 Design Patterns Explained5 Design Patterns Explained
5 Design Patterns Explained
 
Design Patterns
Design PatternsDesign Patterns
Design Patterns
 
SADP PPTs of all modules - Shanthi D.L.pdf
SADP PPTs of all modules - Shanthi D.L.pdfSADP PPTs of all modules - Shanthi D.L.pdf
SADP PPTs of all modules - Shanthi D.L.pdf
 
.Net design pattern
.Net design pattern.Net design pattern
.Net design pattern
 
Software Patterns
Software PatternsSoftware Patterns
Software Patterns
 
Patterns Overview
Patterns OverviewPatterns Overview
Patterns Overview
 
What is design pattern
What is design patternWhat is design pattern
What is design pattern
 
Introduction To Design Patterns
Introduction To Design PatternsIntroduction To Design Patterns
Introduction To Design Patterns
 
Software design and Architecture.pptx
Software design and Architecture.pptxSoftware design and Architecture.pptx
Software design and Architecture.pptx
 
Patterns for the People
Patterns for the PeoplePatterns for the People
Patterns for the People
 
Design Patterns.ppt
Design Patterns.pptDesign Patterns.ppt
Design Patterns.ppt
 

Recently uploaded

How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfUmakantAnnand
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 

Recently uploaded (20)

How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.Compdf
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 

Design Patterns

  • 1. Design Patterns Dr. K. Priyantha Hewagamage Advanced Software Engineering
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16. Design pattern catalog University of Colombo School of Computing Advanced Software Engineering
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35. University of Colombo School of Computing Advanced Software Engineering
  • 36. University of Colombo School of Computing Advanced Software Engineering
  • 37.
  • 38.
  • 39.
  • 40. Delegation University of Colombo School of Computing Advanced Software Engineering Example: two levels of delegation
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.
  • 46.
  • 47.
  • 48.
  • 49.
  • 50.
  • 51.
  • 52.
  • 53.
  • 54.
  • 55.
  • 56.

Editor's Notes

  1. As mentioned before, the current use of the term "pattern" is derived from the writings of the architect Christopher Alexander who has written several books on the topic as it relates to urban planning and building architecture (list of books). Patterns in software first became popular with the wide acceptance of the book Design Patterns: Elements of Reusable Object-Oriented Software by Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides (frequently referred to as the Gang of Four or just GoF). Other recent books that have helped popularize patterns are: Pattern-Oriented Software Architecture: A System of Patterns ( also called the POSA book ) by Frank Buschmann, Regine Meunier, Hans Rohnert, Peter Sommerlad, and Michael Stal (sometimes called the Siemens Gang of Five or just GoV); and the books Pattern Languages of Program Design and Pattern Languages of Program Design 2, which are selected papers from the first and second conferences on Patterns Languages of Program Design (PLoP or PLoPD). Many of these books are part of the Software Patterns Series from Addison-Wesley.
  2. It is unavoidable to mention what Alexander says about patterns, since the origin of design patterns lies in work done by him in late 70is. Although Alexander was talking about patterns in buildings, the core of patterns in object-oriented design and building is a solution to a problem in a context. In "Understanding and Using Patterns in Software Development", Dirk Riehle and Heinz Zullighoven give a nice definition of the term "pattern" which is very broadly applicable. Coplein in his paper “Software Design Patterns: Common questions and Answers” refers to patterns as both the thing and the instructions for making the thing. Basically, pattern can be viewed as a particular prose form of recording design information such that designs which have worked well in the past can be applied again in similar situations in the future. (Beck, Coplien - “Industrial experience with design patterns”
  3. Patterns provide a common vocabulary for designers to communicate, document, and explore design alternatives (Gamma93-paper). Consequently enabling effective communicating of complex concepts between designers. Patterns capture solutions and essential parts of design in a compact form. Pattern describe software abstractions, ensuring vide applicability, but a pattern may provide hints about potential implementation issues). Simply said, patterns help designer get a design “right” faster. Patterns are not necessarily object.oriented, and patterns can be found in a variety of software systems, independent of the methods used in developing those systems (Coplien, Industrial experience) However, a pattern is not an implementation. It describes when, why, and how to go about creating an implementation or other engineering product. Also, patterns do not solve all design problems.
  4. Patterns provide a common vocabulary for designers to communicate, document, and explore design alternatives (Gamma93-paper). Consequently enabling effective communicating of complex concepts between designers. Patterns capture solutions and essential parts of design in a compact form. Pattern describe software abstractions, ensuring vide applicability, but a pattern may provide hints about potential implementation issues). Simply said, patterns help designer get a design “right” faster. Patterns are not necessarily object.oriented, and patterns can be found in a variety of software systems, independent of the methods used in developing those systems (Coplien, Industrial experience) However, a pattern is not an implementation. It describes when, why, and how to go about creating an implementation or other engineering product. Also, patterns do not solve all design problems.
  5. Every pattern has these essential elements: Context - refers to a recurring set of situations in which the pattern applies. Problem -refers to a set of forces -- goals and constraints -- that occur in this context. (describes when to apply the pattern) Solution -refers to a design form or design rule that someone can apply to resolve these forces. (describes the elements that make up design, their relationships, responsibilities and collaboration)
  6. Much of the initial patterns focus in the software community has been on design patterns. The patterns in the [GoF] book are object-oriented design patterns. However, there are many other kinds of software patterns besides design patterns. For example, Martin Fowler has written a book of Analysis Patterns. Patterns cover all aspects of software engineering including: development organization, software process, project planning, requirements engineering, and software configuration, management (just to name a few). Presently however, design patterns still seem to be the most popular (though organization patterns seem to be gaining momentum). ---- The difference between these three kinds of design patterns are in their corresponding levels of abstraction and detail. Architectural patterns are high-level strategies that concern large-scale components and the global properties and mechanisms of a system. They have wide-sweeping implications which affect the overall skeletal structure and organization of a software system. Design patterns are medium-scale tactics that flesh out some of the structure and behavior of entities and their relationships. They do not influence overall system structure, but instead define micro-architectures of subsystems and components. Idioms are paradigm-specific and language-specific programming techniques that fill in low-level internal or external details of a component's structure or behavior.
  7. In the Patterns Definitions section of the Patterns Home Page, Cope defines a pattern language as follows: A pattern language defines a collection of patterns and the rules to combine them into an architectural style. Pattern languages describe software frameworks or families of related systems. Cope gives a slightly different definition in "Software Design Patterns: Common Questions and Answers": A pattern language is a structured collection of patterns that build on each other to transform needs and constraints into an architecture. A pattern language includes rules and guidelines which explain how and when to apply its patterns to solve a problem which is larger than any individual pattern can solve. These rules and guidelines suggest the order and granularity for applying each pattern in the language. A pattern language may be regarded as a lexicon of patterns plus a grammar that defines how to weave them together into valid sentences (or artful tapestries if you will). Ideally, good pattern languages are generative, capable of generating all the possible sentences from a rich and expressive pattern vocabulary.
  8. The authors of [POSA] have classified different kinds of pattern collections that possess varying degrees of structure and interaction into pattern catalogs, systems, and languages: Pattern Catalogs A pattern catalog is a collection of related patterns (perhaps only loosely or informally related). It typically subdivides the patterns into at least a small number of broad categories and may include some amount of cross referencing between patterns. Pattern Systems A pattern system is a cohesive set of related patterns which work together to support the construction and evolution of whole architectures. It describes many interrelationships between the patterns and their groupings and how they may be combined and composed to solve more complex problems. The primary difference between the pattern system and a pattern language is that, ideally, pattern languages are computationally complete, showing all possible combinations of patterns and their variations to produce complete architectures. In practice however, the difference between pattern systems and pattern languages can be extremely difficult to ascertain.
  9. Structural patterns form larger structures from individual parts, generally of different classes. Structural patterns vary a great deal depending on what sort of structure is being created for what purpose. to describe interactions between objects. They focus on how objects communicate with each other. They can reduce complex flow charts to mere interconnections between objects of various classes.
  10. In Gamma’s book, patterns are classified by two criteria. First is Purpose, which reflects what pattern does. Patterns can have either creational, structural, or behavioral purpose. Creational patterns concern the process of object creation. Structural patterns deal with the composition of classes or objects. Behavioral patterns characterize the ways in which classes or objects interact and distribute responsibility. The second criterion is scope, which specifies whether the pattern applies primarly on classes or objects. Class patterns deal with relationships between classes and their sub-classes. These relationships are established through inheritance, so they are static (fixed at compile time). Object patterns deal with object relationships, which can be changed at run-time and are more dynamic. (petterns labeled as class patterns are those that focus on class relationships.
  11. Example: 1. All episodes of
  12. Real mistakes made by beginners
  13. If u compile one class, then other one also have to be modified if it is a bi-directional association relationship.
  14. Structural Pattern
  15. Another gan of four pattern, also known as wrappers Structural Pattern