Object Oriented Methodology Flashcards
Classes
Key abstractions of the system that define the attributes and behaviour of system objects, along with their relationships and interactions.
Objects
Instances of classes that exist during execution of the software
Classes -
Benefits
- Allows us to describe complex systems through meaningful abstractions
- Support difficult level views of the system including conceptual and implementation levels
- Allow all project members to have a shared understanding of the system
Encapsulation
Mechanism for defining the functionality necessary for objects to be used and hiding details of how this is implemented
Abstractions
Generalizations that define key characteristics and behaviour of objects
Inheritance
Relationship between classes where one (the subclass) extends the data and behaviour of another (the superclass)
Polymorphism
Mechanism for treating similar objects in the same way, and allowing the same action to possibly be performed in different ways.
Encapsulation - Benefits
- Allows to minimize the effect of changing certain parts of the system on the overall system (extendibility of the system)
Decorator
- A ‘Decorator’ pattern provides a way of adding optional functionality (“decoration”) to all classes in a hierarchy without changing the code for either the base class or any of the subclasses.
- Using this pattern, multiple decorators can be applied to an object (e.g. attaching a picture frame and scrollbars to a picture in the drawing editor). If there are several different kinds of decoration, we want to be able to use, we can derive multiple classes from the Decorator class to handle these separate kinds of added functionality.
Class Diagram
A class diagram is a representation of the different classes that exist within a particular system, their properties and behaviour, interactions, and relationships. This diagram does not however describe the typical flow of operations, which can be summarized using a Sequence diagram.
Refactoring
Rewriting, reworking, and re-architecting the software to make it easier to maintain, perform more robustly and/or faster without changing its external behaviour. Easier to maintain means the code is easier to read (understand) and adapt to new requirements (extensibility).
Design Patterns -
Composite v Decorator
Although structurally somewhat similar, the intent is different. Composite allows to treat a composite (group of) leaves in the same way as a leaf. Decorator gives additional feature to a leaf and allows to treat “decorated” leaf in the same way as any other leaf.