Presentation is loading. Please wait.

Presentation is loading. Please wait.

SEG4110 – Advanced Software Design and Reengineering TOPIC A Review of UML.

Similar presentations


Presentation on theme: "SEG4110 – Advanced Software Design and Reengineering TOPIC A Review of UML."— Presentation transcript:

1 SEG4110 – Advanced Software Design and Reengineering TOPIC A Review of UML

2 SEG4110 - Topic A- Review of UML2 What is UML? The Unified Modelling Language is a standard graphical language for modelling object oriented software Developed when Booch, Rumbagh and Jacobson merged their approaches. In 1997 the Object Management Group (OMG) started the process of UML standardization

3 SEG4110 - Topic A- Review of UML3 Reminder about Naming classes Use capital letters —E.g. BankAccount not bankAccount Use singular nouns Use the right level of generality —E.g. Municipality, not City Make sure the name has only one meaning —E.g. ‘ bus ’ has several meanings

4 SEG4110 - Topic C - Advanced UML and Umple4 Umple A technology for programming in UML Model-Oriented Programming Adds associations and attributes to programming languages Java PHP Ruby Stand alone code-generator is online at http://cruise.site.uottawa.ca/umpleonline/index.php

5 SEG4110 - Topic C - Advanced UML and Umple5 Declaration of classes and attributes in Umple class Student { studentNumber; // defaults to String String grade; Integer entryAverage; // implemented as int } Open in UmpleOnline

6 SEG4110 - Topic C - Advanced UML and Umple6 Associations class Student { id; name; } class Course { description; code; } class CourseSection { sectionLetter; 1..* -- 1 Course; } association { * CourseSection; * Student registrant; } Open the above in UmpleOnline

7 SEG4110 - Topic C - Advanced UML and Umple7 Selected patterns class University { singleton; String name; } Open the above in UmpleOnline

8 SEG4110 - Topic A- Review of UML8 Reminder about Labelling associations Each association can be labelled, to make explicit the nature of the association

9 SEG4110 - Topic A- Review of UML9 Analyzing and validating associations 1 Many-to-one —A company has many employees, —An employee can only work for one company. -This company will not store data about the moonlighting activities of employees! —A company can have zero employees -E.g. a ‘shell’ company —It is not possible to be an employee unless you work for a company * worksFor EmployeeCompany 1

10 SEG4110 - Topic A- Review of UML10 Analyzing and validating associations 2 Many-to-many —A secretary can work for many managers —A manager can have many secretaries —Secretaries can work in pools —Managers can have a group of secretaries —Some managers might have zero secretaries. —Is it possible for a secretary to have, perhaps temporarily, zero managers? * supervisor *****1..* Assistant Manager

11 SEG4110 - Topic A- Review of UML11 Analyzing and validating associations 3 One-to-one —For each company, there is exactly one board of directors —A board is the board of only one company —A company must always have a board —A board must always be of some company 1 1

12 SEG4110 - Topic A- Review of UML12 Analyzing and validating associations Avoid unnecessary one-to-one associations Avoid thisdo this

13 SEG4110 - Topic A- Review of UML13 Association classes Sometimes, an attribute that concerns two associated classes cannot be placed in either of the classes The following are equivalent

14 SEG4110 - Topic A- Review of UML14 Reflexive associations It is possible for an association to connect a class to itself class Course { * prerequisite -- * Course successor; * self multuallyExclusive; } Open in Umple (the symmetric reflexive association doesn’t show graphically yet)

15 SEG4110 - Topic A- Review of UML15 Directionality in associations Associations are by default bi-directional It is possible to limit the direction of an association by adding an arrow at one end Open in Umple

16 SEG4110 - Topic A- Review of UML16 Object Diagrams A link is an instance of an association —In the same way that we say an object is an instance of a class

17 SEG4110 - Topic A- Review of UML17 Inheritance and the Isa Rule Inheritance The implicit possession by all subclasses of features defined in its superclasses Always check generalizations to ensure they obey the isa rule “ A checking account is an account ” “ A village is a municipality ” Should ‘ Province ’ be a subclass of ‘ Country ’ ? No, it violates the isa rule —“ A province is a country ” is invalid!

18 SEG4110 - Topic A- Review of UML18 Inheritance, Polymorphism and Variables

19 SEG4110 - Topic A- Review of UML19 Avoiding unnecessary generalizations rockbluesclassicaljazzmusic video videoaudio subcategory :RecordingCategory 9th Symphony :Recording Let it be :Recording The Beatles Beethoven Inappropriate hierarchy of classes, which should be instances Improved class diagram, with its corresponding instance diagram

20 SEG4110 - Topic A- Review of UML20 Avoiding having instances change class An instance should never need to change class

21 SEG4110 - Topic A- Review of UML21 A composition is a strong kind of aggregation —if the aggregate is destroyed, then the parts are destroyed as well Composition

22 SEG4110 - Topic A- Review of UML22 Interfaces An interface describes a portion of the visible behaviour of a set of objects. An interface is similar to a class, except it lacks instance variables and implemented methods

23 SEG4110 - Topic A- Review of UML23 OCL – More to come in a later lecture

24 SEG4110 - Topic A- Review of UML24 Use Case Diagrams

25 SEG4110 - Topic A- Review of UML25 Example of generalization, extension and inclusion

26 SEG4110 - Topic A- Review of UML26 Example Description of a Use Case

27 SEG4110 - Topic A- Review of UML27 Sequence diagrams – an example

28 SEG4110 - Topic A- Review of UML28 An iteration over objects is indicated by an asterisk preceding the message name Sequence Diagrams – an example with replicated messages

29 SEG4110 - Topic A- Review of UML29 If an object’s life ends, this is shown with an X at the end of the lifeline Sequence Diagrams – an example with object deletion

30 SEG4110 - Topic A- Review of UML30 State Diagrams – an Example of Transitions with Time-outs and Conditions

31 SEG4110 - Topic A- Review of UML31 State Diagrams – Example with Conditional Transitions - CourseSection class requestToRegister (aStudent) /createRegistration Closed classSize >= maximum cancel openRegistration Planned OpenEnoughStudents OpenNotEnoughStudents classSize >= minimum requestToRegister (aStudent) /createRegistration closeRegistration cancel Cancelled

32 SEG4110 - Topic A- Review of UML32 State Diagram – An Example with Substates CourseSection Class Again Open the previous page and this one in Umple

33 SEG4110 - Topic A- Review of UML33 Activity Diagrams – An Example – Course Registration

34 SEG4110 - Topic A- Review of UML34 Package Diagrams

35 SEG4110 - Topic A- Review of UML35 Example of Multi-Layer Systems

36 SEG4110 - Topic A- Review of UML36 Component Diagrams

37 SEG4110 - Topic A- Review of UML37 An Example of a Distributed System

38 SEG4110 - Topic A- Review of UML38 Example of a Broker System

39 SEG4110 - Topic A- Review of UML39 Example of a Pipe-and-Filter System - Sound Processing

40 SEG4110 - Topic A- Review of UML40 Example of the MVC Architecture for a User Interface

41 SEG4110 - Topic A- Review of UML41 Example of the Service-Oriented Architecture

42 SEG4110 - Topic A- Review of UML42 Abstraction-Occurrence

43 SEG4110 - Topic A- Review of UML43 Abstraction-Occurrence Square variant

44 SEG4110 - Topic A- Review of UML44 General Hierarchy

45 SEG4110 - Topic A- Review of UML45 Player-Role

46 SEG4110 - Topic A- Review of UML46 Singleton

47 SEG4110 - Topic A- Review of UML47 Observer

48 SEG4110 - Topic A- Review of UML48 Delegation

49 SEG4110 - Topic A- Review of UML49 Façade

50 SEG4110 - Topic A- Review of UML50 Proxy

51 SEG4110 - Topic A- Review of UML51 Deployment Diagrams


Download ppt "SEG4110 – Advanced Software Design and Reengineering TOPIC A Review of UML."

Similar presentations


Ads by Google