Lecture 6 Flashcards
What is a sequence model?
It shows the sequence of object interactions.
What are the three types of arrows?
- Solid arrow, filled head: synchronous messages
- Solid arrow, stick head: asynchronous messages
- Dotted arrow, stick head return message
What are the three object-oriented relationships?
- Uses
- Has-a
- Is-a
What is a ‘uses’ relationship?
Needed to accomplish work, but not “part of” the object itself
What is a ‘has-a’ relationship?
• Composing a system from smaller systems
What is a ‘is-a’ relationship?
- Manifested in inheritance
* Derived types inherit behaviour and attributes from more basic types
What are three guidelines for OOP?
• "Program to an 'interface', not an 'implementation'." • "Favour 'object composition' over 'class inheritance'." • Loose coupling through “acquaintance” (Uses) can lead to easier maintainability than stronger coupling through “aggregation” (Has A).
What are creational patterns?
Patterns typify methods of instantiating objects
What are structural pattrens?
Structural patterns typify ways of organizing and combining objects – concerned with increasing flexibility through class and object composition
What are behavioural patterns?
Behavioural patterns typify inter-object communication –concerned with fundamental object services/actions and details of their provision
What is a singleton pattern?
Ensure a class has only one instance, and provide a global point of access to it.
Static instantiation.
What is the observer pattern?
Define a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically. EventListener in Vaadin.
What is the factory pattern?
Subclass Creator to provide specific implementation of creation method Subclass decides what to instantiate
What is the proxy pattern?
Provide a surrogate or placeholder for another object to control access to it.
4 types: virtual, remote, protective, smart