the unified modelling language
play

The Unified Modelling Language Perdita Stevens - PDF document

The Unified Modelling Language Perdita Stevens (Perdita.Stevens@dcs.ed.ac.uk, http://www.dcs.ed.ac.uk/home/pxs/) Division of Informatics University of Edinburgh Slide 1 Objectives A t the end of to da y: y ou will kno w what


  1. The Unified Modelling Language Perdita Stevens (Perdita.Stevens@dcs.ed.ac.uk, http://www.dcs.ed.ac.uk/home/pxs/) Division of Informatics University of Edinburgh Slide 1 Objectives A t the end of to da y: y ou will kno w what UML is for and its history in brief; � y ou will ha v e seen examples of all the main features of UML (though not some � of the more esoteric bits) y ou will b e able to read and write simple UML mo dels � w e will all understand more ab out the researc h agenda around UML. � Do ask questions and commen t... Slide 2 � c P erdita Stev ens 2000 ET APS2000 UML T utorial 1

  2. What is a modelling language? A language for describing mo dels of systems. A mo del describ es an asp e ct of the system at a c ertain level of abstr action : for example, the class mo del describ es the classes and their (static) relationships, without b eing concerned with requiremen ts. Mo delling languages are usually diagramm atic, b ecause p eople seem to �nd this natural. Soft w are engineers are used to the idea that programming languages ha v e formally de�nable syn tax and seman tics: a program ma y b e legal or not and has a (fairly) certain meaning. Mo delling languages are no di�eren t ! Slide 3 Why do we model systems? Tw o main reasons: T o help talk ab out, think ab out and w ork with them b efore and as w e build � them: in this case the mo del is an abstraction of a larger amoun t of kno wledge ab out the system; In order to b e able to use them; in this case w e w an t to b e able to use the � abstraction(s) without needing to kno w more. The purp oses are related esp ecially in CBD: one design criterion for a go o d comp onen t is that p eople can understand ho w to use it. Must a v oid dev eloping mo dels that are not useful! Slide 4 � c P erdita Stev ens 2000 ET APS2000 UML T utorial 2

  3. What is a good modelling language? It should b e: 1. Expressiv e enough: that is, w e can express imp ortan t asp ects of the design, and w e can meaningfully re�ect c hanges in the design whic h w e mak e during analysis and design as c hanges in the mo dels 2. Easy enough to use, so that it aids clear though t rather than getting in the w a y 3. Widely used? 4. Supp orted b y suitable to ols? 5. Unam biguous Slide 5 Models of a system W e will w an t to distinguish mo dels on sev eral axes. F or example: A static mo del describ es the elemen ts of the system and their relationships � A dynamic mo del describ es the b eha viour of the system o v er time � Again, w e ma y tak e a lo gic al view: whic h parts notionally b elong together? � physic al view: whic h parts will run on the same computer? � W e probably w on't need to �ll in all the squares... Slide 6 � c P erdita Stev ens 2000 ET APS2000 UML T utorial 3

  4. 4+1 Philipp e Kruc h ten logical view: ho w do es the system satisfy the functional requiremen ts? � pro cess view: what are the threads of con trol? � dev elopmen t view: ho w can the system sensibly b e built? � ph ysical view: ho w will the soft w are b e deplo y ed on hardw are? � plus the use case view: what should the system ac hiev e? Slide 7 History of UML 1990s: man y di�eren t OO dev elopmen t metho ds eac h with their o wn mo delling language, including Bo o c h's OOD � Rum baugh's OMT � Jacobson's OOSE and Ob jectory � 1994 Rum baugh joined Bo o c h's compan y Rational 1995 Jacobson joined Rational: announcemen t of Uni�ed Metho d, so on replaced b y Uni�ed Mo deling Language. UML1.1 adopted b y OMG No v em b er 1997, follo w ed b y UML 1.3 in June 1999. Man y �a ws, but ob viously going to dominate. Slide 8 � c P erdita Stev ens 2000 ET APS2000 UML T utorial 4

  5. By the way... Notice signi�cance of ha ving UML instead of Uni�ed Metho d: UML tells y ou nothing ab out ho w to dev elop a system. UML is not a dev elopmen t metho d. In the same sense, C++ tells y ou nothing ab out ho w to write programs. Certain strings of sym b ols are legal C++ programs; a certain C++ program has a (fairly) certain meaning; but the language do es not tell y ou ho w to write the program. Nev ertheless there is a discipline of C++ programming. Some asp ects are con tro v ersial, others more or less agreed. Same with UML: w e could discuss some agreed asp ects, and some approac hes to more con tro v ersial asp ects... Slide 9 Present and future of UML As of 11/2/00, the UML Revision T ask F orce page lists 3316 issues, ranging from trivial misprin ts to fundamen tal �a ws. Around 50 outstanding. Curren t v ersion of UML is 1.3 (June 1999). Tw o revision pro cesses ongoing: Minor revision, 1.4 � Ma jor revision, 2.0 � ( Bew Bo o c h Jacobson and Rum baugh's UML User Guide sa ys it's up to date are: with resp ect to 1.3 { this is based on a mistak en an ticipation of when that w ould app ear!) Slide 10 � c P erdita Stev ens 2000 ET APS2000 UML T utorial 5

  6. Books and other resources V ast range. Extremes: Using UML: textb o ok aimed at studen ts, ev en inexp erienced ones � The o�cial sp eci�cation, whic h mak es no concessions. � There are also h uge n um b ers of b o oks aimed at professionals. Tw o deserv e sp ecial men tion: Bo o c h Jacobson Rum baugh UML User Guide, Reference, and Pro cess b o ok. � F o wler UML Distilled � W eb sites: v arious, including OMG, Rational, UML R TF. See m y b o ok page (www.dcs.ed.ac.uk/home/p xs/Bo ok/) for links. Slide 11 What is an object? Something y ou can do things to. An ob ject has state, b eha viour and iden tit y . State can a�ect b eha viour. Beha viour can a�ect state. Ob jects comm unicate b y sending messages: the b eha viour of an ob ject on receipt of a message is \up to the ob ject". A class de�nes the structure and b eha viour of similar ob jects. (That is, their implementation , not just the interfac es they pro vide.) Slide 12 � c P erdita Stev ens 2000 ET APS2000 UML T utorial 6

  7. A class Book A class as design en tit y is an example of a mo del elemen t : the rectangle and text form an example of a corresp onding presen tati on elemen t . UML explicitly separates concerns of actual sym b ols used vs meaning. Slide 13 An object jo : Customer This pattern generalises: alw a ys sho w an instance of a classi�er using the same sym b ol as for the classi�er, lab elled instanceName : classi�erName . Slide 14 � c P erdita Stev ens 2000 ET APS2000 UML T utorial 7

  8. Classifiers and instances An asp ect of the UML metamo del (more anon) that it's helpful to understand up fron t. An instance is to a classi�er as an ob ject is to a class: instance and classi�er are more general terms. (In the metamo del, Class inherits from Classi�er, Ob ject inherits from Instance.) W e'll see man y other examples of classi�ers. Slide 15 Showing attributes and operations Book title : String copiesOnShelf() : Integer borrow(c:Copy) Notice ho w argumen t t yp es and return t yp es are sho wn (can b e adapted for di�eren t programming languages.) They ma y b e omitted (together) { o ddly though, the formal parameter name is compulsory when the argumen t list is giv en. Slide 16 � c P erdita Stev ens 2000 ET APS2000 UML T utorial 8

  9. Visibility Book + title : String - copiesOnShelf() : Integer # borrow(c:Copy) Can sho w whether an attribute or op eration is public (visible from ev erywhere) with + � priv ate (visible only from inside ob jects of this class) with � � (Or protected, with hash, or other language dep enden t visibilit y .) Can sho w abstr act op eration or class using italics for the name. Can add further lab elled compartmen ts for other purp oses (e.g. resp onsibilities.) Slide 17 Association between classes is a copy of Book Copy This generalises: asso ciation b et w een classi�ers is alw a ys sho wn using a plain line. An instance of an asso ciation connects ob jects (e.g. Cop y 3 of W ar and P eace with W ar and P eace). An ob ject diagram con tains ob jects and links: o ccasionally useful. (Ho w ev er in the metamo del an asso ciation is not a classi�er...) Slide 18 � c P erdita Stev ens 2000 ET APS2000 UML T utorial 9

Recommend


More recommend