PATTERNS -STRUCTURAL PATTERNS WATTANAPON G SUTTAPAK Software Engineering, School of Information Communication Technology, University of PHAYAO 1.

Slides:



Advertisements
Similar presentations
CS 350 – Software Design The Bridge Pattern – Chapter 10 Most powerful pattern so far. Gang of Four Definition: Decouple an abstraction from its implementation.
Advertisements

1 Structural Design Patterns - Neeraj Ray. 2 Structural Patterns - Overview n Adapter n Bridge n Composite n Decorator.
C15: Design Patterns Gamma,Helm,Johnson,Vlissides (GOF)
DESIGN PATTERNS OZGUR RAHMI DONMEZ.
Patterns Reusable solutions to common object-oriented programming problems When given a programming problem, re-use an existing solution. Gang of Four.
Bridge The decoupling of abstraction and implementation.
(c) 2009 University of California, Irvine – André van der Hoek1June 13, 2015 – 21:42:16 Informatics 122 Software Design II Lecture 8 André van der Hoek.
Design Patterns CS is not simply about programming
Chapter 8, Object Design Introduction to Design Patterns
Design Patterns. What are design patterns? A general reusable solution to a commonly occurring problem. A description or template for how to solve a problem.
Chapter 8 Object Design Reuse and Patterns. Finding Objects The hardest problems in object-oriented system development are: –Identifying objects –Decomposing.
Design Pattern – Bridge (Structural) References Yih-shoung Chen, Department of Information Engineering, Feng Chia University,Taiwan, R.O.C. The Bridge.
Design Patterns Module Name - Object Oriented Modeling By Archana Munnangi S R Kumar Utkarsh Batwal ( ) ( ) ( )
Chapter 22 Object-Oriented Design
PRESENTED BY SANGEETA MEHTA EECS810 UNIVERSITY OF KANSAS OCTOBER 2008 Design Patterns.
Katie C. O’Shea Dennis T. Tillman 11 February 2K2 Flyweight.
CERN – European Organization for Nuclear Research GS Department – Administrative Information Services Design Patterns in Groovy Nicolas Décrevel Advanced.
Software Waterfall Life Cycle Requirements Construction Design Testing Delivery and Installation Operations and Maintenance Concept Exploration Prototype.
ADAPTER PATTERN BY Sravanthi Karumanchi. Structure Pattern Structure patterns are concerned with how classes and objects are composed to form large structures.
CS 325: Software Engineering March 17, 2015 Applying Patterns (Part A) The Façade Pattern The Adapter Pattern Interfaces & Implementations The Strategy.
Advanced Programming Rabie A. Ramadan 7.
Design Patterns: Structural Design Patterns
Software Engineering 1 Object-oriented Analysis and Design Applying UML and Patterns An Introduction to Object-oriented Analysis and Design and Iterative.
Design Patterns CSCI 5801: Software Engineering. Design Patterns.
18 April 2005CSci 210 Spring Design Patterns 1 CSci 210.
Software Design Patterns (1) Introduction. patterns do … & do not … Patterns do... provide common vocabulary provide “shorthand” for effectively communicating.
Object Oriented Software Engineering Chapter 16 and 17 review 2014/06/03.
GoF: Document Editor Example Rebecca Miller-Webster.
SDP Structural Pattern. SDP-2 Structural Patterns Concerned with how classes and objects are composed to form large structures Class Patterns use.
Structural Design Patterns
Creational Patterns
Design Patterns Structural Patterns. Adapter Convert the interface of a class into another interface clients expect Adapter lets classes work together.
Proxy, Observer, Symbolic Links Rebecca Chernoff.
08 - StructuralCSC4071 Structural Patterns concerned with how classes and objects are composed to form larger structures –Adapter interface converter Bridge.
Structural Patterns1 Nour El Kadri SEG 3202 Software Design and Architecture Notes based on U of T Design Patterns class.
DESIGN PATTERNS -BEHAVIORAL PATTERNS WATTANAPON G SUTTAPAK Software Engineering, School of Information Communication Technology, University of PHAYAO 1.
Proxy.
DESIGN PATTERNS COMMONLY USED PATTERNS What is a design pattern ? Defining certain rules to tackle a particular kind of problem in software development.
Behavioral Patterns CSE301 University of Sunderland Harry R Erwin, PhD.
Software Design Patterns Curtsy: Fahad Hassan (TxLabs)
Design Patterns. 1 Paradigm4 Concepts 9 Principles23 Patterns.
DESIGN PATTERNS -CREATIONAL PATTERNS WATTANAPON G SUTTAPAK Software Engineering, School of Information Communication Technology, University of PHAYAO 1.
Using Software Design Patterns Bill Anderson. About me Fox developer since 1987 Fox developer since 1987 Program Director, Los Angeles Visual Foxpro Developers.
Bridge Bridge is used when we need to decouple an abstraction from its implementation so that the two can vary independently. This type of design pattern.
Watching the movie the hard way…. Page 256 – Head First Design Patterns.
CS 210 Proxy Pattern Nov 16 th, RMI – A quick review A simple, easy to understand tutorial is located here:
Design Patterns: Structural Design Patterns General and reusable solutions to common problems in software design Software University
Chapter Ten The Bridge Pattern Ku-Yaw Chang Assistant Professor, Department of Computer Science and Information Engineering Da-Yeh.
Structural Patterns C h a p t e r 4 – P a g e 55 StructuralPatterns Design patterns that describe how classes and objects can be combined to form larger.
Describe ways to assemble objects to implement a new functionality
Chapter 10 Design Patterns.
Chapter 5:Design Patterns
MPCS – Advanced java Programming
Common Design Patterns
Design Patterns Lecture part 2.
Introduction to Design Patterns
Adapter Design Pattern
Chapter 8, Design Patterns Bridge
object oriented Principles of software design
Chapter 8, Object Design Introduction to Design Patterns
Design Patterns אליהו חלסצ'י תכנות מתקדם תרגול מספר 10
BRIDGE PATTERN.
Structural Patterns: Adapter and Bridge
Adapter Design Pattern
DESIGN PATTERNS : Adapter Pattern
10. Façade Pattern SE2811 Software Component Design
Informatics 122 Software Design II
Decorator Pattern.
Chapter 8, DesignPatterns Facade
GoF Patterns Ch. 26.
Presentation transcript:

PATTERNS -STRUCTURAL PATTERNS WATTANAPON G SUTTAPAK Software Engineering, School of Information Communication Technology, University of PHAYAO 1

จุดประสงค์การเรียนรู้  เข้าใจรูปแบบของแบบรูปการออกแบบทั้ง 8 ประเภท  ประยุกต์ใช้แบบรูปการออกแบบทั้ง 8 ประเภทได้ 2

STRUCTURAL PATTERNS These patterns concern class and object composition Concept of inheritance is used to compose interfaces and define ways to compose objects to obtain new functionalities 1.Adapter 2.Bridge 3.Filter(new) 4.Composite 5.Decorator 6.Façade 7.Flyweight 8.Proxy

ADAPTER PATTERN works as a bridge between two incompatible interfaces. A real life example, card reader(adapter) read memory(object) to laptop(object)

ADAPTER PATTERN

Interface class

ADAPTER PATTERN Implements AdvanceMediaPlayer

ADAPTER PATTERN Implements MediaPlayer

ADAPTER PATTERN demo adapter pattern 9 Result

BRIDGE PATTERN decouple an abstraction from its implementation the two can vary independently. decouples implementation class and abstract class by providing a bridge structure between them. This pattern involves an interface as a bridge functionality of concrete classes independent from interface implementer classes. demonstrating use of Bridge pattern via following example in which a circle can be drawn in different colors using same abstract class method but different bridge implementer classes. 10

BRIDGE PATTERN 11 Shape Square,Triangle, … check duplicate pattern Color Red, Blue, … Shape and Color

BRIDGE PATTERN 12

BRIDGE PATTERN 13

BRIDGE PATTERN 14

BRIDGE PATTERN 15

BRIDGE PATTERN 16

BRIDGE PATTERN 17 Result

FILTER PATTERN filter a set of objects using different criteria combining multiple criteria to obtain single criteria. 18

FILTER PATTERN 19

FILTER PATTERN 20

FILTER PATTERN 21

FILTER PATTERN 22

FILTER PATTERN 23

FILTER PATTERN 24

FILTER PATTERN 25

FILTER PATTERN 26

COMPOSITE PATTERN group of objects in similar way as a single object 27

COMPOSITE PATTERN 28

COMPOSITE PATTERN 29 Result

DECORATOR PATTERN 30 add new properties to existing object without altering structure

DECORATOR PATTERN 31

DECORATOR PATTERN 32 Result

FACADE PATTERN 33 hiding the complexities of the system the client can access the system via interface

FACADE PATTERN 34

FACADE PATTERN 35 Result

FLYWEIGHT PATTERN primary pattern for reduce the number of objects created decrease memory footprint and increase performance demonstrate this pattern by drawing 20 circle of different locations but we'll creating only 5 objects. Only 5 colors are available so color property is used to check already existing Circle objects. 36

FLYWEIGHT PATTERN 37

FLYWEIGHT PATTERN 38

FLYWEIGHT PATTERN 39

FLYWEIGHT PATTERN 40 Result

PROXY PATTERN a class represents functionality of another class In Proxy pattern, we create object having original object to interface its functionality to outer world. 41

PROXY PATTERN 42 Result

PROXY PATTERN 43 Result