0% found this document useful (0 votes)
25 views7 pages

Mot So So Do Khac (Object, Composite Structure)

An object diagram shows the relationships between instances of classes at a point in time, using elements of a class diagram. It emphasizes object relationships and doesn't show anything architecturally different from class diagrams. A composite structure diagram shows the internal structure of a classifier including interactions with other system parts.

Uploaded by

Nhung
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views7 pages

Mot So So Do Khac (Object, Composite Structure)

An object diagram shows the relationships between instances of classes at a point in time, using elements of a class diagram. It emphasizes object relationships and doesn't show anything architecturally different from class diagrams. A composite structure diagram shows the internal structure of a classifier including interactions with other system parts.

Uploaded by

Nhung
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Object Diagrams (Sơ đồ đối tượng)

An object diagram may be considered a special case of a class diagram. Object


diagrams use a subset of the elements of a class diagram in order to emphasize the
relationship between instances of classes at some point in time. They are useful in
understanding class diagrams. They don’t show anything architecturally different to
class diagrams, but reflect multiplicity and roles.

Class and Object Elements


The following diagram shows the differences in appearance between a class element
and an object element. Note that the class element consists of three parts, being
divided into name, attribute and operation compartments; by default, object elements
don’t have compartments. The display of names is also different: object names are
underlined and may show the name of the classifier from which the object is
instantiated.

Run Time State


A classifier element can have any number of attributes and operations. These aren’t
shown in an object instance. It is possible, however, to define an object’s run time
state, showing the set values of attributes in the particular instance.
Ví dụ:
Login Controller Object Diagram
Composite Structure Diagram (Sơ đồ cấu trúc thành phần)
A composite structure diagram is a diagram that shows the internal structure of a
classifier, including its interaction points to other parts of the system. It shows the
configuration and relationship of parts that together perform the behavior of the
containing classifier.

Class elements have been described in great detail in the section in class diagrams.
This section describes the way that classes can be displayed as composite elements
exposing interfaces and containing ports and parts.

Part
A part is an element that represents a set of one or more instances which are owned
by a containing classifier instance. So, for example, if a diagram instance owned a set
of graphical elements, then the graphical elements could be represented as parts, if it
were useful to do so to model some kind of relationship between them. Note that a
part can be removed from its parent before the parent is deleted, so that the part isn’t
deleted at the same time.

A part is shown as an unadorned rectangle contained within the body of a class or


component element.

Port
A port is a typed element that represents an externally visible part of a containing
classifier instance. Ports define the interaction between a classifier and its
environment. A port can appear on the boundary of a contained part, a class or a
composite structure. A port may specify the services a classifier provides, as well as
the services that it requires of its environment.
A port is shown as a named rectangle on the boundary edge of its owning classifier.

Interfaces

An interface is similar to a class but with a number of restrictions. All interface


operations are public and abstract, and do not provide any default implementation. All
interface attributes must be constraints. However, while a class may only inherit from
a single super-class, it may implement multiple interfaces.

An interface, when standing alone in a diagram, is either shown as a class element


rectangle with the «interface» keyword and with its name italicized to denote it is
abstract, or it is shown as a circle.

Note that the circle notation does not show the interface operations. When interfaces
are shown as being owned by classes, they are referred to as exposed interfaces. An
exposed interface can be defined as either provided or required. A provided interface
is an affirmation that the containing classifier supplies the operations defined by the
named interface element and is defined by drawing a realization link between the class
and the interface. A required interface is a statement that the classifier is able to
communicate with some other classifier which provides operations defined by the
named interface element and is defined by drawing a dependency link between the
class and the interface.

A provided interface is shown as a "ball on a stick" attached to the edge of a classifier


element. A required interface is shown as a "cup on a stick" attached to the edge of a
classifier element.
Delegate

A delegate connector is used for defining the internal workings of a component's


external ports and interfaces. A delegate connector is shown as an arrow with a
«delegate» keyword. It connects an external contract of a component as shown by its
ports to the internal realization of the behavior of the component's part.

Collaboration
A collaboration defines a set of co-operating roles used collectively to illustrate a
specific functionality. A collaboration should only show the roles and attributes
required to accomplish its defined task or function. Isolating the primary roles is an
exercise in simplifying the structure and clarifying the behavior, and also provides for
re-use. A collaboration often implements a pattern.

A collaboration element is shown as an ellipse.


Role Binding
A role binding connector is drawn from a collaboration to the classifier that fulfils the
role. It is shown as a dashed line with the name of the role at the classifier end.

Represents
A represents connector may be drawn from a collaboration to a classifier to show that
a collaboration is used in the classifier. It is shown as a dashed line with arrowhead
and the keyword «represents».

Occurrence
An occurrence connector may be drawn from a collaboration to a classifier to show
that a collaboration represents (sic) the classifier. It is shown as a dashed line with
arrowhead and the keyword «occurrence».
Ví dụ:
Bank ATM Composite Structure Diagram

You might also like