<<

Introduction to UML Lecture # 1

Department of and Technology University of Bedfordshire

Written by David Goodwin, based on the book Applying UML and Patterns (3rd ed.) by C. Larman (2005).

Modelling and Simulation, 2012 Introduction to Outline UML

Course Course Information Information UML Structure UML Behaviour Structure Diagrams Diagrams Interaction Behaviour Diagrams Diagrams Interaction Diagrams Modelling

summary Modelling Use Case

summary Introduction to UML

Course Information

UML Structure Diagrams Behaviour Course Information Diagrams Interaction Diagrams

Modelling Use Case

summary Introduction to Aims and Objectives UML

Course Information

I To understand the software development process, UML Structure including requirement specification, analysis, design, Diagrams Behaviour implementation and testing. Diagrams Interaction I To learn and use various methodologies in software Diagrams

development, Modelling Use Case I To understand the process of modelling real world summary problems and systems using UML,

I To develop skills on object oriented software development (OOSD). Introduction to Assesment UML

Course Information

UML Structure I Assignment: Diagrams Behaviour th I One long, report style assignment, 50% (due 1630 27 Diagrams Interaction September 2012) Diagrams I Exam: Modelling th Use Case I Final exam (Perception), 50% (2 hours, 1900-2100 27 summary September 2012) Introduction to Books UML

Course Information

I Applying UML and patterns by Craig Larman UML Structure I Object-Oriented Software Engineering – a use case Diagrams Behaviour driven approach (revised edition) by Diagrams Interaction I UML Distilled (2nd Edition) by Martin Fowler Diagrams

I Software Engineering (4th Edition) by Ian Sommerville Modelling Use Case

I Developing Applications with Java and UML by Paul R summary and Reed Jr

I Practical Software Engineering by Leszek A Maciaszek and Bruc Lee Liong Introduction to UML

Course Information

UML Structure Diagrams Behaviour UML Diagrams Interaction Diagrams

Modelling Use Case

summary Introduction to What is UML” UML

Course Information I UML stands for Unified Modelling Language. UML I An industry standard modelling language for Structure Diagrams object-oriented software engineering. Behaviour Diagrams I Developed in the mid-1990’s and standardised in 1997 Interaction Diagrams (UML 1.1). Modelling I UML 2.x is the current revision in use (we will focus on Use Case UML 2.0, revision from 2005). summary

I UML includes a set of graphic notation techniques to create visual models of object-oriented software-intensive systems. Introduction to List of object-oriented programming UML languages

Course Information

UML I Languages designed mainly for object-oriented Structure programming: Diagrams Behaviour I C++ Diagrams Interaction I Java Diagrams I C# Modelling I Python Use Case summary I Languages with some object-oriented features:

I I Fortran I Perl I PHP Introduction to List of Unified Modelling Language UML tools

Course NAME PLATFORM LICENSE Information UML ArgoUML Cross-platform (Java) Open source Structure Diagrams astah* Multi-platform Commercial, Free Community version Behaviour Diagrams Interaction Dia Cross-platform (GTK+) Open source Diagrams

Modelling Modelio Windows, Open source Use Case

Rational Rhapsody Windows, Linux, MacOS X Commercial summary

Software Ideas Modeler Windows, Linux Commercial, Freeware for non-commercial

StarUML Windows Open source

Umbrello UML Modeller Unix-like; Windows Open source

Visual Paradigm for UML Cross-platform (Java) Commercial, Free Community Edition Introduction to UML 2.0 UML

Course Information

UML Structure I UML 2.0 defines thirteen types of diagrams: Diagrams Behaviour I divided into three categories: Diagrams I Six types represent static application Interaction Diagrams structure; Modelling I Three diagram types represent general types of Use Case behaviour; summary I Four diagram types represent different aspects of interactions. Introduction to UML

Course Information Shows a collection of static model elements such as classes UML Structure and types, their contents, and their relationships. Diagrams Behaviour Diagrams Interaction Diagrams

Modelling Use Case

summary Introduction to UML

Course Information

Depicts objects and their relationships at a point in time, UML typically a special case of either a class diagram or a Structure Diagrams . Behaviour Diagrams Interaction Diagrams

Modelling Use Case

summary Introduction to UML

Depicts the components that compose an application,

system, or enterprise. The components, their Course interrelationships, interactions, and their public interfaces are Information UML depicted. Structure Diagrams Behaviour Diagrams Interaction Diagrams

Modelling Use Case

summary Introduction to Composite Structure Diagram UML

Course Information

Depicts the internal structure of a classifier (such as a class, UML , or use case), including the interaction points of Structure Diagrams the classifier to other parts of the system. Behaviour Diagrams Interaction Diagrams

Modelling Use Case

summary Introduction to UML

Shows how model elements are organized into packages as Course well as the dependencies between packages. Information UML Structure Diagrams Behaviour Diagrams Interaction Diagrams

Modelling Use Case

summary Introduction to UML

Shows the execution architecture of systems. This includes Course Information nodes, either hardware or software execution environments, UML as well as the middleware connecting them. Structure Diagrams Behaviour Diagrams Interaction Diagrams

Modelling Use Case

summary Introduction to UML

Shows use cases, actors, and their interrelationships. Course Information

UML Structure Diagrams Behaviour Diagrams Interaction Diagrams

Modelling Use Case

summary Introduction to UML

Depicts high-level business processes, including data flow, or Course to model the logic of complex logic within a system. Information UML Structure Diagrams Behaviour Diagrams Interaction Diagrams

Modelling Use Case

summary Introduction to State Machine Diagram UML

Describes the states an object or interaction may be in, as

well as the transitions between states. Formerly referred to Course as a , state chart diagram, or a state-transition Information UML diagram. Structure Diagrams Behaviour Diagrams Interaction Diagrams

Modelling Use Case

summary Introduction to UML

Models the sequential logic, in effect the time ordering of Course messages between classifiers. Information UML Structure Diagrams Behaviour Diagrams Interaction Diagrams

Modelling Use Case

summary Introduction to Communication Diagram UML

Shows instances of classes, their interrelationships, and the Course message flow between them. Communication diagrams Information UML typically focus on the structural organisation of objects that Structure send and receive messages. Formerly called a Collaboration Diagrams Behaviour Diagram. Diagrams Interaction Diagrams

Modelling Use Case

summary Introduction to Timing Diagram UML

Course Information

UML Structure Diagrams Behaviour Depicts the change in state or condition of a classifier Diagrams Interaction instance or role over time. Typically used to show the change Diagrams in state of an object over time in response to external events. Modelling Use Case

summary Introduction to Interaction Overview Diagram UML

A variant of an diagram which overviews the control

flow within a system or business process. Each /activity Course within the diagram can represent another interaction Information UML diagram. Structure Diagrams Behaviour Diagrams Interaction Diagrams

Modelling Use Case

summary Introduction to UML

Course Information

UML Structure Diagrams Behaviour Modelling Diagrams Interaction Diagrams

Modelling Use Case

summary Introduction to System development UML

Course Information

I System development is model building UML I Complexity of a large project Structure Diagrams I A large number of components Behaviour Diagrams I A large amount of team work Interaction Diagrams I Linguistic communication between teams or between team members is neither accurate nor reliable Modelling Use Case I Models are standard representations and they are accurate and reliable summary I Modelling is the process of developing a model I Various types of models for different purposes and stages in software development Introduction to Types of models UML

I Various types of models Course I Requirement model describes Information

I Users’ requirements UML I Functionality Structure Diagrams I Analysis model gives Behaviour System specifications Diagrams I Interaction I A robust and changeable structure and structured Diagrams components Modelling Use Case I Design model presents summary I A refined structure to the current implementation environment

I Implementation model documents

I Details of how a design is implemented

I Test model gives

I Verification I Validation Introduction to Architecture UML

Course Information I Architecture of a modelling language UML Structure I Model architecture is a set of modelling language, Diagrams Behaviour notation and modelling techniques. Diagrams I A modelling language contains: Interaction Diagrams I Syntax - how it looks Modelling I Semantics - what it means Use Case I Pragmatics - heuristics and rules of thumb for using it summary I UML

I Unified Modelling Language is commonly accepted I Idea first came from Ivar Jacocson in 1997 Introduction to Requirements Model UML

Course Information

I Users’ requirements in software engineering UML I A client/end-user’s needs and expectations Structure Diagrams I Essential characteristics of the client/end-user’s goal Behaviour Diagrams I They are purely the user’s view of a system Interaction I Requirements should be problem-based and not describe Diagrams solutions (Remember that no solution has yet been Modelling developed) Use Case summary I Requirements are often given in terms of what actually happens within a physical, chemical, biochemical, business, transportation,. . . process. I Requirements are modeled using Use Case diagrams Introduction to Use Case diagram - syntax UML

I Actor - interaction with a process often initialised by outsiders Course Information

UML Structure Diagrams Behaviour Diagrams Interaction Diagrams I Use case - a series events taking place within a process Modelling and they are often triggered by an Use Case

summary

I Relationship - information flow between an actor and a use case or between two use cases Introduction to Use Case diagram - pragmatics UML

I Identify actors Course Information I What are entities outside of a process which trigger information exchange with the process? UML Structure I Can we classify them? Diagrams Behaviour I Identify use cases Diagrams Interaction I What are the main tasks of each actor? Diagrams I How should the process response to each actor? Modelling Use Case I A use case should link to a scenario representing what happens in the process in response to an actor summary I A use case should contain a complete course of events related to the scenario I Add relationship

I We need to pay extra attention on those between use cases Introduction to Use Case diagram - semantics UML

Course Information I An actor represents anything that is outside of a process being described and that needs to exchange information UML Structure with the process Diagrams Behaviour I An individual person (e.g. an end-user, an engineer) Diagrams Interaction I A group of people who play the same role (e.g. cashers Diagrams

in a bank) Modelling I An individual that can play different roles should be Use Case represented as several actors according to his role in a summary process (e.g. HoD, researcher, lecturer) I A machine I An object I ... Introduction to Use Case diagram - events UML

I A use case represents a special sequence of events triggered by an actor Course I Example: initialising a process through a menu Information UML Structure Diagrams Behaviour Diagrams Interaction Diagrams

Modelling Use Case

I The actor triggers a sequence of events which take summary place in a process

I A Use Case can contain the following events

I display a list of variables I Accept values given by the actor and assigned to the variables I give a warning signal if the values given are out of range I give acknowledgement Introduction to Use Case diagram - relationship UML

Course Information

UML I Relationship represents information exchange between Structure Diagrams an actor and a Use Case or between two Use Cases Behaviour Diagrams I Different types of relationship exiting between an actor Interaction and a use case and between two use cases: Diagrams

I Ordinary relationship showing the simple information Modelling exchanges between an actor and a use case or between Use Case two use cases summary I The symbol is used to represent this type of relationship Introduction to Use Case diagram - relationship UML

I I An Extend relationship exists between two similar Use Course Cases where the second one has some extra activities, Information that is, the activities of the first Use Case are extended UML Structure in the second one Diagrams Behaviour I The first Use Case sends information to the second Diagrams Use Case to invoke the extra activities Interaction Diagrams I Terms: 1) first Use Case: base Use Case; Modelling 2) second Use Case: extending Use Case (which has Use Case two sections, one is name and the other is the summary condition for the extra activities); 3) the condition: extension point.

I The Symbol is used to represent this type of relationship Introduction to Use Case diagram - example UML

I Think about a cash machine (atm). You can withdrew £ £ 10 and 20 notes from your account through a cash Course machine. The cash machine will check your pin, Information account balance, etc. If you withdrew £20, the machine UML Structure will simply dispense two £10 notes. If you withdrew, Diagrams Behaviour say, £50, the machine will dispense two £20s and one Diagrams Interaction £10. This means that the machine check the withdrew Diagrams amount and then decide what notes will be given out. Modelling This can be expressed as shown in the following. Use Case summary Introduction to Use Case diagram - relationship UML

Course Information

UML I I A Generalisation relationship also exists between two Structure use cases Diagrams Behaviour I A group of use cases may have some common activities Diagrams Interaction I A generalised use case contains those common Diagrams

activities extracted from the group use cases Modelling I What left to the group of use cases are the specific Use Case

activities summary I The Symbol is used to represent this type of relationship Introduction to Use Case diagram - example UML

I I Think about auto-stamp machine where you can buy 1st class and 2nd class stamps. Consider two Use Case, one is for 1st class stamps and the other is for 2nd class Course Information stamps. Both need to check coins you insert into the UML machine, calculate balance, dispense changes but Structure dispense different stamps. Diagrams Behaviour I The common activities are checking coins, calculating Diagrams Interaction balance and giving change. Diagrams

I Special activities are dispensing 1st class stamps and Modelling dispensing 2nd class stamps. Use Case I Extracting the common activities from the two use summary cases and placing them into a new use case forms a generalised use case Introduction to UML

Course Information

UML Structure Diagrams Behaviour summary Diagrams Interaction Diagrams

Modelling Use Case

summary Introduction to Key Terms UML

Course Information

UML Structure Diagrams Behaviour Diagrams Interaction Diagrams

Modelling Use Case

summary