UML Diagrams

Class diagram
Represents the system by graphing classes. Their attributes, relations and methods

Dog // -Color: String // + getColor(): String
-means private and

class diagrams can have different grades of specifity. el mas especifico siendo desde la perspectiva de implementacion (todos los parametros, tipos de datos, metodos...)

Relaciones:

association (line)
Inheritance (hollow triangle): directed towards the parent class.

implementation/realization: usually mean interface (classes that only have methods)

example: Owner is an interface class that have special methods like fire_employee().

Owner can be implemente by Person or Corporation classes.

dependency (segmented line with triangle end): special case when an object of a class A uses an object of another class B in one of it's methods and object B is not stored inside object A

example: Person has method read(Book) : boolean

aggregation (hollow rombo): classes that aggregate to a class are not destroyed when the class is destroyed.

composition (rombo): classes that compose a class are destroyed when the class is deleted

above the relation line is usually a verb that that conveys the meaning of the relation.

We can also specify the number of objects that can take part in the relation. 1 // 1..* // *

![image.png](/img/user/00-09 System/09 resources/image-22.png)

Object Diagram

provides example. Illustrate specific cases of a class diagram. Essentially it is a the same class diagram represented with theoretical created objects.

Package Diagram

kind of structural diagram that shows Location and organization of model elements for medium and large scale projects.

can display structure and dependencies of subsystems and modules. layer applications.

If a system is very large should be divided in smaller subsistems. each with it's own class diagram.

Packages (like literal program packages) are a group of models / group of code

![image.png](/img/user/00-09 System/09 resources/image-21.png)

Use case diagram.

Use case diagrams help us design systems from the perspective of the end user, by indicating all possible actions.

Components:

actors, has a role in the system, the user is an actor that can play many roles

actors trigger use cases

use case: system function or process
representes as an oval, each actor must be associated with use cases.
Use cases describe what happens, doesn't describe how.

System boundary. for large systems I can encapsulate. Se representa enmarcando casos de uso en un cuadrado.

extension  (login) <---- (invalid password)
include (place order) ----> (login)

inheritance represented by a line ending in a white/hollow triangle (Store patient records (Paper File)) <|----- (Store Records (computer file))

or (search) <----- (search by Date)
![image.png](/img/user/00-09 System/09 resources/image-24.png)

Deployment Diagram

models the physical aspect of a system. Runtime processing nodes. Kind of a structural diagram.

Example [Internet]--[modem bank]--[cache server]--[server]

(useful for cloud stuff) and describing micro processes. load balancers.

![image.png](/img/user/00-09 System/09 resources/image-20.png)

Activity Diagram

Extended version of a flow char. Shows how activities are coordinated to provide a service.

Components:

Initial node(black circle): entry point
control flow: line that shows the sequence of execution
action (square): a task to be performed
decision node (rombo):
merge node (rombo vacio): merges the different threads after a condition node

fork node (big black bar): splits behavior into a set of parallel or concurrent flow of activities.

join node(big black bar): combines several parallel flows

object(square) : represents and object in a thread that is being acted upon. This is an optional element of the diagram but in some cases is necessary to show the object initiating the execution of activities.

final node (black circle with a ring around it)

Swim Lanes: a way to group activities performed by the same actor. or group them in a single thread.

![image.png](/img/user/00-09 System/09 resources/image-19.png)

State machine Diagram

describes all possibles states of an object and how it reacts/ interacts to events.

state machine diagram of a air conditioner.
![image.png](/img/user/00-09 System/09 resources/image-25.png)

Sequence Diagram

detail how operations are performed. Capture the interaction of objects in the context of collaboration.

horizontally: objects that participate in the interaction.
vertically: time in the context of the sequence

![image.png](/img/user/00-09 System/09 resources/image-23.png)