3.3.1.2 Design. Flashcards
Outline the design patterns.
Creational
Structural
Behavioural
Define Creational design patterns.
Provide solutions to instantiate an object in the best way possible for specific situations.
Outline an example of a Creational design pattern.
Singleton Pattern:
Restricts the instantiation of a class and ensures that only one instance of the class exists in the java virtual machine.
Define Structural design patterns
Structural patterns provide different ways to create a class structure, for example using inheritance and composition to create a large object from small objects.
Outline an example of the Structural design pattern.
Adapter pattern:
Used so that two unrelated interfaces can work together. The object that joins these unrelated interfaces is called an adapter. Think of a mobile charger, working as an adapter between the charging socket and the wall socket.
Define Behavioural design patterns.
Provide a solution for the better interaction between objects and how to provide lose coupling and flexibility to extend easily.
When implementing design, what must we be aware of?
That before constructing a solution, the solution should be designed and specified, for example planning data structures for the data model, designing algorithms, designing an appropriate modular structure for the solution and designing the human user interface.