Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "PATTERNS -STRUCTURAL PATTERNS WATTANAPON G SUTTAPAK Software Engineering, School of Information Communication Technology, University of PHAYAO 1."— Presentation transcript:

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

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

3 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

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

5 ADAPTER PATTERN

6 Interface class

7 ADAPTER PATTERN Implements AdvanceMediaPlayer

8 ADAPTER PATTERN Implements MediaPlayer

9 ADAPTER PATTERN demo adapter pattern 9 Result

10 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

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

12 BRIDGE PATTERN 12

13 BRIDGE PATTERN 13

14 BRIDGE PATTERN 14

15 BRIDGE PATTERN 15

16 BRIDGE PATTERN 16

17 BRIDGE PATTERN 17 Result

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

19 FILTER PATTERN 19

20 FILTER PATTERN 20

21 FILTER PATTERN 21

22 FILTER PATTERN 22

23 FILTER PATTERN 23

24 FILTER PATTERN 24

25 FILTER PATTERN 25

26 FILTER PATTERN 26

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

28 COMPOSITE PATTERN 28

29 COMPOSITE PATTERN 29 Result

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

31 DECORATOR PATTERN 31

32 DECORATOR PATTERN 32 Result

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

34 FACADE PATTERN 34

35 FACADE PATTERN 35 Result

36 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

37 FLYWEIGHT PATTERN 37

38 FLYWEIGHT PATTERN 38

39 FLYWEIGHT PATTERN 39

40 FLYWEIGHT PATTERN 40 Result

41 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

42 PROXY PATTERN 42 Result

43 PROXY PATTERN 43 Result


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

Similar presentations


Ads by Google