PATTERNS
Weight 2%
Problem 1. Complete traversals of binary tree structures are commonly used for such varied purposes as arithmetic expression interpretation (e.g., infix and postfix), graphical hidden surface determination (e.g., BSP trees), and sorting algorithms (e.g., binary insertion trees). In view of the recursive nature of the binary tree structure, identify which design pattern lends itself to binary tree traversal. Include a UML diagram illustrating this application of the identified design pattern.
Problem 2. You are porting an application to a different platform. One component of the application is called LegacyShapes. Unfortunately, LegacyShapes uses a low level graphics API that is not available on the new platform. A different low-level graphics capability is available with similar functionality, but a different API. What design pattern is suggested? Include a UML diagram illustrating this application of the identified design pattern.
Problem 3. You are developing a graphics editor, within which a shape can be basic or complex. An example of a simple shape is a line object; an example of complex shape is a rectangle object. The rectangle object consists of four line objects. Because all shapes have many common operations and can be represented in hierarchy, you wish to treat all shapes uniformly. What design pattern is suggested? Include a UML diagram illustrating this application of the identified design pattern.
Problem 4. The Bridge, Adaptor and Façade patterns superficially appear to be similar. What is the distinction between them?
To answer these questions you may consult the resource given here: https://sourcemaking.com/design_patterns