CSE870: (Cheng)CSE870: Advanced SoftwareEngineering: Extending and Using UML(Cheng, Sp2003) 1CSE870: Advanced Software Engineering: Extending and Using UML (Cheng)RRRSupplementary:Using and Extending UMLCSE870: Advanced Software Engineering: Extending and Using UML (Cheng)RRRExtensibility Mechanisms• Stereotypes• Tagged Values• ConstraintsActionQueue<<container>>{version = 3.2}add(a: Action)remove(n: Integer){add runs in O(1) time}CSE870: Advanced Software Engineering: Extending and Using UML (Cheng)RRRStereotypes• Extends the UML vocabulary• Create new building blocks derived fromexisting ones,– specific to problem domain– Example: Sensors for embedded systems,<<sensor>>thermometertempread<<sensor>>Voltage metervoltreadCSE870: (Cheng)CSE870: Advanced SoftwareEngineering: Extending and Using UML(Cheng, Sp2003) 2CSE870: Advanced Software Engineering: Extending and Using UML (Cheng)RRRTagged Values• Extends properties of UML buildingblock• Create new information in thatelement’s spec• Example: {version, author values forSoftware Class}<<sensor>>Voltage metervoltread{reader=J. Smith}EventQueue{version =3.2Author = bhcadd()remove()flush()CSE870: Advanced Software Engineering: Extending and Using UML (Cheng)RRRConstraint• Extends the semantics of a UMLbuilding block• Add new rules or modify existing ones– Example: {ordered constraint on an addoperation for a Queue}<<sensor>>Voltage metervoltread{reader=J. Smith}{read before thermostat check}CSE870: Advanced Software Engineering: Extending and Using UML (Cheng)RRRInterface• Interface: collection of operations thatspecify a service of a class orcomponent– Externally visible behavior of that element– Set of operation specs (signatures)– Not a set of operation implementationsCSE870: (Cheng)CSE870: Advanced SoftwareEngineering: Extending and Using UML(Cheng, Sp2003) 3CSE870: Advanced Software Engineering: Extending and Using UML (Cheng)RRRInterface Example• Interface specifies desiredbehavior of an abstractionindependent ofimplementation• Specifies contract• May also create stereotypeto further define behavior– No attributes– Only operations• (visibility, concurrency,stereotypes, etc.)• Naming convention:– I-Simple name OR– Prefixed by source packageWordsmith.dllISpellIThesaurusIUnknown<<interface>>URLStreamHandleropenConnection()Parse URL()setURL()toExternalForm()OperationsCSE870: Advanced Software Engineering: Extending and Using UML (Cheng)RRRDependency Relationship• Definition:– some set of model elements requires presence of anotherset of model elements– for semantic completeness or correctness• Examples:– <<realize>>: between type and class– <<trace>>: analysis class and design class– <<create>>: source class creates a target class instance– <<access>>: permission of one pkg to access publicelements of another– <<bind>>: reln between parameterized model elt with formalparameter list and that model elt bound to actualparameters. (e.g., templates in C++)CSE870: Advanced Software Engineering: Extending and Using UML (Cheng)RRRDependency ExampleQueueBasetype, sizeQueueString, 400Integer Queue<<bind> <integer, 1000>>Explicit ParameterizationFormal parameter listActual parameter listCSE870: (Cheng)CSE870: Advanced SoftwareEngineering: Extending and Using UML(Cheng, Sp2003) 4CSE870: Advanced Software Engineering: Extending and Using UML (Cheng)RRRMetamodelsCSE870: Advanced Software Engineering: Extending and Using UML (Cheng)RRRClass Diagram MetamodelCSE870: Advanced Software Engineering: Extending and Using UML (Cheng)RRRUML Profile• Official way to define customized UMLfor specific purpose/domain.• Use UML extension elements(stereotypes and tags) to definelanguage/modeling elements.– Elements, Attributes, Methods, Links, LinkEnds, etc.CSE870: (Cheng)CSE870: Advanced SoftwareEngineering: Extending and Using UML(Cheng, Sp2003) 5CSE870: Advanced Software Engineering: Extending and Using UML (Cheng)RRRWhat can be included in a ProfileSupported TypesSupported AttributesCSE870: Advanced Software Engineering: Extending and Using UML (Cheng)RRRExample Profiles• XML Profile (creating XSD Schemas)• Web application profile• Business process modeling profile• More profiles:– CORBA IDL, Enterprise Application Integration, Faulttolerance and QoS, Distributed Object Computing,Schedulability and performance, system on chip, systemsengineering, testing.– http://www.omg.org/technology/documents/profile_catalog.htm• Tool Support:– IBM has Enterprise Architecture that supports the definitionof
View Full Document