UML Diagrams Flashcards

1
Q

Dependency: Class diagrams

A

http://www.cs.utsa.edu/~cs3443/uml/uml.html#:~:text=Unidirectional%20Association%3A%20An%20object%20might,direction%20might%20not%20be%20modeled.

A dependency is when one object uses another object in its method. Let’s say Person reads Book. The book object is passed into the person read method.

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

Unidirectional association: class diagrams

A

http://www.cs.utsa.edu/~cs3443/uml/uml.html#:~:text=Unidirectional%20Association%3A%20An%20object%20might,direction%20might%20not%20be%20modeled.

This is when one object has a property of another object, but the other object does not have the reverse. Person and Book. A person can own many books, Person has a Books[] property, but a book would not have a list of its owners. The book object will never call a method on Person, but Person might call a method on book

NOTE: unidirectional associations can have many-many relationships. Just bc a book does not have a person property, does not mean many people do not own many books and many books are not owned by many people.

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

Bidirectional association: class diagrams

A

http://www.cs.utsa.edu/~cs3443/uml/uml.html#:~:text=Unidirectional%20Association%3A%20An%20object%20might,direction%20might%20not%20be%20modeled.

Two objects store each other in fields. A Person object has Book[] and Book has Person[]. A person has a list of all their books and a book has a list of all their owners.

By default, most associates are assumed to be bidirectional.

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

Aggregation: class diagrams

A

http://www.cs.utsa.edu/~cs3443/uml/uml.html#:~:text=Unidirectional%20Association%3A%20An%20object%20might,direction%20might%20not%20be%20modeled.

Object A owns Object B. In the person and book example, we would assume a different book for each different physical copy. And the person would own that copy of the book. The book will usually be owned by 1 person.

A flight/airport is a good example for unidirectional vs aggregation. A flight has an airport property, but it does not own it, and the airport does not have a flight property. A singular book can be owned by 1 person.

The key distinction is if the book is shared or owned by one person (I believe)

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

Composition: class diagrams

A

http://www.cs.utsa.edu/~cs3443/uml/uml.html#:~:text=Unidirectional%20Association%3A%20An%20object%20might,direction%20might%20not%20be%20modeled.

in addition to the aggregation relationship, A owns B, B cannot exist without A. If we assume a book is a digital copy and only 1 person can own it ever, then the copy cannot exist without a Person object.

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

abstract class/interface: class diagrams

A

Shows a standard interface/class relationship. Crew and teacher all inherit the Person interface.

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

sequence diagram

A

A sequence diagram is a uml diagram that shows the flow of messages for a particular function (user logs into account). It shows the objects it interacts with, the flow of those objects, what data is exchanged, and in what order. Sequence diagrams help model object behavior in a specific use case.

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

activity diagram

A

Activity diagrams show a flowchart of from one activity to another (think smash flowcharts). It shows the message flow from one activity to another. In the example a user searches for a product on amazon. They have an option to search for a product or click a product on the home page.

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