Presentation is loading. Please wait.

Presentation is loading. Please wait.

UML - Part 3.

Similar presentations


Presentation on theme: "UML - Part 3."— Presentation transcript:

1 UML - Part 3

2 Building Blocks of the UML
Modeling Element Structural things Behavioral things Grouping things Annotational things Relationships Dependency Association Generalization Realization 3. Diagram Class diagram Object diagram Use case diagram Sequence diagram Collaboration diagram Statechart diagram Activity diagram Component diagram Deployment diagram

3 3 Diagrams A diagram is typically a view of a part of the model, showing modeling elements and some of the relationships between them. A diagram do not have to be complete, some elements may be missing or presented in a simplified fashion. UML: ”A well-formed model is one that is semantically self-consistent and in harmony with all related models.”

4 There are 9 types of diagrams in UML
Dynamic views Static views Use Case Diagrams Sequence Diagrams Some part of the model might not be visible on any diagram Class Diagrams Collaboration Diagrams Object Diagrams Model Activity Diagrams Component Diagrams Statechart Diagrams Deployment Diagrams

5 3.1 Use case diagram actor register a person
association use case system boundary include relationship register a person edit a registration/ delete a registration User navigate/view the register ”include” view next person view previous person ”include”

6 Use Case Diagram - One More Example
”A use case is a specific way of using the system by performing some part of the functionality. Each use case constitutes a complete course of events initiated by an actor, and it specifies the interaction that takes place between an actor and the system....” I. Jacobson

7 StudentCourseProfile
3.2 Class Diagram 1 responsible for * Course Person CourseModule name : String description : String name : String String homePage : String tech. responsible for name : String description : String 1 * * 1..* 1 1 * 1 Student * StudentCourseProfile * finished : boolean When a student register for course a StudentCourseProfile object will be made!

8 A Class Diagram With Navigation
1 responsible for * Course Person CourseModule name : String description : String name : String imail : String homePage : String 1 tech. responsible for * * 1..* name : String description : String 1 1 * * 1 StudentCourseProfile * Student finished : boolean

9 A Class Diagram - Mapping to Java
1 responsible for * Course Person name : String description : String name : String imail : String homePage : String 1 tech. responsible for * 1 * * 1 StudentCourseProfile Student finished : boolean public class Person { protected String name; protected String imail; protected String homePage; // // Navigation protected Course[] responsibleFor; protected Course[] techResponsibleFor; public Person() { } public class Student extends Person { // // Navigation public StudentCourseProfile[] studentCourseProfile; public Student() { }

10 A Class Diagram - Example With Interface
IStorable Register -reg 0..* 0..* edit() write() relization read() public void read(){ Person terminal.print("Name: "); name = terminal.readLine(); edit() ... write() } read() relization/implements Two different representation of nearly the same dependency

11 A Class Diagram - One More Example With Interface

12 3.3 Object Diagram - Capture Instances and Links
Class Object Company HiA: Company noOfEmploees=600 noOfEmploees : int Possible object name object class attribute with value

13 Object Diagram with Links
Class Diagram Object Diagram Language: Department :LocatedAt Gimlemoen: Office Company Department Office LocatedAt 1 1..* * HiA: Company Possible object diagram Engineering : Department :LocatedAt Grooseveien: Office Link - A link is an instance of an association, analogous to an object being an instance of a class.

14 Object diagram and Rational Rose 2000
Rational Rose 2000 does not have object diagrams, but you can achieve much the same with a collobartion diagram You can not specify attributes inside object; One solution to this short-coming is to use a comment!

15 3.4 Sequence diagram ”create” register user controllerViewer person
<command r> <name, ,..> person ”create” setData(name, ..) insert(person)

16 3.5 Collaboration diagram
1.2: ”create” 1: register() 1.3: setDate(data) user controllerViewer person 1.1: data := getData() 1.4: insert(person) register

17 3.6 Statechart diagram StateChart for microwave oven "control unit"

18 Statechart for Applet Not Loaded Running Loaded Stopped init/init()
stop/ stop() Stopped start /start() start/start() destroy/destroy()

19 3.7 Activity diagram - Capture Dynamic Behaviour (Activity-oriented)

20 Activity diagram - One More Example
product of activity

21 Activity diagram - One More Example
user controller person register request registration create person (object) supply person-data forward person-data process person-data insert person

22 3.8 Component diagram - Captures the Physical Structure of the Implementation
applet1.class applet1.java Demo.html applet2.class applet2.java logo.gif

23 Component diagram - One More Example
Person.class Register.class ISortable

24 3.9 Deployment diagram Extended VLAN ”Server” ”network” LAN ”PC” ”PC”

25 Multi-tier Architecture - MVC - view: browser/jsp/servlet controller: jsp/servlet model: businessObjects client: Internet browser: server1: :WebServer :html :html :ServletContainer Intranet s1:Servlet s2:Servlet j1:Jsp j2:Jsp b1:BusinessObject b3:BusinessObject b2:BusinessObject b4:BusinessObject server2: :DB

26 References [1] Grady Booch, James Rumbaugh and Ivar Jacobson: The Unified Modeling Language User Guide. Addison-Wesley, 1999 James Rumbaugh, Michael Blaha, William Premerlani, Frederick Eddy and William Lorenzen: Object-Oriented Modeling and Design. Prentice Hall, 1991 Martin Fowler with Kendall Scott: UML Distilled. Addison-Wesley, 1997 Terry Quatrani: Visual Modeling with Rational Rose and UML. Addison-Wesley, 1998 Ari Jaaksi: A Method for Your First Object-Oriented Project. JOOP - The Journal of Object-Oriented Programming, Januar 1998 Rational software:


Download ppt "UML - Part 3."

Similar presentations


Ads by Google