SlideShare a Scribd company logo
Design Pattern
Software Architecture
Pattern :
A common solution and the best practice to solve a reoccurring problem
Software developers
encountered many recurring
problems during software
development, after enhanced
and developed those
solutions, they documented
the steps and sequence to
solve those problems in
future, this solution called
software design pattern.
Design pattern is a how we can design relation
among classes and objects to solve a general and
repeatable problem in specific context ..
Design pattern :skip the complex hard work and jump
into straight design and plan your work to improve the
quality of the software and reduce development time and
cost .
Before start your design pattern you have to know that
OOP Basics :
Inheritance
Polymorphism
Encapsulation
Abstraction
OOP Principles :
Favor composition better than inheritance
Code in interface not an implementation
We can classify Design patterns into
Structural (the composition of classes or objects):
– Adapter, Bridge, Composite, Decorator, Façade, Proxy
Behavioral (object interactions):
– Interpreter, Iterator, Mediator,
Creational (object creation):
– Abstract Factory, Builder, Factory Method, Prototype, Singleton
UNIFIED MODELING LANGUAGE
(UML)
• Is an application modeling specification
• Is a language for specifying , Virtualizing and documenting the artifacts of
system.
• The primary objective of UML is to simplify the complex software
engineering process
• UML visualize and create artifacts of systems
• Its common language and standard tool to illustrate the design patterns
UML and Design pattern
Mark Visibility type
+ Public
# Protected
- Private
~ Package
Access Modifiers - Visibility
CLASS DIAGRAMS
UML Conventions
Inner Class
UML Conventions
Use Italic text for the
Abstract class and
methods
Inheritance
Generalization
UML Conventions
Interfaces
Realization
dotted Arrow
UML Conventions
Methods Throwing Exceptions
UML Conventions
Important definitions
•Subclass /child class / derived class:
•Super class/ parent class / Base class:
Relationships between Classes
- Inheritance (Generalization) IS A
- Association Has A
- Aggregation – sharing
- Composition – Non sharing
• Is-A relationship
• In Is-A relationship one class is obtaining the features of another class by
using inheritance concept with extends keywords.
• Man IS A Human (Man is extends for Human)
All public and protected Methods and attributes in Human will be in Man
• If you change method in Human will effect directly in Man
Relationships between Classes
• Has-A relationship
• In Has-A relationship an object of one class is created as data member in another
class the relationship between these two classes is Has-A.
• Man HAS A Relationships with others.
• There is an associations between the Man and the the other could be strong or
weak relationship .Maybe peer to peer relationship or Ownership relationship .
Relationships between Classes
Relationships
between
Classes
Car
Passenger Driver
EngineGas Station
Vehicle
Dependency
Is a relation between two classes, where one class depends on another class
So any change in classes may affect the functionality of the other dependent class.
For example Car and Gas Station, we have Car need to fill oil to start Engine , in this case, Car class is
dependent on the GasStation class. In the future, if any change are made to the GasStation class, it may
result in changes to the Car class.
Relationships between Classes
Association
• Association is a structural relationship between two classes where all objects have
their own lifecycle and there is no ownership.
• Let’s take an example of Car and Passenger relationship
Multiple Passengers can associate with a single Car and a single Passenger can
associate with multiple Cars , but there is no ownership between the objects and
both have their own lifecycle. Both can create and delete independently.
• Each Class contains reference to another Class , maybe one-to-one relationship or
one-to-many, many to many ..
Relationships between Classes
Aggregation
• Aggregation is a specialized form of Association where all objects have their own lifecycle,
but there is ownership and a child object cannot belong to another parent object.
• Let’s take an example of a Car and Driver Relationship . A single Car cannot belong to
multiple Drivers , but if Driver die , Car will not die , object will not be destroyed.
• We can sell car to another Driver to use it
• We can think of it as a “has-a” relationship or "whole/part" relationship.
• Driver can own many cars (Collection of cars).
Relationships between Classes
Composition
• Composition is a specialized form of Aggregation
• we can call this as a “death” relationship. It is a strong type of Aggregation. Child object
does not have their own lifecycle and if parent object deletes all child object will also be
deleted.
• Let’s take again an example of relationship between Car and Engine. Car HAS A Engine
but there is no independent life of a Engine and any Engine cannot belong to two different
Cars. If we delete the Car , the Engine will automatically be deleted
Relationships between Classes
Design pattern - part 1
Relationships between Classes

More Related Content

PPTX
Enhanced ER(database)
PPTX
Er model
PPT
E R Diagram
PPTX
Er diagrams presentation
PPT
Enhanced E-R diagram
PPT
DBMS UNIT1
PPTX
EER modeling
PPTX
ER DIAGRAM & ER MODELING IN DBMS
Enhanced ER(database)
Er model
E R Diagram
Er diagrams presentation
Enhanced E-R diagram
DBMS UNIT1
EER modeling
ER DIAGRAM & ER MODELING IN DBMS

What's hot (20)

PPTX
Entity Relationship Diagrams
PPT
Eer case study
PPTX
ER MODEL
PPSX
EER Model
PPTX
OO relationships between classes
PPTX
Er model ppt
PPTX
Entity Relationship Model
PPT
Ch 3 E R Model
PPT
Ch 4 E E R Biz Rules
PPTX
PDF
Enhanced Entity-Relationship (EER) Modeling
PPT
Entity Relationship Diagram
PPT
Object Oriented Relationships
PPT
Entity Relationship Diagram2
PPT
enhanced er diagram
PPTX
Database - Entity Relationship Diagram (ERD)
PPT
Ch 5 O O Data Modeling Class
PDF
Mapping ER and EER Model
PPT
Erd chapter 3
PPTX
Enhanced entity relationship model
Entity Relationship Diagrams
Eer case study
ER MODEL
EER Model
OO relationships between classes
Er model ppt
Entity Relationship Model
Ch 3 E R Model
Ch 4 E E R Biz Rules
Enhanced Entity-Relationship (EER) Modeling
Entity Relationship Diagram
Object Oriented Relationships
Entity Relationship Diagram2
enhanced er diagram
Database - Entity Relationship Diagram (ERD)
Ch 5 O O Data Modeling Class
Mapping ER and EER Model
Erd chapter 3
Enhanced entity relationship model
Ad

Similar to Design pattern - part 1 (20)

PPT
Chapter3
PPTX
Relationships and their representation in a class diagram.pptx
PPTX
Chapter 8 ooad
PDF
UML_Class_Diagram_Software_Engineering.pdf
PPTX
UML constructs
PPTX
FALLSEM2024-25_SWE2018_ETH_VL2024250103302_2024-10-04_Reference-Material-I.pptx
PPTX
Unified Modeling Language and Examples .pptx
PPT
Uml report
PDF
Software Testing and UML Lab
PPT
UML DIAGRAMS FOR IST SEMISTER OF BTECH STUDENTS
PPTX
Structural modeling and analysis
PPT
Uml - An Overview
PPT
08 class and sequence diagrams
PPTX
Chapter 6:Working with Classes and Their Relationships
PPTX
Lecture 06.pptxLecture 06.pptxLecture 06.pptx
PPT
UML-class_diagram.ppt diagrams ppt download
PPT
UML-class diagram for beginners to adance.ppt
PPT
cse 355 UML class diagram software engineering.ppt
PPT
UML-class_diagram.ppt
Chapter3
Relationships and their representation in a class diagram.pptx
Chapter 8 ooad
UML_Class_Diagram_Software_Engineering.pdf
UML constructs
FALLSEM2024-25_SWE2018_ETH_VL2024250103302_2024-10-04_Reference-Material-I.pptx
Unified Modeling Language and Examples .pptx
Uml report
Software Testing and UML Lab
UML DIAGRAMS FOR IST SEMISTER OF BTECH STUDENTS
Structural modeling and analysis
Uml - An Overview
08 class and sequence diagrams
Chapter 6:Working with Classes and Their Relationships
Lecture 06.pptxLecture 06.pptxLecture 06.pptx
UML-class_diagram.ppt diagrams ppt download
UML-class diagram for beginners to adance.ppt
cse 355 UML class diagram software engineering.ppt
UML-class_diagram.ppt
Ad

Recently uploaded (20)

PDF
Chinmaya Tiranga quiz Grand Finale.pdf
DOC
Soft-furnishing-By-Architect-A.F.M.Mohiuddin-Akhand.doc
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PPTX
GDM (1) (1).pptx small presentation for students
PDF
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
PPTX
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
Anesthesia in Laparoscopic Surgery in India
PPTX
202450812 BayCHI UCSC-SV 20250812 v17.pptx
PDF
Complications of Minimal Access Surgery at WLH
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PDF
Computing-Curriculum for Schools in Ghana
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PPTX
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
A systematic review of self-coping strategies used by university students to ...
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PDF
01-Introduction-to-Information-Management.pdf
PDF
Weekly quiz Compilation Jan -July 25.pdf
Chinmaya Tiranga quiz Grand Finale.pdf
Soft-furnishing-By-Architect-A.F.M.Mohiuddin-Akhand.doc
Microbial diseases, their pathogenesis and prophylaxis
GDM (1) (1).pptx small presentation for students
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
Supply Chain Operations Speaking Notes -ICLT Program
Anesthesia in Laparoscopic Surgery in India
202450812 BayCHI UCSC-SV 20250812 v17.pptx
Complications of Minimal Access Surgery at WLH
FourierSeries-QuestionsWithAnswers(Part-A).pdf
STATICS OF THE RIGID BODIES Hibbelers.pdf
Computing-Curriculum for Schools in Ghana
Final Presentation General Medicine 03-08-2024.pptx
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
A systematic review of self-coping strategies used by university students to ...
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
01-Introduction-to-Information-Management.pdf
Weekly quiz Compilation Jan -July 25.pdf

Design pattern - part 1

  • 2. Software Architecture Pattern : A common solution and the best practice to solve a reoccurring problem
  • 3. Software developers encountered many recurring problems during software development, after enhanced and developed those solutions, they documented the steps and sequence to solve those problems in future, this solution called software design pattern.
  • 4. Design pattern is a how we can design relation among classes and objects to solve a general and repeatable problem in specific context .. Design pattern :skip the complex hard work and jump into straight design and plan your work to improve the quality of the software and reduce development time and cost .
  • 5. Before start your design pattern you have to know that OOP Basics : Inheritance Polymorphism Encapsulation Abstraction OOP Principles : Favor composition better than inheritance Code in interface not an implementation
  • 6. We can classify Design patterns into Structural (the composition of classes or objects): – Adapter, Bridge, Composite, Decorator, Façade, Proxy Behavioral (object interactions): – Interpreter, Iterator, Mediator, Creational (object creation): – Abstract Factory, Builder, Factory Method, Prototype, Singleton
  • 7. UNIFIED MODELING LANGUAGE (UML) • Is an application modeling specification • Is a language for specifying , Virtualizing and documenting the artifacts of system. • The primary objective of UML is to simplify the complex software engineering process • UML visualize and create artifacts of systems • Its common language and standard tool to illustrate the design patterns
  • 8. UML and Design pattern
  • 9. Mark Visibility type + Public # Protected - Private ~ Package Access Modifiers - Visibility
  • 12. Use Italic text for the Abstract class and methods Inheritance Generalization UML Conventions
  • 15. Important definitions •Subclass /child class / derived class: •Super class/ parent class / Base class:
  • 16. Relationships between Classes - Inheritance (Generalization) IS A - Association Has A - Aggregation – sharing - Composition – Non sharing
  • 17. • Is-A relationship • In Is-A relationship one class is obtaining the features of another class by using inheritance concept with extends keywords. • Man IS A Human (Man is extends for Human) All public and protected Methods and attributes in Human will be in Man • If you change method in Human will effect directly in Man Relationships between Classes
  • 18. • Has-A relationship • In Has-A relationship an object of one class is created as data member in another class the relationship between these two classes is Has-A. • Man HAS A Relationships with others. • There is an associations between the Man and the the other could be strong or weak relationship .Maybe peer to peer relationship or Ownership relationship . Relationships between Classes
  • 21. Dependency Is a relation between two classes, where one class depends on another class So any change in classes may affect the functionality of the other dependent class. For example Car and Gas Station, we have Car need to fill oil to start Engine , in this case, Car class is dependent on the GasStation class. In the future, if any change are made to the GasStation class, it may result in changes to the Car class. Relationships between Classes
  • 22. Association • Association is a structural relationship between two classes where all objects have their own lifecycle and there is no ownership. • Let’s take an example of Car and Passenger relationship Multiple Passengers can associate with a single Car and a single Passenger can associate with multiple Cars , but there is no ownership between the objects and both have their own lifecycle. Both can create and delete independently. • Each Class contains reference to another Class , maybe one-to-one relationship or one-to-many, many to many .. Relationships between Classes
  • 23. Aggregation • Aggregation is a specialized form of Association where all objects have their own lifecycle, but there is ownership and a child object cannot belong to another parent object. • Let’s take an example of a Car and Driver Relationship . A single Car cannot belong to multiple Drivers , but if Driver die , Car will not die , object will not be destroyed. • We can sell car to another Driver to use it • We can think of it as a “has-a” relationship or "whole/part" relationship. • Driver can own many cars (Collection of cars). Relationships between Classes
  • 24. Composition • Composition is a specialized form of Aggregation • we can call this as a “death” relationship. It is a strong type of Aggregation. Child object does not have their own lifecycle and if parent object deletes all child object will also be deleted. • Let’s take again an example of relationship between Car and Engine. Car HAS A Engine but there is no independent life of a Engine and any Engine cannot belong to two different Cars. If we delete the Car , the Engine will automatically be deleted Relationships between Classes