SlideShare a Scribd company logo
Lecture 07
Software Design
Patterns
Software Design &
Architecture
Patterns and Software Design Patterns
• Design Patterns
• Uses of Design Patterns
• Types of Software Design Pattern
1. Creational Design Patterns
2. Structural Design Patterns
3. Behavioral Design Patterns
2
Design Pattern
Design patterns are evolved as reusable solutions to the problems
that we encounter everyday of programming.
3
Uses of Design
Pattern
1. Speed up the development/implementation process (To
support reuse in design and boost confidence in software
systems.)  Reuse Solution
2. To provide a common vocabulary for software designers to
communicate their designs  Shared Vocabulary
4
Uses of Design
Pattern
3. Design patterns provide you not with
code reuse but with experience reuse
– Knowing concepts such as abstraction, inheritance and
polymorphism will NOT make you a good designer, unless you
use those concepts to create flexible designs that are
maintainable and that can cope with change
5
What is a
Pattern
?
“A pattern describes a problem that occurs often, along with
a tried solution to the problem”
- Christopher Alexander, 1977
6
What is a Design
Pattern
?
• Design patterns are descriptions of communicating objects
and classes that are customized to solve a general design
problem in a particular context.
• A design
7
pattern isn't a finished design that can
be
transformed directly into code. It is a description or template
for how to solve a problem that can be used in many
different situations.
Elements of Design Pattern
• In general, a pattern has four essential elements:
1. Pattern Name- Useful part of software design
2. Problem- When to apply the pattern
3. Solution- Elements that make up the pattern,
their relationships, responsibilities, and collaborations.
4. Consequences- Results and trade-offs of applying the pattern
8
Types of Design Patterns
1. Creational patterns
– Creating a collection of objects in flexible ways
2. Structural patterns
– Representing a collection of related objects
3. Behavioral patterns
– Capturing behavior among a collection of
objects.
9
Creational Design Pattern
• In software engineering, creational design patterns are design
patterns that deal with object creation mechanisms, trying to
create objects in a manner suitable to the situation.
• The basic form of object creation could result in design
problems or added complexity to the design. Creational design
patterns solve this problem by somehow controlling this
object creation
10
Creational Design Pattern
• Factory
• Singleton
• Abstract Factory
• Prototype
11
Factory: Creational Design Pattern
• Design Purpose
Create individual objects in situations where the
constructor alone is inadequate.
• Design Pattern Summary
Use methods to return required objects.
In class-based programming, the factory method pattern is a
creational pattern that uses factory methods to deal with the problem of
creating objects without having to specify the exact class of the object
that will be created.
12
Factory: Example
• Motive: Use Factory when a base class object is required but
the subclass to which it belongs is not known until runtime.
13
Creational Design Pattern (Cont...)
14
Creational Design Pattern (Cont...)
15
Creational Design Pattern (Cont...)
16
Creational Design Pattern (Cont...)
17
Creational Design Pattern (Cont...)
• Factory
• Singleton
• Abstract Factory
• Prototype
18
Singleton Design Pattern
•
Design Purpose
Ensure a class (e.g S) has only one instance , and provide a
global point of access to it
.
•
Design Pattern Summary
Make the constructor of S private; define a private static
attribute for Singleton class of type S; define a public accessor
for it
.
19
Singleton: Class Model
20
The Singleton Design Pattern Applied to
MyClass: 3 Steps
1. Define a private static member variable of MyClass of type
MyClass
private static MyClass singletonOfMyClass = new MyClass();
2. Make the constructor of MyClass private
private MyClass() { /* ….constructor code …. */ };
3. Define a public static method to access the member
public static MyClass getSingletonOfMyClass()
{
return singletonOfMyClass;
}
21
Creational Design Pattern (Cont...)
• Factory
• Singleton
• Abstract Factory
• Prototype
22

More Related Content

PPTX
Design pattern
PPTX
OOPSDesign PPT ( introduction to opps and design (
PPTX
Designpattern
PPTX
Creational Design Patterns.pptx
PDF
Why Design Patterns Are Important In Software Engineering
PDF
Module 2 design patterns-2
PPTX
sample Pattern Design explaine .pptx
PPT
Unit 2-Design Patterns.ppt
Design pattern
OOPSDesign PPT ( introduction to opps and design (
Designpattern
Creational Design Patterns.pptx
Why Design Patterns Are Important In Software Engineering
Module 2 design patterns-2
sample Pattern Design explaine .pptx
Unit 2-Design Patterns.ppt

Similar to Lecture-7.pptx software design and Arthitechure (20)

PPTX
Software Architecture and Design Patterns Notes.pptx
PPT
Design Pattern For C# Part 1
PPT
Design pattern & categories
PDF
Enhancing Software Development Efficiency: The Role of Design Patterns in Cod...
PPTX
Design Pattern - Introduction
PPTX
PPT
Design patterns
PPT
CS6201 Software Reuse - Design Patterns
PDF
Introduction to Design Pattern
PPTX
Design patterns Structural
PPTX
Design Patterns- Course for students .pptx
PPTX
Cs 1023 lec 9 design pattern (week 2)
PPTX
Design Pattern in Software Engineering
PPT
Oops design pattern intro
PPTX
Software Patterns
PPTX
Final sdp ppt
PDF
Benefits of using software design patterns and when to use design pattern
PDF
Design Patterns Java programming language.pdf
PPTX
Factory Design Pattern
PPTX
PATTERNS02 - Creational Design Patterns
Software Architecture and Design Patterns Notes.pptx
Design Pattern For C# Part 1
Design pattern & categories
Enhancing Software Development Efficiency: The Role of Design Patterns in Cod...
Design Pattern - Introduction
Design patterns
CS6201 Software Reuse - Design Patterns
Introduction to Design Pattern
Design patterns Structural
Design Patterns- Course for students .pptx
Cs 1023 lec 9 design pattern (week 2)
Design Pattern in Software Engineering
Oops design pattern intro
Software Patterns
Final sdp ppt
Benefits of using software design patterns and when to use design pattern
Design Patterns Java programming language.pdf
Factory Design Pattern
PATTERNS02 - Creational Design Patterns
Ad

More from MuhammadAbubakar114879 (20)

PPT
Lecture 11.pptHuman Computer Interaction
PPT
3 only package diagram till slide no. 13.ppt
PPT
4 Activity & Statechart diagram.ppt4 Activity & Statechart diagram.ppt4 Activ...
PPT
6 Design Pattern.ppt design pattern in softeare engineering
PPTX
9 Component Based SE.pptx9 Component Based SE.pptx9 Component Based SE.pptx
PPTX
8 SOA.pptx soa ppt in software engineering
PPTX
7 SPL.pptx spl ppt in software engineering
PPT
Lect_07_Use Case Diagram.ppt use case diagram
PPTX
Lab4-Software-Construction-BSSE5.pptx ppt
PPTX
Lecture3 - Methodologies - Software-Construction-BSSE5 (1).pptx
PPTX
design_pattern.pptx design_pattern design_pattern
PPTX
10- Architectureign Design_designnn.pptx
PPTX
13- Architecture Evaluations_design.pptx
PPTX
5-Oject Design & Mapping on Code__ .pptx
PPTX
6-User Interface Design_6-User Interface Design.pptx
PPTX
3-System Design_software_design_algo .pptx
PPTX
Sequence_Diagram_software_Design_algo.pptx
PPTX
lec 14-15 Jquery_All About J-query_.pptx
PPTX
Natural_language_processingusing python.pptx
PPTX
SPM presentation extra material-Lect 9and 10.pptx
Lecture 11.pptHuman Computer Interaction
3 only package diagram till slide no. 13.ppt
4 Activity & Statechart diagram.ppt4 Activity & Statechart diagram.ppt4 Activ...
6 Design Pattern.ppt design pattern in softeare engineering
9 Component Based SE.pptx9 Component Based SE.pptx9 Component Based SE.pptx
8 SOA.pptx soa ppt in software engineering
7 SPL.pptx spl ppt in software engineering
Lect_07_Use Case Diagram.ppt use case diagram
Lab4-Software-Construction-BSSE5.pptx ppt
Lecture3 - Methodologies - Software-Construction-BSSE5 (1).pptx
design_pattern.pptx design_pattern design_pattern
10- Architectureign Design_designnn.pptx
13- Architecture Evaluations_design.pptx
5-Oject Design & Mapping on Code__ .pptx
6-User Interface Design_6-User Interface Design.pptx
3-System Design_software_design_algo .pptx
Sequence_Diagram_software_Design_algo.pptx
lec 14-15 Jquery_All About J-query_.pptx
Natural_language_processingusing python.pptx
SPM presentation extra material-Lect 9and 10.pptx
Ad

Recently uploaded (20)

PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PDF
Insiders guide to clinical Medicine.pdf
PDF
Pre independence Education in Inndia.pdf
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
Mark Klimek Lecture Notes_240423 revision books _173037.pdf
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
TR - Agricultural Crops Production NC III.pdf
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PDF
RMMM.pdf make it easy to upload and study
PDF
Business Ethics Teaching Materials for college
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
Anesthesia in Laparoscopic Surgery in India
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PPTX
master seminar digital applications in india
Renaissance Architecture: A Journey from Faith to Humanism
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
Insiders guide to clinical Medicine.pdf
Pre independence Education in Inndia.pdf
Microbial diseases, their pathogenesis and prophylaxis
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Mark Klimek Lecture Notes_240423 revision books _173037.pdf
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
TR - Agricultural Crops Production NC III.pdf
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
RMMM.pdf make it easy to upload and study
Business Ethics Teaching Materials for college
human mycosis Human fungal infections are called human mycosis..pptx
Anesthesia in Laparoscopic Surgery in India
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
master seminar digital applications in india

Lecture-7.pptx software design and Arthitechure

  • 2. Patterns and Software Design Patterns • Design Patterns • Uses of Design Patterns • Types of Software Design Pattern 1. Creational Design Patterns 2. Structural Design Patterns 3. Behavioral Design Patterns 2
  • 3. Design Pattern Design patterns are evolved as reusable solutions to the problems that we encounter everyday of programming. 3
  • 4. Uses of Design Pattern 1. Speed up the development/implementation process (To support reuse in design and boost confidence in software systems.)  Reuse Solution 2. To provide a common vocabulary for software designers to communicate their designs  Shared Vocabulary 4
  • 5. Uses of Design Pattern 3. Design patterns provide you not with code reuse but with experience reuse – Knowing concepts such as abstraction, inheritance and polymorphism will NOT make you a good designer, unless you use those concepts to create flexible designs that are maintainable and that can cope with change 5
  • 6. What is a Pattern ? “A pattern describes a problem that occurs often, along with a tried solution to the problem” - Christopher Alexander, 1977 6
  • 7. What is a Design Pattern ? • Design patterns are descriptions of communicating objects and classes that are customized to solve a general design problem in a particular context. • A design 7 pattern isn't a finished design that can be transformed directly into code. It is a description or template for how to solve a problem that can be used in many different situations.
  • 8. Elements of Design Pattern • In general, a pattern has four essential elements: 1. Pattern Name- Useful part of software design 2. Problem- When to apply the pattern 3. Solution- Elements that make up the pattern, their relationships, responsibilities, and collaborations. 4. Consequences- Results and trade-offs of applying the pattern 8
  • 9. Types of Design Patterns 1. Creational patterns – Creating a collection of objects in flexible ways 2. Structural patterns – Representing a collection of related objects 3. Behavioral patterns – Capturing behavior among a collection of objects. 9
  • 10. Creational Design Pattern • In software engineering, creational design patterns are design patterns that deal with object creation mechanisms, trying to create objects in a manner suitable to the situation. • The basic form of object creation could result in design problems or added complexity to the design. Creational design patterns solve this problem by somehow controlling this object creation 10
  • 11. Creational Design Pattern • Factory • Singleton • Abstract Factory • Prototype 11
  • 12. Factory: Creational Design Pattern • Design Purpose Create individual objects in situations where the constructor alone is inadequate. • Design Pattern Summary Use methods to return required objects. In class-based programming, the factory method pattern is a creational pattern that uses factory methods to deal with the problem of creating objects without having to specify the exact class of the object that will be created. 12
  • 13. Factory: Example • Motive: Use Factory when a base class object is required but the subclass to which it belongs is not known until runtime. 13
  • 18. Creational Design Pattern (Cont...) • Factory • Singleton • Abstract Factory • Prototype 18
  • 19. Singleton Design Pattern • Design Purpose Ensure a class (e.g S) has only one instance , and provide a global point of access to it . • Design Pattern Summary Make the constructor of S private; define a private static attribute for Singleton class of type S; define a public accessor for it . 19
  • 21. The Singleton Design Pattern Applied to MyClass: 3 Steps 1. Define a private static member variable of MyClass of type MyClass private static MyClass singletonOfMyClass = new MyClass(); 2. Make the constructor of MyClass private private MyClass() { /* ….constructor code …. */ }; 3. Define a public static method to access the member public static MyClass getSingletonOfMyClass() { return singletonOfMyClass; } 21
  • 22. Creational Design Pattern (Cont...) • Factory • Singleton • Abstract Factory • Prototype 22

Editor's Notes

  • #19: Static Data member: every object share the same value of an object. Static class can have only static members.