Integration, Thu G. Falquet, L. Nerima
ISIISI June G. Falquet, L. NerimaClasses 2 Outline vThe AT3 statecharts vComplements: OCL and constraints, packages vInterfaces between the UML design spaces vMeta UML vExtending the UML: stereotypes vUML and databases vUML and XML vPublic domain tools and ressources vUML user survey vConclusion
ISIISI June G. Falquet, L. NerimaClasses 3 AT3 statechart version 1: the states
ISIISI June G. Falquet, L. NerimaClasses 4 AT3 statechart version 1
ISIISI June G. Falquet, L. NerimaClasses 5 Manage phone calls To manage phone calls, the telephone exchange is equipped with a system which allows the drivers to give their position by indicating the area in which they are idle with a vehicle. When a customer asks for a taxi, the operator assigns him or her a vehicle located in the area. If no taxi is in the area, it is necessary to find the closest vehicle. Manage calls Operator Vehicle Idle Booked Use caseObjects States Out of service
ISIISI June G. Falquet, L. NerimaClasses 6 Maintain Vehicle vAn increase in consumption will indicate that the engine need to be checked. vThe mechanics team takes in charge of the maintenance Mechanics Maintain vehicle Vehicle MotorOK NeedsChecking Maintenance Tanking Model
ISIISI June G. Falquet, L. NerimaClasses 7 Vehicle life cycle Idle Booked MotorOK NeedsChecking Maintenance Operating Out of service
ISIISI June G. Falquet, L. NerimaClasses 8 Object Constraint Language vText language to construct expressions for vguards vconditions vpre/post conditions vassertions vactions vBased on navigation expressions, boolean expressions, queries vPredefined operations on primitive types and sets of objects vConstraints can be attached to any element (class, association, attribute, etc.)
ISIISI June G. Falquet, L. NerimaClasses 9 Navigation expressions vobject(s). attribute vobject(s). role vobject(s). operation(arguments) vobject(s). qualified_association [ selector ] vset -> set_property vset -> select (condition) vset -> size
ISIISI June G. Falquet, L. NerimaClasses 10 Examples Flight Pilot Person passengers Assignment pilot Booking (flight.passengers -> select(age size < 5 (flight.pilot.training_hours >= flight.plane.min_training AircraftModel plane flight
ISIISI June G. Falquet, L. NerimaClasses 11 Objets physiques Diagram dependencies Objects Classes Use Cases Collaborations Sequences State Machine Activity Components Deployment includes, extends perform method spec. placement on nodes synchronising dependencies instances instance of
ISIISI June G. Falquet, L. NerimaClasses 12 Package v« A package is a general purpose mechanism for organizing elements into groups » vAim: organize a UML model vA package contains structural things, behavioral things and other packages vPackage nesting results in a tree structure (analogy: file system with folders) vPackaging + Control of visibility = Control of the complexity of large numbers of abstractions
ISIISI June G. Falquet, L. NerimaClasses 13 Package : graphic representation vIcon: Tabbed folder vIncludes: vpackage name vContents (sometimes) vExamples Business rules Sensors::Vision {version = 2.24 } Client + OrderForm + TrackingForm - Order
ISIISI June G. Falquet, L. NerimaClasses 14 Package: importing vExample vClient imports Policies Client + OrderForm + TrackingForm - Order Policies + OrderRules « import »
ISIISI June G. Falquet, L. NerimaClasses 15 Package: generalization vTo specify a family of packages WindowGUI + GUI::Window + Form # GUI::EventHandler + VBForm MacGui GUI + Window + Form # EventHandler
ISIISI June G. Falquet, L. NerimaClasses 16 Meta UML vClass diagram of all UML elements Class, Association, State, State Machine, Attribute, etc. vFormal (structural) description of the model vA model to build UML editors and other tools vA model to represent UML models in a database
ISIISI June G. Falquet, L. NerimaClasses 17
ISIISI June G. Falquet, L. NerimaClasses 18
ISIISI June G. Falquet, L. NerimaClasses 19
ISIISI June G. Falquet, L. NerimaClasses 20
ISIISI June G. Falquet, L. NerimaClasses 21 Stereotypes vAn extension mechanism vSpecialise existing UML elements (adding constraints) Class > Class > Class State > State > Class
ISIISI June G. Falquet, L. NerimaClasses 22 UML and Databases vIdea: store objects in relational databases vTransformation rules vClass relation vAttribute attribute vAssociation attribute or relation (depending on multiplicity) vOperations database triggers / procedures / programming language procedures
ISIISI June G. Falquet, L. NerimaClasses 23 UML and XML vXML vXML Schemas vFrom XML to UML vFrom UML to XML vModelling XML applications vExchanging UML models
ISIISI June G. Falquet, L. NerimaClasses 24 XML document vObjective of XML : describe the content (semantics), not the presentation. vDocuments vMade of Elements vSub elements (children elements) vAttributes with Values v"Schemaless" documents (semi-structured) vDocuments obeying to a schema
ISIISI June G. Falquet, L. NerimaClasses 25 Document Example Finding paths in a graph Given the graph … There are...
ISIISI June G. Falquet, L. NerimaClasses 26 XML Documents are Hierarchical exercise title question answer para Finding paths in a graph Given a connected graph with... Find the... ….. There are... difficulty = 6 para
ISIISI June G. Falquet, L. NerimaClasses 27 XML Schemas vTo fix a syntax for XML documents vDTD : document type definition (old) vXML Schemas (new) vdefine a class of XML documents va document is an instance of a schema vmore flexible than database or class schemas: alternatives, options, free ordering, etc.
ISIISI June G. Falquet, L. NerimaClasses 28 po.xml Alice Smith 123 Maple Street Mill Valley CA Robert Smith 8 Oak Avenue Old Town PA 95819
ISIISI June G. Falquet, L. NerimaClasses 29 po.xml (cont.) Hurry, my lawn is going wild! Lawnmower Confirm this is electric Baby Monitor
ISIISI June G. Falquet, L. NerimaClasses 30 Schema: po.xsd
ISIISI June G. Falquet, L. NerimaClasses 31 po.xsd (cont.)
ISIISI June G. Falquet, L. NerimaClasses 32
ISIISI June G. Falquet, L. NerimaClasses 33 From XML Schemas to UML vSituation: an XML schema has been adopted vObjective: vto build applications that process this type of XML data vUse UML to model the application vNeed to represent XML data (elements) as UML objects vMapping XML schemas to UML class model
ISIISI June G. Falquet, L. NerimaClasses 34 Mapping technique [Booch et al.] vAdd class stereotypes: velementtype, sequence, choice, enumeration, scalar,... vAdd attribute / unidirectional association stereotypes: vimplied, required,... vElement or datatype --> class with stereotype vXML attribute --> attribute / unidirectional association
ISIISI June G. Falquet, L. NerimaClasses 35 UML for Document Modelling vDifficult to design good XML schemas --> vUse UML to model the domain vProduce a class diagram vThen create a suitable XML schema Project title Person firstName lastName Department name... Manager Participant
ISIISI June G. Falquet, L. NerimaClasses 36 An XML Schema <xsd:element name="participant" type="PersonType minOccurs="1" maxOccurs="unbounded"/>
ISIISI June G. Falquet, L. NerimaClasses 37 Objects --> XML Document Restructuring the World Joe Cool Toys...
ISIISI June G. Falquet, L. NerimaClasses 38 Issues vMany possible mappings from UML to XML vClass --> complex or simple type vDefine elements or types vAssociations --> vInclusions ( … … ) vReferences (...) vetc. v"Solution": fix a reverse mapping
ISIISI June G. Falquet, L. NerimaClasses 39 XML for Information Interchange vSystem modelled with UML vCreate an XML schema to represent all data vExport data in XML format vImport XML data into another system vWeb browser vPresentation generator (PDF,...) vGraphics generator
ISIISI June G. Falquet, L. NerimaClasses 40 A Book Modeling XML Applications with UML: Practical e- Business Applications David Carlson Addison-Wesley Object Technology Series
ISIISI June G. Falquet, L. NerimaClasses 41 Exchanging UML models vThere exist an XML schema for expressing UML models (XMI) v--> UML specifications are open and exchangeable vUML tools (diagram editors, code generators, pretty printers, …) should be able to read/write UML specs in XML
ISIISI June G. Falquet, L. NerimaClasses 42 OMG survey on using the UML vDate: 2000 vQuestions: vWhat constructs in the language are most used ? vWhat parts of the language need clarification ? vWhat parts of the language should be removed ?
ISIISI June G. Falquet, L. NerimaClasses 43 OMG survey on using the UML Most used Least used Need clarification vClass diagrams> 8 vsequence diagram7-8 vuse cases7-8 vstate charts5-6> 8 vstereotypes and tagged values 1-2 vPackage1-2 vimplementation diagrams vcollaboration diagrams vactivity diagram 0 > 81-2 vmodel management - except package vComponent vpattern 0 1-2
ISIISI June G. Falquet, L. NerimaClasses 44 OMG survey on using the UML (cont) Most used Least used Need clarification vclass, type, interface, classifier role, component vwhole-part relationships0 3-4
ISIISI June G. Falquet, L. NerimaClasses 45 What parts of the language should be removed? vUML standard profiles 3-4 vNotes in semantics section1-2 vStandard elements without abstract semantics1-2
ISIISI June G. Falquet, L. NerimaClasses 46 Application in industry Level of usage ( 1 – 5 ) vClass and package5 most used vuse case3 depend on the culture. Less interesting for some fields. vsequence3 quite often used, well understood vcollaboration 2 object diagram used, but collaboration modeling marginal vstatecharts2 strong usage in real time applications, rarely used in the sevice industries vactivity1 introduced late in the environments, local cultural habit in some sectors of the sevice industries vcomponent/deployment 1 only few people use it, on a few parts of their applications
ISIISI June G. Falquet, L. NerimaClasses 47 Conclusion vWe presented almost all the features of the UML ! (omitting details) vModeling is important vModel in several dimensions to have a comprehensive and complete view of your system vNext: exercice on a small but real application (in your domain of course) vStart with the diagrams you feel confortable with vPractice structural AND dynamic modeling v… we hope you learned some valuable information on the UML