1 / 60

Introduction to the Unified Modeling Language (UML)

Introduction to the Unified Modeling Language (UML). Delos NoE , Preservation Cluster Workshop: Persistency in Digital Libraries 13. February 2006, Oxford Internet Institute. Introductory Quotations. 1.

wray
Télécharger la présentation

Introduction to the Unified Modeling Language (UML)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Introduction to the Unified Modeling Language (UML) Delos NoE , Preservation Cluster Workshop: Persistency in Digital Libraries 13. February 2006, Oxford Internet Institute

  2. Introductory Quotations 1 „Nobody, not even the creators of UML, understand or use all of it. Most people use a small subset of the UML and work with it.“ „UML is so complex that the standard is often open to multiple interpretations.“ „People do adopt conventions both in the industry widely and within a particular project.“ (Martin Fowler, „UML Destilled“)

  3. UML – what is it good for? 2 • Visualisation: graphical representation of structures and processes • Specification: Building models that are precise, unambigous and complete • Construction: Converting UML-models into programming code • Documentation: Illustration and mapping of systems architecture, requirements analysis, managing different versions of systems or parts of it

  4. Basic concepts: What is an object? 3 An object can be A thing, e.g., car, office, book A person, e.g., librarian, director A term, e.g., programming language, disease Synonymously, it is also called instance.

  5. 4 An object can be featured by • State • Behaviour • Identity

  6. 5 UML Representation of an object elisabeth elisabeth:Cow :Cow object:Class

  7. Object: State 6 The state of an object includes its attributes and its relationships to other objects. An attribute can have a value. :Cow :Cow Object:Class Colour = brown Age Colour : string Age : integer = 5 Attribute : type= value

  8. 7 Objects perhaps „know“ each other, that is there is some kind of relationship between the objects. Depending on the context, a relationship is called link or association or generalisation. Examples: Cow ‚Elisabeth‘ is the daughter of cow ‚Victoria‘. Cow ‚Elisabeth‘ is suckling from ‚Victoria‘. A calf is a young cow.

  9. Object: Behaviour 8 The behaviour of an object is described through one or more operations. They enable us to modify or request the object's state. getDigitalObject() loadData()

  10. Object: Identity 9 Every object has a distinct identity that is defined through its existence. :Person :Person :Person :Person Name=Michael Name=Mary Name=Michael Name=Linda Identity „Pseudo-Identity“ :Person :Person :Person Name=John Name=John Name=John

  11. Object Diagram 10 The relations between objects can be visualised using an Object Diagram. An Object Diagram describes objects, links and optionally attributes and their values at a specific point in time. An Object Diagram is a snaphot of a system or parts of it.

  12. 11 Example Charles:Cow Victoria:Cow Sex = m Age = 10 Elisabeth:Cow

  13. Class 12 A class represents a collection of objects. It defines the data structure (attributes), behaviour (operations) and relationships of the single objects. Every object belongs to exactly one class.

  14. 13 UML representation of a class Class :DigitalObject :DigitalObject ID=1234 DOType : Integer REFNO=Q34R ID=5678 DOType : Integer REFNO=Q56S Attribute ID=1234 DOI=123.456 REFNO=Q34R Operation Class DigitalObject ID DOType REFNO Class Class Class Attribute Operation getDigitalObject()

  15. Attribute 14 Attributes describe the properties of an object (class). Attributes represent the data structure of an object (class). All objects of a class share the same attributes. They differ in the values of the particular attributes. Every attribute has a distinct type.

  16. 15 UML syntax for attributes Attribute DigitalObject attribute attribute: type attribute: type {property string} attribute: type = Inital value attribute: type [x..y] class scope attribute /derived attribute type attribute ID ID: int ID: int {read only} ID: int = 1234 ID: int [1] ID / ID int ID not normative!

  17. Operation 16 Operations are the actions that a class (the objects of a class) can carry out. All objects of a class use the same operations. All operations together represent the behaviour of the class (the objects).

  18. Operation 17 UML syntax for operations name (parameter-list) : return-type {property-string} assignID (int: ID) : void {read-only}

  19. Association 18 Objects can be linked to each other. Classes can also be linked. This is called association. :DigitalObject :Date :DigitalObject :Date DigitalObject Date association

  20. 19 Binary / Reflexive Association DigitalObject Collection 1..* 1 Binary A. DigitalObject Reflexive A.

  21. 20 Multiplicity Multiplicities enable to model the number of possible links between objects of classes. Multiplicities DigitalObject Collection 1..* 1

  22. 21 Examples for multiplicities exactly one 1 one or none 0..1 uspecified number * n to many 2..* n to n 12..49

  23. 22 An association can be labeled by using a verb phrase: DigitalObject Collection 1..* 1 is part of

  24. 23 An association can also be labeled by a property name (role). DigitalObject master 1 1..3 copy property names

  25. 24 Associations can be completed by constraints. constraint DigitalObject master 1 1..3 {integrity checked} copy

  26. 25 Aggregation and Composition Aggregation and Composition are concepts for modelling a „whole-part“ relationship. Example: „ A page is part of a book.“ They are both special kinds of association. They can also always be expressed as simple associations.

  27. 26 Aggregation UML syntax: Collection DigitalObject aggregation partial class aggregated class

  28. 27 Collection DigitalObject 1..* 1..* Collection DigitalObject 1..* 1..* is part of

  29. 28 Composition UML syntax: Collection DigitalObject composition partial class aggregated class

  30. 29 Collection DigitalObject 1..* Collection DigitalObject is part of 1 1..* Page Book 273 title=„UML“

  31. 30 Navigability of associations The navigabilty specifies the access to objects of given classes. unspecified classX classY unidirectional classX classY bidirectional classX classY excluded navigability classX classY

  32. 31 Properties modelled as attributes or associations DigitalObject Digital Object ID: int [1] created: Date [1..*] composed: File [1..*] 1 1 1 1..* Date File

  33. Generalisation 32 A generalisation describes a relationship between a super class and a sub class. The sub class is a specialised class in regard of the super class. It is entirely consistent with the super class, but it adds some additional attributes or operations. Every object of the sub class can be described with an „is a“ relationship.

  34. 33

  35. Abstract Class 34

  36. Package 35 A package is used to merge elements of models, especially classes. They can be grouped in practicable units. Packages are a good concept for describing the structure of a system on an abstract level. A complete software system is at its highest level one big package.

  37. 36

  38. Additional features 37 Visibility Attributes and operations within a class can be labeled by a visibility indicator. The same is valid for roles in associations. Most common are „+“, that stands for public and „-“ that stands for private. Public elements can be used by any other class, private elements only by the class that owns them.

  39. 38 Notes There is a possibility to insert comments into any UML diagram using the following graphical elements:

  40. 39 Visibility: Attribute, Operation and property name DigitalObject DigitalObject * + copy - ID - RefNo - CatType - checkIntegrity() * + getDigitalObject() AccessUnit

  41. 40 Dependency A dependency indicates changes to one element caused by changes of the other. UML allows the usage of dependencies for all sorts of elements. AccessUnit DigitalObject dependency

  42. 41 Dependencies can be detailed using a keyword. <<call>> AccessUnit DigitalObject

  43. 42 Often, relationships imply dependencies. * * AccessUnit DigitalObject Report Document

  44. Class diagram 43 „If someone were to come up to you in a dark alley and say, ‚Psst, wanna see a UML diagram?‘ that diagram would probably be a class diagram.“ (Martin Fowler, „UML Destilled“)

  45. Class Diagram 44 The Class Diagram represents a static view of a system. Therefore Class Diagrams are often used to model structural issues like the architecture of a system or parts of it. The Class Diagram models single components of the system or parts of it and describes its relationships. It can be a starting point for transforming the systems model into programming code.

  46. 45 Example 1 – Part of system architecture Source: http://bdn.borland.com/

  47. 46 Example 2 - Conceptual Model: Taxonomy Source:http://www.agilemodeling.com

  48. 47 Example 3 – Producing software class Person { protected string name; public void generateAddress();} class Foreigner extends Person {} class Citizen extends Person {}

  49. More static views 48 Package Diagram Package diagrams are often used to show the static structure of large systems on a high level. <<call>>

  50. Behavioural and Dynamic Aspects: More UML Diagrams 49 So far we regarded the static and structural side of systems. UML offers some more diagrams for modelling behavioural and dynamic aspects of systems. Behavioural diagrams show systems in action.

More Related