Ooad Unit 22
Ooad Unit 22
Ooad Unit 22
Importance of Modeling:
Why do we model?
The object-oriented modeling approach creates the union of the application and
database development and transforms it into a (uml) unified data model and language
environment.
During the initial stages of development, the model developed is abstract because the
external details of the system are the central focus. The model becomes more and
more detailed as it evolves, while the central focus shifts toward understanding how
the system will be constructed and how it should function.
Object oriented modeling is entirely a new way of thinking about problems. This
methodology is all about visualizing the things by using models organized around
real world concepts.
Object oriented models are represented by diagrams. A good model always helps
communication among project teams, and to assure architectural soundness.
In OOM the modeling passes through the following processes: • System Analysis
• System Design • Object Design, and • Final Implementation.
The Unified Modeling Language (UML) is a standard visual language for describing
and modelling software blueprints. The UML is more than just a graphical language.
Stated formally, the UML is for: Visualizing, Specifying, Constructing, and
Documenting.
A Conceptual Model:
A conceptual model of the language underlines the three major elements:
• The Building Blocks • The Rules • Some Common Mechanisms
Building blocks
1.Things:
Things are the abstractions that are first-class citizens in a model; relationships tie these things
together; diagrams group interesting collections of things.
There are 4 kinds of things in the UML:1. Structural things (nouns of uml – static
parts) 2. Behavioral things (verbs of uml – dynamic parts) 3. Grouping
things (organizational parts) 4. Annotational things (explanatory parts)
These things are the basic object-oriented building blocks of the UML. You use them to write
well-formed models.
1.Structural things
Represents the static aspects of a software system. There are seven structural things in
UML. They are:
Example:
Interface: An interface is a collection of operation signatures and/or attribute
definitions that ideally define a cohesive set of behavior. Graphically interface is
represented as a circle or a class symbol stereotyped with interface.
Graphical Representation:
Use Case: A use case is a collection of actions, defining the interactions between a
role (actor) and the system. Graphically use case is represented as a solid ellipse
with its name written inside or below the ellipse.
Graphical Representation
Collaboration: A collaboration is the collection of interactions among objects to
achieve a goal. Graphically collaboration is represented as a dashed ellipse. A
collaboration can be a collection of classes or other elements.
Interaction Diagram are used in UML to establish communication between
objects.
Graphical Representation:
Example:
Active Class: A class whose objects can initiate its own flow of control
(threads) and work in parallel with other objects. Graphically active class is
represented as a rectangle with thick borders.
Example:
2. Behavioral Things
3. Grouping Things
Elements which are used for organizing related things and relationships in models.
4. Annotational Things
A symbol to display comments. Graphically note is represented as a rectangle with
a dog ear at the top right corner.
Relationships
The things in a diagram are connected through relationships. So, a relationship is a
connection between two or more things.
1. Dependency:
Example:
Name
An association can have a name, and you use that name to describe the nature of
the relationship. So that there is no ambiguity about its meaning, you can give a
direction to the name by providing a direction triangle that points in the direction you
intend to read the name, as shown in Figure
• This "how many" is called the multiplicity of an association's role, and is written as
an expression that evaluates to a range of values or an explicit value as in Figure
Aggregation
Rules
The rules of UML specify how the UMLs building blocks come together to develop
diagrams. The rules enable the users to create well-formed models. A well-formed
model is self-consistent and also consistent with the other models.
UML has rules for:
Names – What elements can be called as things, relationships and diagrams
Scope – The context that gives a specific meaning to a name
Visibility – How these names are seen and can be used by the other names
Integrity – How things properly relate to one another
Execution – What it means to run or simulate a model
Common Mechanisms
Stereotypes, tagged values, and constraints are the mechanisms provided by the
UML to add new building blocks, create new properties, and specify new
semantics.
• For example, if you are modeling a network, you might want to have symbols for
routers and hubs; then use stereotyped nodes to make these things appear as
primitive building blocks.
• Similarly, if you are part of your project's release team, responsible for
assembling, testing, and then deploying releases, you might want to keep track of
the version number and test results for each major subsystem.
Deployment represents the physical nodes of the system that forms the hardware.
UML deployment diagram is used to support this perspective.
The five views can be summarized as shown in the below table:
Software Development Life Cycle
The Unified Software Development Process
A software development process is the set of activities needed to transform a users
requirements into a software system.
Basic properties:
• use case driven
• architecture centric
• iterative and incremental
Use case Driven Use cases
• capture requirements of the user
• divide the development project into smaller subprojects,
• are constantly refined during the whole development process
• are used to verify the correctness of the implemented software
Architecture Centric:
• Find structures which are suitable to achive the function specified in the use
cases,
• understandable,
• maintainable,
• reusable for later extensions or newly discovered use cases and describe them, so
that they can be communicated between developers and users.
The overall software development life cycle can be visualized as shown below:
Inception establishes the business rationale for the project and decides on the scope
of the project.
Elaboration is the phase where you collect more detailed requirements, do high-level
analysis and design to establish a baseline architecture and create the plan for
construction.
Construction is an iterative and incremental process. Each iteration in this phase
builds production- quality software prototypes , tested and integrated as subset of the
requirements of the project.
Transition contains beta testing , performance tuning and user training
Critical activities in each phase
Inception:
Business case is established
20% of the critical use cases are identified
Elaboration:
Develop the architecture
Analyze the problem domain (80% of use cases are identified)
Construction:
Source code
User manual
Verification and validation of code
Transition:
Deployment of software
New releases
Training
CLASSES
Classes
A class is a description of a set of objects that share the same attributes, operations,
relationships, and semantics.
Name
• Every class must have a name that distinguishes it from other classes. A name is
a textual string.
• That name alone is known as a simple name;
• a path name is the class name prefixed by the name of the package in which that
class lives.
Attributes
• An attribute is a named property of a class that describes 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
• represents some property of the thing you are modeling that is shared by all
objects of that class.
• Graphically, attributes are listed in a compartment just below the class name.
• Attributes may be drawn showing only their names,
further specify 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.
• An operation is an abstraction of something you can do to an object and that is
shared by all objects of that class.
• A class may have any number of operations or no operations at all.
• Operations may be drawn showing only their names.
• Ex: A Wall class is responsible for knowing about height, width, and thickness; a
FraudAgent class, as you might find in a credit card application, is responsible for
processing orders and determining if they are legitimate, suspect, or fraudulent; a
TemperatureSensor class is responsible for measuring temperature and raising an
alarm if the temperature reaches a certain point.
The UML's structural diagrams are roughly organized around the major
groups of things you'll find when modeling a system.