Introduction to the UML

Unified Modeling Language (UML) – is a language for modeling software and other system.
System design is not easy thing. Every software system consists of components (from several to thousand). There is a normal question:“How do you (your team) know which components need,what their role is in system and how they met system’s requirements?”The fact that there are many things which you don’t understand or you can forget in developing without external help.Why do we need to model the system? It is simple. Modeling system allows us to manage complexity. Modeling helps to see whole system’s picture and focus on these things:

  • documentation
  • communication between important system’s components
  • other

Model – an abstraction of real things. All you need is a language which can help to modeling system. Here UML comes to help.

What does it mean modeling language?

Modeling language can consists of pseudo code,programming code,pictures,diagrams or description and so on.
Elements which make modeling language called notation.
TaxiDriver diagram
Description of notation called language semantics.

Why UML?

  • UML is formal language
  • UML is short. All language consists of simple notations
  • UML is comprehensive. It describe all important parts of system
  • UML scaled. With UML we can model not only big system
  • UML built in the form of lessons
  • UML is a standard

Simple example

public class TaxiDriver extends Person implements Drive{ private Car mCar; public TaxiDriver(String name){ super(name); }  public Car getCar(){ return mCar; }  public void setCar(Car car){ mCar = car; }  public void drive(){ System.out.println(super.getName() + "I need to get a client from the airport"); if (mCar != null){ System.out.println("It's Okay. I am going."); } else{ System.out.println("Hey,where is my car?"); }  }  public static void main(String[] args){ Drive driver = new TaxiDriver("John Smith"); driver.setCar(new Car("Dodge Caravan")); driver.drive(); }}

UML diagram for this example

Model of this example

What does it mean model?

Model in simple terms – is set of diagrams,which communicate between each other.

Views of model

There are several ways for showing UML from point of view of different aspects of systems.
Most popular is Philippe Kruchten 4+1 view model

Philippe Kruchten 4+1 view model

Shortly about every view

  • Logical View shows system’s abstract description. Using for showing why this system is developed and how system’s parts communicate with each other. Types of UML diagrams which most used here are class,object,state machine and interaction.
  • Process View describes system’s process. Most used is activity diagram.
  • Development View describes how system’s parts organized in modules and components. It is very useful for managing levels of system’s architecture. Most used are package and component diagrams.
  • Physical View describes how system’s design which is described in Logical,Process and Development views will be transferred to real thing. Here all diagrams shows how whole abstraction will transfer to real system. Most used is deployment diagram.
  • Use Case View describes system’s functionality from real world’s point of view. Main goal is to show what system can do. Most used are use case,description and overview diagrams.

Using these views is very important for correct modeling.

Additional information which need to know from the beginning

In every system’s model there are most used notations –Notes and Stereotypes.
Notes are comments. In UML they uses for commenting diagrams.
Notes can be separate or with diagram. Picture shows both cases.
Simple note

or

Notes for class

Stereotypes change meaning of element and describe element’s role in the model.
Sometimes Stereotypes can have an icon.
Stereotype with icon

But sometimes image is too big,in this case there is a way to set role like <<stereotype_name>>

Also I want to inform that element can be associated with several roles:<<actor,person>>. Also it is very important that this situation depends of modeling tool which you use,for example I am using Visual Paradigm for UML and it shows several roles

Visual Paradigm presentation of stereotype without an icon

UML specification has set of standard stereotypes.
Shortly about most used

  • utility - represents a class that provides utility services through static methods such Java’s Math class
  • service - a stateless,functional component that computes a value. Could be used to represent a web service
  • subsystem – a large component that is actually a subordinate system,of a larger system
  • executable – a physical file that is executable,such as .exe file
  • file – a physical file used by your system. Could be a configuration file,such .txt file
  • library – a static or dynamic library file. Could be .jar or .dll file
  • source – a source file containing code,such .java

Tagged values

Stereotypes can contain additional information which is related to the element to which they are applied. This information is specified using tagged values.
Tagged values are associated with stereotype. For example you had an element in your model that represented a login page on web site and it was stereotyped as a form. The form stereotype needs to know whether it should validate the contents of the form or not in this case. This validation decision should be declared as a tagged value of the form stereotype because it is associated with stereotype that is applied to an element,not with the element itself.
How to draw correct tagged values the diagram? The same as notes,but the folder rectangle contains the name of any stereotypes and settings for any associated tagged values.

Tagged values

Summary

It is short introduction to the UML. There weren’t a lot of examples only that what need to know from the beginning.

Share

No related posts.

Leave a Reply

  

  

  

You can use these HTML tags

<a href=""title=""><abbr title=""><acronym title=""><b><blockquote cite=""><cite><code><del datetime=""><em><i><q cite=""><strike><strong>

A sample text widget

Etiam pulvinar consectetur dolor sed malesuada. Ut convallis euismod dolor nec pretium. Nunc ut tristique massa.

Nam sodales mi vitae dolor ullamcorper et vulputate enim accumsan. Morbi orci magna,tincidunt vitae molestie nec,molestie at mi. Nulla nulla lorem,suscipit in posuere in,interdum non magna.