Wednesday, July 25, 2007

Modeling objects, links, Composite Structure diagram, connectors and ports, collaboration

Object diagram is the UML tool for modeling an example.
Class diagram models definitions and rules.

Modeling a test case requires the means to represent specific data, relationships, and behaviors.

Object diagram is ideally suited to model the data and relationships of the test cases.
Interaction diagrams model the behavior. it describe how objects use one another's services.


Modeling objects and links
Object notation
requires the name of the object and the name of the class that describes the object.

format: object-name : class-name

The Class diagram defines the attributes that must be used to define each type of object and the behaviors that each type of object must support.
The Object diagram has only two compartments: name and attribute
The attribute compartment defines only the current value of each attribute.



Figure 7-8: UML object notation for one customer who has placed two orders.


Modeling Composite Structure diagram

models the parts of a class, component, or collaboration, including interaction points(ports) used to access features of the structure.

Collaboration describes a behavior, the resources used to perform the behavior, and the roles the resources assume during the behavior.


The Composite Structure diagram models a class as a large rectangle with the class name in a compartment at the top of the rectangle


Modeling connectors and ports

The small squares at the ends of the connectors model ports, the points of contact between the connector and the object. A Port defines a distinct interaction point on the object.
Set of interfaces defines the port. The sum of the ports and associated services defines the boundary of the object.

Ports come in two types

-signal - if isSignal attribute is true, it may only relay signals.

-service - it defines the services provided by the classifier. if isService is false, the port is not part of the externally published features of the classifier, and it may be changed or deleted without altering the definition of the classifier.


Modeling a collaboration

Represents how elements of the model cooperate to perform some essential behavior. The participating elements may include classes and objects, associations and links, attributes and operations, interfaces, use cases, components, and nodes. The behavior may be a use case, an operation, a collection of operations, or a general mechanism of the system.
One common use for collaborations is to model design patterns.
Within a collaboration, the dependency arrow is called a connector. The connector binds a role to a model element. The collaboration defines the roles.

No comments: