Unit - II Oomd
Unit - II Oomd
Unit – II
2.1. Introduction to Structural Modeling
Structural model represents the framework for the system and this framework is the place
where all other components exist. Hence, the class diagram, component diagram and
deployment diagrams are part of structural modeling.
2.2 Classes:
Classes are the most important building block of any object-oriented system.
A class is a description of a set of objects that share the same attributes, operations,
relationships, and semantics.
A class implements one or more interfaces. Classes are used to capture the vocabulary of the
system.
We can use classes to represent software things, hardware things, and even things that
are purely conceptual.
The most important parts of an abstraction: its name, attributes, and operations.
Names
Attributes
Attributes are related to the semantics of aggregation.
An attribute is a named property of a class that describes a range of values that instances of
the property may hold.
A class may have any number of attributes or no attributes at all.
An attribute name may be text, just like a class name.
an attribute by stating its class and possibly a default initial value
Operations
An operation is the implementation of a service that can be requested from any object of the
class to affect behavior.
A class may have any number of operations or no operations at all.
An operation name is a short verb or verb phrase that represents some behavior of its
enclosing class.
Responsibilities
Responsibilities are an example of a defined stereotype.
A responsibility is a contract or an obligation of a class.
A class may have any number of responsibilities, although, in practice, every well-
structured class has at least one responsibility and at most just a handful.
Show only those properties of the class that are important to understanding the abstraction
in its context.
Organize long lists of attributes and operations by grouping them according to their
category.
2.3 Relationships:
In object-oriented modeling, there are three kinds of relationships that are especially
important: dependencies, generalization and association.
Dependency
A dependency is a using relationship that states that a change in specification of one thing
may affect another thing that uses, but not necessarily the reverse.
Graphically, a dependency is rendered as a dashed directed line, directed to the thing being
depended on.
Use dependencies when you want to show one thing using another.
Generalization
Role: Roles are related to the semantics of interfaces, when a class participates in an association, it
has a specific role that it plays in that relationship.
A role is just the face the class at the near end of the association presents to the class at the
other end of the association
You can show a multiplicity of exactly one (1), zero or one ( 0..1), many (0..*), or one or
more (1..*).
Realization:
Realization of Interface
Realization of Usecase