Structural Design Patterns Flashcards
Provide definition of Adapter pattern
Pattern that allows objects with
incompatible interfaces to collaborate
Provide definition of Bridge pattern
Bridge is a structural design pattern that lets you split a large class or a set of closely related classes into two separate
hierarchies—abstraction and implementation—which can be
developed independently of each other
What means Abstraction in Bridge pattern
Abstraction (also called interface) is a high-level control layer for some entity. This layer isn’t supposed to do any real work
on its own. It should delegate the work to the implementation layer (also called platform).
What means Impelementation in Bridge pattern
An interface or abstract class defining the low-level operational methods. This acts as a base for the concrete implementation
Provide definition od Composite pattern
Composite is a structural design pattern that lets you compose objects into tree structures and then work with these structures as if they were individual objects
What principle can be violated by Composite pattern and why?
Interface Segregation Principle can violated when Composite definies the methods Add, Remove. They will be empty in the leaf
class. However, the client will be able to treat all the elements equally, even when composing the tree
Provide definition for Decorator pattern
Structural design pattern that lets you attach
new behaviors to objects by placing these objects inside special wrapper objects that contain the behaviors
What means that inheritance is static
You can’t alter the behavior of an existing
object at runtime. You can only replace the whole object with another one that’s created from a different subclass
Which pattern manages the life
cycle of its service object on its own
Proxy
Provide definition for Facade pattern
Structural design pattern that provides a simplified interface to a library, a framework, or any other complex set of
classes
Facade pattern maigh provide limited functionality
A facade might provide limited functionality in comparison to working
with the subsystem directly. However, it includes only those
features that clients really care about
What is the purpose of additional facade
An Additional Facade class can be created to prevent polluting a single facade with unrelated features that might make it yet
another complex structure. Additional facades can be used by
both clients and other facades
Provide a definition for Flyweight pattern
Structural design pattern that lets you fit more objects into the available amount of RAM by sharing common parts of state between multiple objects instead of keeping all of the data in each object
State of an object with constant data of which lives within the object; other objects can only read it, not change it.
Intrinsic state
The object’s state, often altered “from
the outside” by other objects, is called
Extrinsic state