Week 4 Flashcards
What are the advantages of object oriented design?
Can save effort - reuse generalised components
Can improve quality - modularity, loosely coupled subsystems
What are the 3 components of an object?
State
Behaviour
Identity
In OOP, __________ are the primary means of abstraction.
Objects
What is information hiding?
Only an object’s Interface is visible to other objects
Inheritance is how object oriented languages implement
generalisation/specialisation
What is inheritance?
When the whole description of a superclass applies to all its subclasses
‘implements’ is how java implements
Subtyping
‘extends’ is how java implements
Subclassing
What is the difference between subtyping and subclassing?
Subtypes support all the operations on the supertype
Subclassing reuse the code of the superclass and can add extra methods
What is generalisation?
is-kind-of
Superclass is a generalization of subclass
e.g. Teacher is a kind of Person
Subtyping is also known as an _______ relationship
is-a
What does polymorphism allow?
One message to be sent to multiple objects of different classes
What are 3 kinds of polymorphism?
Overloading
Dynamic Binding
Genericity
What is overloading?
Method of the same name is defined for different argument types
What is dynamic binding?
When a message is dispatched, the method that is invoked is chosen according to the type of the object (i.e. at runtime).
What is genericity?
A mechanism allowing type-safe programming using generic classes
Templates are a form of
genericity
What is the purpose of analysis when making models?
Understanding the problem
What is the purpose of design when making models?
Understanding the solution
What is an analysis pattern?
Group of concepts representing a common construction in business modeling relevant to one or more domains
What is a type diagram?
Structral view of a system
describes the types of objects and their relationships
What notation are type diagrams based on?
Odell’s notation
NOT UML
What is a complete partition, in type diagrams?
all instances of supertype must be instances of either subtype
What is an incomplete partition in type diagrams?
instances of supertype can be instances of either subtype or neither
When multiple attributes interact with behaviour that might be used in several types, you should
combine the attributes into a new fundamental type