120 likes | 124 Views
Unified Modeling Language User Guide. Section 3 - Advanced Structural Modeling Chapter 13 – Instances Chapter 14 – Object Diagrams. Overview. Instances and Objects Modeling Concrete Instances Modeling Prototypical Instances Modeling Object Structures Forward and Reverse Engineering.
E N D
Unified Modeling LanguageUser Guide Section 3 - Advanced Structural Modeling Chapter 13 – Instances Chapter 14 – Object Diagrams
Overview • Instances and Objects • Modeling Concrete Instances • Modeling Prototypical Instances • Modeling Object Structures • Forward and Reverse Engineering CS6359 Chapter 12
Instances • The terms “instance” and “object” are largely synonymous; for most part, they may be used interchangeably/ yg dpt dipertukarkan. • Use instances to model concrete or prototypical things that live in the real world. • Transient: specifies that an instance is created during execution of the enclosing interaction but is destroyed before completion of execution (a standard constraint that applied to objects). CS6359 Chapter 12
Abstractions & Instances • Instances don’t stand alone: they are almost always tied to an abstraction. • Instances of: • Classes (objects) • Components, nodes, use cases, and associations • To indicate an instance, you underline its name. CS6359 Chapter 12
myCustomer id : SSN = “432-89-1738” active = True agent : Other Concepts anonymous instance named instance myCustomer : Multimedia :: AudioStream t : Transaction : keyCode c : Phone [WaitingForAnswer] Orphan/yatim instance multiobject instance with attribute values r : FrameRenderThread active object instance with explicit state CS6359 Chapter 12
Modeling Concrete Instances (steps) • Identify the instances necessary/ kebutuhan and sufficient to model the system. • Render these objects in the UML as instances; give meaningful names if possible or render it as an anonymous object. • Expose the stereotypes, tagged values, and attributes. • Show these instances and their relationships in an object diagram. CS6359 Chapter 12
Modeling Prototypical Instances (steps) • Identify those prototypical instances necessary and sufficient to model the system. • Render these objects in the UML as instances; give meaningful names if possible or render it as an anonymous object. • Expose the properties of each instance. • Show these instances and their relationships in an interaction diagram or an activity diagram. CS6359 Chapter 12
Object Diagrams • Object diagrams model the instances of things contained in class diagrams. • Shows a set of objects and their relationships at a point in time. • Used to model the static design view or static process view of a system. • Shows a snapshot of the system at a moment in time and rendering a set of objects, their state, and their relationships. CS6359 Chapter 12
d1 : Department name = “Sales” d2 : Department name = “R&D” d3 : Department name = “US Sales” : ContactInfomation address = “1472 Miller St.” p : Person name = “Erin” employeeID = 4362 title = “VP of Sales” An Object Diagram c : Company link attribute value object anonymous object manager CS6359 Chapter 12
Modeling Object Structures (steps) • Identify the mechanism. • For each mechanism, identify classes, interfaces, and other elements that participate in this collaboration; identify the relationships among these things. • Consider one scenario that walks through this mechanism. Freeze that scenario at a moment in time and render each object that participate in the mechanism. • Expose the state and attribute values of each object. • Expose the links among these objects CS6359 Chapter 12
Forward & Reverse Engineering • Forward engineering an object diagram: possible but limited value. • Reverse engineering an object diagram: very useful in debugging process. • Choose the target and walk through a scenario • Identify the set of objects that collaborate in that context. • Expose these object’s states attribute values and links among these objects. CS6359 Chapter 12
Summary • Instances • Abstractions & Instances • Modeling Concrete Instances • Modeling Prototypical Instances • Object Diagram • Modeling Object Structures • Forward and Reverse Engineering CS6359 Chapter 12