0% found this document useful (0 votes)
3 views

22-Object Oriented Design, UID-15!03!2024

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

22-Object Oriented Design, UID-15!03!2024

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

BCSE301L_SOFTWARE ENGINEERING

Presented By,
Dr.Baiju B V
Assistant Professor
School of Computer Science and Engineering
1
VIT, Vellore
OBJECT ORIENTED DESIGN
• An object-oriented system is made up of interacting objects that maintain their own
local state and provide operations on that state.
• The representation of the state is private and cannot be accessed directly from
outside the object.
• Object-oriented design processes involve designing object classes and the
relationships between these classes.
• These classes define the objects in the system and their interactions.
• When the design is realized as an executing program, the objects are created
dynamically from these class definitions.
• To develop a system design from concept to detailed, object-oriented design, you
need to:
1. Understand and define the context and the external interactions with the system.
2. Design the system architecture.
3. Identify the principal objects in the system.
4. Develop design models.
5. Specify interfaces.
1. System Context and Interactions
• The first stage in any software design process is to develop an understanding of the
relationships between the software that is being designed and its external
environment.
• This is essential for deciding how to provide the required system functionality and
how to structure the system to communicate with its environment.
• System context models and interaction models present complementary views of the
relationships between a system and its environment:
1. A system context model is a structural model that demonstrates the other
systems in the environment of the system being developed.
2. An interaction model is a dynamic model that shows how the system
interacts with its environment as it is used.
• The context model of a system may be represented using associations.
• Associations simply show that there are some relationships between the entities
involved in the association.
• The environment of the system using can be documented using a simple block
diagram, showing the entities in the system and their associations.
• The systems in the environment of each
weather station are a weather information
system, an onboard satellite system, and a
control system.
• The cardinality information on the link shows
that there is a single control system but
several weather stations, one satellite, and
one general weather information system. System context for the weather station
• Each use case represents an interaction with the system
Weather station use cases
Report weather : Send weather data to the weather information system
Report status : Send status information to the weather information system
Restart : If the weather station is shut down, restart the system
Shutdown : Shut down the weather station
Reconfigure : Reconfigure the weather station software
Powersave : Put the weather station into power-saving mode
Remote control : Send control commands to any weather station subsystem
• Each possible interaction is named in an ellipse, and the external entity involved in
the interaction is represented by a stick figure
• Weather station interacts with the weather information
system to report weather data and the status of the
weather station hardware.
• A control system do the interactions that can issue
specific weather station control commands.
• The stick figure is used in the UML to represent other
systems as well as human users.

Weather station use cases


2. Architectural design
• The information gathered from the interactions between the software system and the
defined system’s environment play a basis for designing the system architecture.
• The weather station is
composed of independent
subsystems that communicate
by broadcasting messages on a
common infrastructure, shown
as Communication link.
• Each subsystem listens for
messages on that infrastructure
and picks up the messages that
are intended for them.
High-level architecture of weather station
• This “listener model” is a commonly used architectural style for distributed systems.
• When the communications subsystem receives a control command, such as shutdown, the
command is picked up by each of the other subsystems, which then shut themselves down
in the correct way.
3. Object Class Identification
• The use case description helps to identify objects and operations in the system.
• From the description of the Report weather use case, it is obvious that you will need
to implement objects representing the instruments that collect weather data and an
object representing the summary of the weather data.
• Various ways of identifying object classes in object-oriented systems were suggested:
1. Use tangible entities (things) in the
– Application domain such as aircraft
– Roles such as manager,
– Events such as request,
– Interactions such as meetings,
– Locations such as offices,
– Organizational units such as companies
2. Use a scenario-based analysis where various scenarios of system use are identified
and analyzed in turn.
• As each scenario is analyzed, the team responsible for the analysis must identify
the required objects, attributes, and operations.
3. Use a grammatical analysis of a natural language
description of the system to be constructed.
• Objects and attributes are nouns
• Operations or services are verbs.
• The Ground thermometer, Anemometer, and Barometer objects are application
domain objects, and the WeatherStation and WeatherData objects have been
identified from the system description and the scenario (use case) description.
• WeatherStation object class provides
the basic interface of the weather
station with its environment.
• WeatherData object class is responsible
for processing the report weather
command. It sends the summarized
data from the weather station
instruments to the weather information
system.
• Ground thermometer, Anemometer,
and Barometer object classes are
directly related to instruments in the
system. Weather station objects
• They reflect tangible hardware entities in the system and the operations are concerned
with controlling that hardware
4. Design Models
• Design or system models, show the objects or object classes in a system.
• They also show the associations and relationships between these entities.
• These models are the bridge between the system requirements and the
implementation of a system.
• Develop two kinds of design model are developed when you use the UML to
develop a design :
1. Structural models
– Describe the static structure of the system using object classes and their
relationships.
– Relationships that may be documented at this stage are generalization
(inheritance) relationships, uses/used-by relationships, and composition
relationships.
2. Dynamic models
– Describe the dynamic structure of the system and show the expected runtime
interactions between the system objects.
– Interactions that may be documented include the sequence of service requests
made by objects and the state changes triggered by these object interactions.
• Three UML model types are particularly useful for adding detail to use case and
architectural models:
1. Subsystem Models
– Show logical groupings of objects into coherent subsystems.
– These are represented using a form of class diagram with each subsystem
shown as a package with enclosed objects.
– Subsystem models are structural models.
2. Sequence Models
– Show the sequence of object interactions.
– These are represented using a UML sequence or a collaboration diagram.
– Sequence models are dynamic models.
3. State Machine Models
– Show how objects change their state in response to events.
– These are represented in the UML using state diagrams.
– State machine models are dynamic models.
• Sequence models are Sequence diagram describing data collection
dynamic models that
describe, for each
mode of interaction,
the sequence of object
interactions that take
place.
• This diagram shows
the sequence of
interactions that take
place when an
external system
requests the
summarized data from
the weather station.
• A state diagram for the weather station system that shows how it responds to
requests for various services

Weather station state diagram

You might also like