SlideShare a Scribd company logo
Design Pattern
Group Members:
Mian Muhammad Abdullah SP16-BCS-217
Muhammad Umar SP16-BCS-212
Muhammad Danish SP16-BCS-196
Design Pattern?
• Christopher Alexander defined a pattern as “a
solution to a problem in a context”
• “Each pattern describes a problem which
occurs over and over again in our environment
and then describes the core of the solution to
that problem, in such a way that you can use
this solution a million times over, without ever
doing it the same way twice.”
Components
Of Design
Pattern
• Name
• Purpose
• Way to accomplish and solve problem
• Constraints
Why study
Design
Patterns?
Because design patterns-
• Help reuse existing high quality solutions to
commonly occurring problems
• Improve individual and team learning
• Shift level of thinking to a high perspective
• Illustrate basic object-oriented principles
• Improves modifiability and maintainability of
the code
• Improve team communication and individual
learning
Book Store App Design
Pattern
• Problem 1
Use of search Bar and Filter in App:
Sometimes user have problem while
Searching from search bar in order to
resolve this problem we will define filter
option and vice versa.
• Problem 2
There is problem occur when user
Search wrong keyword but his/her
Required book is available in data base
In order to solve this problem we
Some pre define options:
• Use filter option
• Pop up open for wrong entry
• Guide use to enter correct keyword
• Problem 3
Problem 3 is most Important problem that is ignore by some brand website that is:
Allowing publisher to write content according to his/her Experience.
This problem de-rank app in google search because google ranking
depends on % of optimized content.
In order to solve this issue we follow some pre define rules and guide publisher about content while
writing title, description and author detail of Book. From this design pattern our content is well
managed and easily rank on google.
OLX.com.pk
Example
Types of
Design
Patterns
Creational:
Object
Instantiation
1
Behavioral:
Object
Behaviour
2
Structural:
Object
Structure
3
Structural
design
patterns
• These design patterns are all about Class and
Object composition. Structural class-creation
patterns use inheritance to compose interfaces.
Structural object-patterns define ways to
compose objects to obtain new functionality.
Examples
Adapter
Match interfaces of different classes
Bridge
Separates an object’s interface from its implementation
Composite
A tree structure of simple and composite objects
Decorator
Add responsibilities to objects dynamically
Facade
A single class that represents an entire subsystem
Flyweight
A fine-grained instance used for efficient sharing
Private Class Data
Restricts accessor/mutator access
Proxy
An object representing another object
Adapter Design
Pattern
Match interfaces of
different classes
• In software engineering, the adapter pattern is
a software design pattern that allows the
interface of an existing class to be used as
another interface. It is often used to make
existing classes work with others without
modifying their source code.
• Intent
• Convert the interface of a class into another
interface clients expect. Adapter lets classes
work together that couldn't otherwise
because of incompatible interfaces.
• Wrap an existing class with a new interface.
Bridge Design
Pattern
Separates an object’s
interface from its
implementation
• Decouple an abstraction from its
implementation so that the
two can vary independently
• Use the Bridge pattern when:
– you want run-time binding of the
implementation
– you want to share an implementation among
multiple
objects
Composite
Design Pattern
A tree structure of simple
and composite objects
• Compose objects into tree structures to
represent whole-part
hierarchies. Composite lets clients treat
individual objects and
compositions of objects uniformly
• Use this pattern whenever you have
"composites that contain
components, each of which could be a
composite".
Decorator
Add responsibilities to
objects dynamically
• Attach additional responsibilities to an object
dynamically
• Decorators provide a flexible alternative to sub-
classing for
extending functionality
Façade
A single class that
represents an entire
subsystem
• Provide a unified interface to a set of interfaces in a
subsystem
• Facade defines a higher-level interface that makes the
subsystem easier to use
• Create a class that is the interface to the subsystem
• Clients interface with the Facade class to deal with the
subsystem
• It hides the implementation of the subsystem from clients
• It promotes weak coupling between the subsystems and its
clients
• It does not prevent clients from using subsystems class,
should
it?
Flyweight
A fine-grained instance
used for efficient sharing
• Use sharing to support large numbers of fine-
grained objects
efficiently
• The pattern can be used when:
– The program uses a large number of objects
and
– The program does not use object identity (==)
Proxy
An object representing
another object
• Provide a surrogate or placeholder for another
object to
control access to it.
• The proxy has the same interface as the original
object
• Virtual Proxy:
– Creates/accesses expensive objects on demand
– You may wish to delay creating an expensive object
until it
is really accessed
– It may be too expensive to keep entire state of the
object in
memory at one time
Benefits of
Design
Patterns
Design patterns enable large-scale reuse
of software architectures and also help
document systems
Patterns help improve developer
communication.
Pattern names form a common
vocabulary
Patterns help ease the transition to
Object Oriented technology
Drawbacks of
Design
Patterns
Patterns do not lead to direct code reuse
Patterns are deceptively simple.
Teams may suffer from pattern overload
Patterns are validated by experience and
discussion rather than by automated testing
Integrating patterns is a human-intensive
activity.
Suggestions
for Effective
Use
Do not recast everything as a pattern
Do not
recast
Instead, develop strategic domain patterns and reuse
existing tactical patternsDevelop
Clearly document when patterns apply and do not applyDocument
Directly involve pattern authors with application
developers and domain experts.Involve

More Related Content

PPT
Structural patterns
PPTX
Design Pattern
PPTX
Design patterns creational patterns
PPT
Software Design Patterns
PPTX
Design Patterns - 01 Introduction and Decorator Pattern
PPTX
Design patterns
PPTX
Design pattern (Abstract Factory & Singleton)
PDF
Design Patterns - Factory Method & Abstract Factory
Structural patterns
Design Pattern
Design patterns creational patterns
Software Design Patterns
Design Patterns - 01 Introduction and Decorator Pattern
Design patterns
Design pattern (Abstract Factory & Singleton)
Design Patterns - Factory Method & Abstract Factory

What's hot (20)

PPTX
Design pattern and their application
PPTX
PPTX
Creational pattern
PPTX
Common ASP.NET Design Patterns - Telerik India DevCon 2013
PPT
Design Patterns (Examples in .NET)
PPTX
Design Pattern - Introduction
PPTX
Go f designpatterns 130116024923-phpapp02
PPTX
Gof design patterns
PPTX
Design Pattern lecture 2
PPT
Design patterns
PDF
Java Design Patterns Tutorial | Edureka
PDF
Gof Design Pattern
PDF
Factory Design Pattern
PDF
Decorator & Presenter Design Pattern
PDF
Solid principles, Design Patterns, and Domain Driven Design
PPTX
Factory Design Pattern
PPT
P Training Presentation
PPTX
Design Pattern - Factory Method Pattern
PPS
Jump start to OOP, OOAD, and Design Pattern
Design pattern and their application
Creational pattern
Common ASP.NET Design Patterns - Telerik India DevCon 2013
Design Patterns (Examples in .NET)
Design Pattern - Introduction
Go f designpatterns 130116024923-phpapp02
Gof design patterns
Design Pattern lecture 2
Design patterns
Java Design Patterns Tutorial | Edureka
Gof Design Pattern
Factory Design Pattern
Decorator & Presenter Design Pattern
Solid principles, Design Patterns, and Domain Driven Design
Factory Design Pattern
P Training Presentation
Design Pattern - Factory Method Pattern
Jump start to OOP, OOAD, and Design Pattern
Ad

Similar to Design patterns Structural (20)

PPTX
Cs 1023 lec 8 design pattern (week 2)
PPT
Chapter 4_Introduction to Patterns.ppt
PPT
Chapter 4_Introduction to Patterns.ppt
PPT
Software Design Patterns
PPT
Software Design Patterns
PPTX
Design patterns software re engineering lect 10
PPTX
Designpattern
PPTX
Patterns
PPTX
Design Patterns - General Introduction
PPTX
Design pattern of software words computer .pptx
PPTX
Oops design pattern_amitgupta
PDF
Module 2 design patterns-2
PPTX
JS Design patterns in Web technologies including oop techniques.pptx
PDF
Cse 6007 fall2012
PDF
10 Modeling Object and Classes.pdf Software
PPTX
UNIT IV DESIGN PATTERNS.pptx
PPTX
Design patterns
PPTX
Design patterns
PPTX
Creational Design Patterns.pptx
PPTX
Behavioral pattern By:-Priyanka Pradhan
Cs 1023 lec 8 design pattern (week 2)
Chapter 4_Introduction to Patterns.ppt
Chapter 4_Introduction to Patterns.ppt
Software Design Patterns
Software Design Patterns
Design patterns software re engineering lect 10
Designpattern
Patterns
Design Patterns - General Introduction
Design pattern of software words computer .pptx
Oops design pattern_amitgupta
Module 2 design patterns-2
JS Design patterns in Web technologies including oop techniques.pptx
Cse 6007 fall2012
10 Modeling Object and Classes.pdf Software
UNIT IV DESIGN PATTERNS.pptx
Design patterns
Design patterns
Creational Design Patterns.pptx
Behavioral pattern By:-Priyanka Pradhan
Ad

More from UMAR ALI (6)

PPTX
Bipolar Transistor
PPTX
Atheism in Pakistan
PPTX
Conjunction & Pronouns
PPTX
Diode Application
PPTX
Semiconductor Diodes Engineering Circuit Analysis
PPTX
Islamic cartoon
Bipolar Transistor
Atheism in Pakistan
Conjunction & Pronouns
Diode Application
Semiconductor Diodes Engineering Circuit Analysis
Islamic cartoon

Recently uploaded (20)

PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
top salesforce developer skills in 2025.pdf
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PDF
Understanding Forklifts - TECH EHS Solution
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PPTX
Operating system designcfffgfgggggggvggggggggg
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
PPTX
ai tools demonstartion for schools and inter college
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
top salesforce developer skills in 2025.pdf
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
Navsoft: AI-Powered Business Solutions & Custom Software Development
Understanding Forklifts - TECH EHS Solution
2025 Textile ERP Trends: SAP, Odoo & Oracle
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Operating system designcfffgfgggggggvggggggggg
CHAPTER 2 - PM Management and IT Context
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
ai tools demonstartion for schools and inter college
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Design an Analysis of Algorithms II-SECS-1021-03
PTS Company Brochure 2025 (1).pdf.......
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free

Design patterns Structural

  • 1. Design Pattern Group Members: Mian Muhammad Abdullah SP16-BCS-217 Muhammad Umar SP16-BCS-212 Muhammad Danish SP16-BCS-196
  • 2. Design Pattern? • Christopher Alexander defined a pattern as “a solution to a problem in a context” • “Each pattern describes a problem which occurs over and over again in our environment and then describes the core of the solution to that problem, in such a way that you can use this solution a million times over, without ever doing it the same way twice.”
  • 3. Components Of Design Pattern • Name • Purpose • Way to accomplish and solve problem • Constraints
  • 4. Why study Design Patterns? Because design patterns- • Help reuse existing high quality solutions to commonly occurring problems • Improve individual and team learning • Shift level of thinking to a high perspective • Illustrate basic object-oriented principles • Improves modifiability and maintainability of the code • Improve team communication and individual learning
  • 5. Book Store App Design Pattern • Problem 1 Use of search Bar and Filter in App: Sometimes user have problem while Searching from search bar in order to resolve this problem we will define filter option and vice versa.
  • 6. • Problem 2 There is problem occur when user Search wrong keyword but his/her Required book is available in data base In order to solve this problem we Some pre define options: • Use filter option • Pop up open for wrong entry • Guide use to enter correct keyword
  • 7. • Problem 3 Problem 3 is most Important problem that is ignore by some brand website that is: Allowing publisher to write content according to his/her Experience. This problem de-rank app in google search because google ranking depends on % of optimized content. In order to solve this issue we follow some pre define rules and guide publisher about content while writing title, description and author detail of Book. From this design pattern our content is well managed and easily rank on google.
  • 10. Structural design patterns • These design patterns are all about Class and Object composition. Structural class-creation patterns use inheritance to compose interfaces. Structural object-patterns define ways to compose objects to obtain new functionality.
  • 11. Examples Adapter Match interfaces of different classes Bridge Separates an object’s interface from its implementation Composite A tree structure of simple and composite objects Decorator Add responsibilities to objects dynamically Facade A single class that represents an entire subsystem Flyweight A fine-grained instance used for efficient sharing Private Class Data Restricts accessor/mutator access Proxy An object representing another object
  • 12. Adapter Design Pattern Match interfaces of different classes • In software engineering, the adapter pattern is a software design pattern that allows the interface of an existing class to be used as another interface. It is often used to make existing classes work with others without modifying their source code. • Intent • Convert the interface of a class into another interface clients expect. Adapter lets classes work together that couldn't otherwise because of incompatible interfaces. • Wrap an existing class with a new interface.
  • 13. Bridge Design Pattern Separates an object’s interface from its implementation • Decouple an abstraction from its implementation so that the two can vary independently • Use the Bridge pattern when: – you want run-time binding of the implementation – you want to share an implementation among multiple objects
  • 14. Composite Design Pattern A tree structure of simple and composite objects • Compose objects into tree structures to represent whole-part hierarchies. Composite lets clients treat individual objects and compositions of objects uniformly • Use this pattern whenever you have "composites that contain components, each of which could be a composite".
  • 15. Decorator Add responsibilities to objects dynamically • Attach additional responsibilities to an object dynamically • Decorators provide a flexible alternative to sub- classing for extending functionality
  • 16. Façade A single class that represents an entire subsystem • Provide a unified interface to a set of interfaces in a subsystem • Facade defines a higher-level interface that makes the subsystem easier to use • Create a class that is the interface to the subsystem • Clients interface with the Facade class to deal with the subsystem • It hides the implementation of the subsystem from clients • It promotes weak coupling between the subsystems and its clients • It does not prevent clients from using subsystems class, should it?
  • 17. Flyweight A fine-grained instance used for efficient sharing • Use sharing to support large numbers of fine- grained objects efficiently • The pattern can be used when: – The program uses a large number of objects and – The program does not use object identity (==)
  • 18. Proxy An object representing another object • Provide a surrogate or placeholder for another object to control access to it. • The proxy has the same interface as the original object • Virtual Proxy: – Creates/accesses expensive objects on demand – You may wish to delay creating an expensive object until it is really accessed – It may be too expensive to keep entire state of the object in memory at one time
  • 19. Benefits of Design Patterns Design patterns enable large-scale reuse of software architectures and also help document systems Patterns help improve developer communication. Pattern names form a common vocabulary Patterns help ease the transition to Object Oriented technology
  • 20. Drawbacks of Design Patterns Patterns do not lead to direct code reuse Patterns are deceptively simple. Teams may suffer from pattern overload Patterns are validated by experience and discussion rather than by automated testing Integrating patterns is a human-intensive activity.
  • 21. Suggestions for Effective Use Do not recast everything as a pattern Do not recast Instead, develop strategic domain patterns and reuse existing tactical patternsDevelop Clearly document when patterns apply and do not applyDocument Directly involve pattern authors with application developers and domain experts.Involve