UML

From Pigbert Wiki

Table of contents

Basic

Classification

  • Static: The static characteristic of a system is essentially the structural aspect of the system. The static characteristics define what parts the system is made up of.
  • Dynamic: The behavioral features of a system; for example, the ways a system behaves in response to certain events or actions are the dynamic characteristics of a system.
  • Implementation: The implementation characteristic of a system is an entirely new feature that describes the different elements required for deploying a system.


Views

  • Design View: The design view of a system is the structural view of the system. This gives an idea of what a given system is made up of. Class diagrams and object diagrams form the design view of the system.
  • Process View: The dynamic behavior of a system can be seen using the process view. The different diagrams such as the state diagram, activity diagram, sequence diagram, and collaboration diagram are used in this view.
  • Component View: Next, you have the component view that shows the grouped modules of a given system modeled using the component diagram.
  • Deployment View: The deployment diagram of UML is used to identify the deployment modules for a given system. This is the deployment view of the
  • Use case View: Finally, we have the use case view. Use case diagrams of UML are used to view a system from this perspective as a set of discrete activities or transactions.


Construct UML Diagrams from source code in NetBeans

  1. Right click a java source file, then choose reverse engineering.
  2. Under Projects view, in PackageName-Model: the constructed diagrams are stored under Diagram, as well as the corresponding packages under Model. To create a new diagram, shift- choose all files to be included in the diagram, the right click on the chosen files, choose Create diagram from selected elements ... .


 hline-music11.gif


Types of UML Diagrams

Activity Diagram

The process flows in the system are captured in the activity diagram. Similar to a state diagram, an activity diagram also consists of activities, actions, transitions, initial and final states, and guard conditions.


Class Diagram

A class diagram is a type of static structure diagram that describes the structure of a system by showing the system's classes, their attributes, and the relationships between the classes. class diagram @ wikipedia (http://en.wikipedia.org/wiki/Class_diagram).

Relationships
The relationship or association between the classes can be either an "is-a" or "has-a" relationship.


Association: defines a relationship between classes of objects which allows one object instance to cause another to perform an action on its behalf, i.e. a method call. This relationship is structural, because it specifies that objects of one kind are connected to objects of another.
Uni-directional: Image:UnidirectionalAssociation.png Bi-directional: Image:BidirectionalAssociation.png


Composition: a filled diamond and a solid line. It always implies a multiplicity of 1 or 0..1, as no more than one object at a time can have lifetime responsibility for another object.
Aggregation: an unfilled diamond and a solid line.
Image:AggregationAndComposition.png


Generalization: The generalization relationship indicates that one of the two related classes (the subtype) is considered to be a specialized form of the other (the supertype) and supertype is considered as GENERALIZATION of subtype. In practice, this means that any instance of the subtype is also an instance of the supertype. The relationship is most easily understood by the phrase 'A is a B' (a human is a mammal, a mammal is an animal).
Image:UML-Generalization.png


Collaboration Diagram

A collaboration diagram groups together the interactions between different objects. The interactions are listed as numbered interactions that help to trace the sequence of the interactions. The collaboration diagram helps to identify all the possible interactions that each object has with other objects.


Component Diagram

The component diagram represents the high-level parts that make up the system. This diagram depicts, at a high level, what components form part of the system and how they are interrelated. A component diagram depicts the components culled after the system has undergone the development or construction phase.

Deployment Diagram

The deployment diagram captures the configuration of the runtime elements of the application. This diagram is by far most useful when a system is built and ready to be deployed.

Sequence Diagram

A sequence diagram represents the interaction between different objects in the system. The important aspect of a sequence diagram is that it is time-ordered. This means that the exact sequence of the interactions between the objects is represented step by step. Different objects in the sequence diagram interact with each other by passing "messages".


State Diagram

A state diagram, as the name suggests, represents the different states that objects in the system undergo during their life cycle. Objects in the system change states in response to events. In addition to this, a state diagram also captures the transition of the object's state from an initial state to a final state in response to events affecting the system.


Use Case Diagram

The use case diagram is used to identify the primary elements and processes that form the system. The primary elements are termed as "actors" and the processes are called "use cases." The use case diagram shows which actors interact with each use case.

Personal tools