Object Orientation and Generic Programming Flashcards

1
Q

Why do we use a class diagram?

A

Represents a static view of an application

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

What are the types being modelled within a system with a class diagram?

A

Classes
Interfaces
Data types
Components

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

What is the order of components on class diagram box (top to bottom)

A

Class Name
Class Attributes
Class Operations

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

How do you write an attribute in a class diagram box?

A

name : attribute type

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

How do you write an operation in a class diagram box?

A

name(parameter : type) return type

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

How to you write Zero or One?

A

0..1

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

What is 0..* or *

A

Zero or more

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

How to identify a multiplicity of “exactly three”

A

3

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

How to identify a multiplicity of “two to four”

A

2..4

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

What is the short hand for an aggregation relationship?

A

has-a

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

What is a reflexive association?

A

A class that is associated with itself (employee)

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

What do you use to organize a model’s classes?

A

Package

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

Why use an interface class?

A

Because you want to implement it.

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

What is the visibility symbol for public?

A

+

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

What is the visibility symbol for private?

A

-

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

What is the visibility symbol for protected?

A

#

17
Q

What is the visibility symbol for package?

A

~

18
Q

What four major elements are required for a language to be object oriented?

A

Abstraction
Encapsulation
Modularity
Hierarchy

19
Q

What is an issue with abstraction?

A

It exposes the attributes of a class e.g. person.age = -56

20
Q

What is a proper way to deal with the issues of abstraction?

A

Encapsulation

21
Q

Why is modularity used in object oriented programming?

A

The OOP approach is to break down complex programs into more manageable sub-problems (reusability)

22
Q

What are the attributes of modularity?

A
Simplicity
Independence
Narrow Interface
Balance of concerns
Reuse