3. Advanced Classes
In UML, following are the different ways to implement
class as a classifier
A Classifier is a mechanism that describes structural and
behavioral features.
Include classes, associations, interfaces, datatypes, signals,
components, nodes, use cases and subsystems.
A Class is a description of a set of objects that share the
same attributes, operations, relationships, and semantics.
4. Advanced Classes
Interface : collection of operations used to specify a
service of a class or a component.
Datatype : Including primitive built-in types as well as
enumeration types (such as Boolean). Also immutable.
Association : A description of a set of links, each of which
relates two or more objects.
Signal : The specification of an asynchronous message
communicated between instances.
5. Advanced Classes
Component : A modular part of a system that hides its
implementation behind a set of external interfaces.
Node : a physical element that exists at run time and
that represents a computational resource, generally having
at least some memory and often processing capability.
Use case : A description of a set of a sequence of actions,
including variants, that a system performs that yields an
observable result of value to a particular actor.
Subsystem A component that represents a major part of a
system.
7. Advanced Classes
With the advanced classes, we can specify visibility for an
attribute or operation in any of four levels.
Public : Any outside classifier with visibility to the given
classifier can use the feature, specified by the symbol +.
Protected : Any descendant of the classifier can use the
feature; specified by prepending the symbol #.
Private : Only the classifier itself can use the feature;
specified by prepending the symbol -.
Package : Only classifiers declared in the same package
can use the feature; specified by prepending the ~.
9. Interfaces
Collection of operations used to specify a service.
Specify a behavior of an a element (class or component)
independent of its implementation.
Important for large scale project where different teams
are developing different parts of the system
Described by abstract operations (signatures)
Used to model the seams (flow) of a system
Components on each side of seams should not be
affected by changes on the other side
11. Interfaces Relationships
Participate in: generalization, association dependency,
realization
Realization: Class or Component may realize one (or
many) interface(s):
class provides a set of methods that implement the
operations of all the interfaces it realizes
Exemple:
SensorTelemetry
Filter
realization
dependency
12. Types and Roles
Types:
Same as Interface + Attributes
Allow to model the semantics of an abstraction and its
conformance to a specific interface.
Roles:
In a given context, an instance may present only one of
its interface. Each interface represents a role the object
plays
Person Companye:Employee
13. Packages
General purpose mechanism for organizing modeling
elements into groups
Use Packages for Architecture Views
Organize elements semantically close into large chunks
Well structured Packages are loosely coupled and very
cohesive
Graphical Representation:
Shape
14. Packages
Package may own other elements
classes, interfaces, components, nodes, collaborations,
use cases, other packages.
Package form namespace (same named element cannot be
in same package, but can be in two different packages)
Shape
Shape
+ height
+ length
- radius
Square
Circle
Triangle
15. Packages Visibility
Specify whether an element owned by a package can be
used by other package:
+ public: any package that import this package can use
the feature
# protected: any descendant of the package can use the
feature
- private: only the elements in the package itself can
use the feature
Collectively the public parts of a package constitute the
package’s interface
17. Object Diagram
• It is a concrete manifestation of an abstraction to which a
set of operations can be applied and which has a state
that stores the effects of the operations
• an object in object diagram is rendered by underlining
its name in the class symbol
18. Object Diagram
• An object has state and therefore it is dynamic.
• When we visualize its state, we are really specifying the
value of its state at a given moment in time and space.
• When we operate on object, we typically change its state;
when you query an object, you don't change its state
19. Object Diagram
• Model the instances of things contained in class diagrams.
• Shows a set of objects & their relationships at a point in time.
• Use to model the static design view or static process view of a
system.
• It is not only important for visualizing, specifying, and
documenting structural models, but also for constructing the
static aspects of systems.
• An object diagram covers a set of instances of the things
found in a class diagram.
21. Object Diagram
• Commonly contain Objects and Links. Also may contain notes
and constraints.
• We say, If class A has a one-to-many association to class B,
then for one instance of A there might be five instances of B;
for another instance of A there might be only one instance of
B.
• To model an object diagram,
• identify the mechanism you'd like to model that should
represents some function or behavior of the part of the
system you are modeling that results from the interaction
of a society of classes, interfaces, and other things
• Then create a collaboration to describe a mechanism.
22. Object Diagram
• To model an object diagram,
• identify the mechanism you'd like to model that should
represents some function or behavior of the part of the
system you are modeling that results from the interaction
of a society of classes, interfaces, and other things
• Then create a collaboration to describe a mechanism.
• For each mechanism, identify the classes, interfaces, and
other elements that participate in this collaboration;
identify the relationships among these things as well.
• Expose the state and attribute values of each such object, as
necessary, to understand the scenario.
• Similarly, expose the links among these objects,
representing instances of associations among them.