Week 4 Flashcards

1
Q

What are the advantages of object oriented design?

A

Can save effort - reuse generalised components

Can improve quality - modularity, loosely coupled subsystems

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the 3 components of an object?

A

State

Behaviour

Identity

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

In OOP, __________ are the primary means of abstraction.

A

Objects

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is information hiding?

A

Only an object’s Interface is visible to other objects

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Inheritance is how object oriented languages implement

A

generalisation/specialisation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is inheritance?

A

When the whole description of a superclass applies to all its subclasses

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

‘implements’ is how java implements

A

Subtyping

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

‘extends’ is how java implements

A

Subclassing

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the difference between subtyping and subclassing?

A

Subtypes support all the operations on the supertype

Subclassing reuse the code of the superclass and can add extra methods

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is generalisation?

A

is-kind-of

Superclass is a generalization of subclass

e.g. Teacher is a kind of Person

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Subtyping is also known as an _______ relationship

A

is-a

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What does polymorphism allow?

A

One message to be sent to multiple objects of different classes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are 3 kinds of polymorphism?

A

Overloading

Dynamic Binding

Genericity

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is overloading?

A

Method of the same name is defined for different argument types

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is dynamic binding?

A

When a message is dispatched, the method that is invoked is chosen according to the type of the object (i.e. at runtime).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is genericity?

A

A mechanism allowing type-safe programming using generic classes

17
Q

Templates are a form of

A

genericity

18
Q

What is the purpose of analysis when making models?

A

Understanding the problem

19
Q

What is the purpose of design when making models?

A

Understanding the solution

20
Q

What is an analysis pattern?

A

Group of concepts representing a common construction in business modeling relevant to one or more domains

21
Q

What is a type diagram?

A

Structral view of a system

describes the types of objects and their relationships

22
Q

What notation are type diagrams based on?

A

Odell’s notation

NOT UML

23
Q

What is a complete partition, in type diagrams?

A

all instances of supertype must be instances of either subtype

24
Q

What is an incomplete partition in type diagrams?

A

instances of supertype can be instances of either subtype or neither

25
Q

When multiple attributes interact with behaviour that might be used in several types, you should

A

combine the attributes into a new fundamental type