UML Bookmarks
Published: 2021-10-24,
Updated: 2023-06-15
Links
Class Diagram
Purpose of Class Diagrams
- Shows static structure of classifiers in a system
- Diagram provides a basic notation for other structure diagrams prescribed by UML
- Helpful for developers and other team members too
- Business Analysts can use class diagrams to model systems from a business perspective
RelationShips
Inheritance (or Generalization)
Implementation
Mustang is a Car, so Mustang implements the Car interface
Simple Association
There is an association between Class1 and Class2
Aggregation
A special type of association. It represents a "part of" relationship.
- Class2 is part of Class1.
- Many instances (denoted by the *) of Class2 can be associated with Class1.
Composition
A special type of aggregation where parts are destroyed when the whole is destroyed.
- Objects of Class2 live and die with Class1.
- Class2 cannot stand by itself.
Dependency / Use
If class one changes affects class two, then class one depends class two
- Exists between two classes if the changes to the definition of one may cause changes to the other (but not the other way around).
- Class1 depends on Class2
Relationship
Names
- Names of relationships are written in the middle of the association line.
- Good relation names make sense when you read them out loud:
- "Every spreadsheet contains some number of cells",
- "an expression evaluates to a value"
- They often have a small arrowhead to show the direction in which direction to read the relationship, e.g., expressions evaluate to values, but values do not evaluate to expressions.
Roles
- A role is a directional purpose of an association.
- Roles are written at the ends of an association line and describe the purpose played by that class in the relationship.
- E.g., A cell is related to an expression. The nature of the relationship is that the expression is the formula of the cell.
Navigability
- The arrows indicate whether, given one instance participating in a relationship, it is possible to determine the instances of the other class that are related to it.
The diagram above suggests that,
- Given a spreadsheet, we can locate all of the cells that it contains, but that
- we cannot determine from a cell in what spreadsheet it is contained.
- Given a cell, we can obtain the related expression and value, but
- given a value (or expression) we cannot find the cell of which those are attributes.
Projetos UML de exemplo com código java gerado para exemplificação
- https://app.genmymodel.com/editor/edit/_rvOx0AvVEe64eYTeKXp2Pw#
- https://app.diagrams.net/#G1nFI1VKbcxHiq3PMYuJVmYAd9KvieXGVZ | https://drive.google.com/file/d/1nFI1VKbcxHiq3PMYuJVmYAd9KvieXGVZ/view?usp=sharing
- https://github.com/mageddo/java-examples/tree/master/vanilla/src/main/java/vanillajavaexamples/exemplo_uml
Eleições 2018
Bike Bookmarks
Comments