Class Diagrams Flashcards

1
Q

how is a class shown on a class diagram and what does a good class consist of?

A
a rectangle with a name
it shows the classes in a system, attributes and operations of each class and the relationship between each class.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

how to avoid conflicts when choosing class names

A

use a data dictonary

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

what is Data driven design

A

identify all data in classes and divide it into classes. Then assign methods to these classes.

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

what is responsiblity driven design

A

idenfify all the reponsibilites(methods) of the systems and divde them into classes.

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

classes correspound to nouns so associations correspone to?

A

verbs

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

what is an association

A

a way of expressing a relationship between classes. There are instances of association.

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

What are instances of associations called in UML

A

links

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

if class A and B are associated then?

A

some object of class A has to know about some object of class B.

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

Give examples of multiplicities

A

1 is just 1

  1. .10… a range of numbers between 1 and 10
    * - arbitary unspecified number (1..*).. this is 1 to an unknown number
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

what do attributes of a class describe

A

data contained in an object of the class and their type

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

what do the operations in a class define

A

the ways in which objects may interact.

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

what is an operation signature

A

gives the selector, names, types of all formal parameters and return type.

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

what is generalization

A

if class A is a generalization of class B then the interface of class B must conform to the interface of class A

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

does generalization increase the coupling of a system?

A

yes

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

difference between generalization and inheritance

A

generalization is a conceptual relationship whereas inheritance is an implementation relationship

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

What is CRC and what is it good for

A

Classes, Responsibilities and Collaborations and is used for checking good design. Not part of UML.

17
Q

What does a CRC consist of

A
Name of class on top
responsiblities of class on the left
collaborators on the right
18
Q

Too many responsibilities in a CRC means what?

A

low cohesion (bad level abstraction)

19
Q

what does too many collaborators mean in a CRC?

A

high coupling (class is connected to too many other classes).

20
Q

What is the compromise between coupling and cohesion

A

high cohesion and low coupling