UML

Dr Andy Evans

[Fullscreen]

UML

  • The Unified Modelling Language.
  • A way of drawing code overviews so that it's understood by any programmer.
  • Usually part of a software development 'process'.
  • UML is an overview. Once developers have seen your UML, they'll look at your documentation for more information.
  • Can be converted into raw code using some Computer Aided Software Engineering (CASE) tools.

Why?

  • In industry code tends to be part of much larger projects with multiple programmers working on it.
  • Therefore we need standard overviews so that...
    • We can see whether an application can be made and how many people we'll need to work before we start coding.
    • We can see where our code fits in when we start.
    • We can see how to use other people's objects.
    • If you spontaneously combust, others can pick up your work easily.

Parts of UML

  • There are several types of model in the UML. Which one you use, and how you look at it, will depend on what you're trying to do.
  • The secret is to use what's useful.
  • Types of diagram...
    • Use Cases (What are the uses someone [or thing] may want from our software).
    • Class Diagrams (What are the different relationships between Classes).
    • Sequence Diagrams (What order does stuff happen in).
    • State/Activity Diagrams (What are Classes like over time).

Class Diagram

-/+/# = private/public/protected

Solid arrow is inheritance from a class/abstract class.Interfaces have dashed arrows and are written:
<<Point>>

Abstract classes are either light font or, more usually, italics.

Variables at top, methods at bottom.

Activity Diagram

Beginning and end marked by circles (end by a double circle).

Diamonds for decisions.

Parallel code marked by bars.