SlideShare uma empresa Scribd logo
1 de 41
Objects, Object Classes and Inheritance Object Identification, an
Object Oriented Design Example, Concurrent Objects, Data Flow
Design Structural Decomposition, Detailed Design, A Comparison
Of Design Strategies
NAVEEN SAGAYASELVARAJ
1
10/8/2016
 Traditional procedural systems separate
data and procedures, and model these
separately
 Object orientation combines data and
methods together into a cohesive whole
 data abstraction
 The purpose of Object-Oriented (OO)
design is to define the classes (and their
relationships) that are needed to build a
system that meets the requirements
contained in the SRS
NAVEEN SAGAYASELVARAJ 210/8/2016
 Object-oriented analysis, design and
programming are related but distinct.
 OOA is concerned with developing an object
model of the application domain.
 OOD is concerned with developing an object-
oriented system model to implement
requirements.
 OOP is concerned with realising an OOD
using an OO programming language such as
Java or C++.
NAVEEN SAGAYASELVARAJ 310/8/2016
 Objects are abstractions of real-world or system entities and manage themselves
 Objects are independent and encapsulate state and representation information
 System functionality is expressed in terms of object services
 Shared data areas are eliminated. Objects communicate by message passing
 Objects may be distributed and may execute sequentially or in parallel
NAVEEN SAGAYASELVARAJ 410/8/2016
 Easier maintenance. Objects may be
understood as stand-alone entities.
 Objects are potentially reusable components.
 For some systems, there may be an obvious
mapping from real world entities to system
objects.
NAVEEN SAGAYASELVARAJ 510/8/2016
 Objects are entities in a software system which represent instances of real-world
and system entities
 Object classes are templates for objects. They may be used to create objects
 Object classes may inherit attributes and services from other object classes
 Example: Click here
NAVEEN SAGAYASELVARAJ 610/8/2016
 Conceptually, objects communicate by message
passing.
 Messages
 The name of the service requested by the
calling object;
 Copies of the information required to
execute the service
and the name of a holder for the result of the
service.
 In practice, messages are often implemented
by procedure calls
 Name = procedure name;
 Information = parameter list.
Example:
// Call a method associated with a buffer
// object that returns the next value
// in the buffer
v = circularBuffer.Get () ;
// Call the method associated with a
// thermostat object that sets the
// temperature to be maintained
thermostat.setTemp (20) ;NAVEEN SAGAYASELVARAJ 710/8/2016
 Objects are members of classes that define
attribute types and operations.
 Classes may be arranged in a class hierarchy
where one class (a super-class) is a
generalisation of one or more other classes (sub-
classes).
 A sub-class inherits the attributes and
operations from its super class and may add
new methods or attributes of its own
 Generalisation in the UML is implemented as
inheritance in OO programming languages
 Example: Click here
NAVEEN SAGAYASELVARAJ 810/8/2016
Advantages
 It is an abstraction mechanism
which may be used to classify
entities.
 It is a reuse mechanism at both the
design and the programming level.
 The inheritance graph is a source of
organisational knowledge about
domains and systems.
Problems
 Object classes are not self-contained.
they cannot be understood without
reference to their super-classes.
 Designers have a tendency to reuse
the inheritance graph created during
analysis. Can lead to significant
inefficiency.
 The inheritance graphs of analysis,
design and implementation have
different functions and should be
separately maintained.
NAVEEN SAGAYASELVARAJ 910/8/2016
NAVEEN SAGAYASELVARAJ 10
 Objects and object classes participate in relationships with other objects and
object classes
 In UML, such a relationship is indicated by an association
 Associations may be annotated with information that describes the association
10/8/2016
 The nature of objects as self-contained entities make them suitable for
concurrent
implementation.
 The message-passing model of object communication can be
implemented directly if objects are running on separate processors in a
distributed system
 Most object-oriented programming languages have as their default a
serial execution model where requests for object services are
implemented in the same way as function calls
 Example: Click here
NAVEEN SAGAYASELVARAJ 1110/8/2016
Servers
 The object is implemented as a parallel process (server) with entry
points corresponding to object operations. If no calls are made to it,
the object suspends itself and waits for further requests for service.
Active objects
 Objects are implemented as parallel processes and the internal object
state may be changed by the object itself and not simply by external
calls. Example: Click here
NAVEEN SAGAYASELVARAJ 1210/8/2016
 Threads in Java are a simple
construct for implementing
concurrent objects.
 Threads must include a method
called run() and this is started up by
the Java run-time system.
 Active objects typically include an
infinite loop so that they are always
carrying out the computation.
NAVEEN SAGAYASELVARAJ 1310/8/2016
 Structured design processes involve developing a number of different system
models
 They require a lot of effort for development and maintenance of these models and,
for small systems, this may not be cost-effective
 However, for large systems developed by different groups design models are an
essential communication mechanism
Object-oriented design process stages:
 Understand and define the context and the modes of use of the system
 Design the system architecture
 Identify the principal objects in the system
 Develop design models
 Specify object interfaces
NAVEEN SAGAYASELVARAJ 14
Example: Layer Architecture Click Here
Package Click Here
10/8/2016
The system context and the model of
system use represent two complementary
models of the relationships between a
system and its environment:
 The system context is a static model that
describes the other systems in that
environment.
 The model of the system use is a dynamic
model that describes how the system
actually interacts with its environment.
NAVEEN SAGAYASELVARAJ 1510/8/2016
System – Weather station
Use-Case – Report
Actor – Weather data collection system, Weather station
Data - The weather station sends a summary of the weather data that has been collected from the instruments in
the collection period to the weather data collection system. The data sent are the maximum minimum and
average ground and air temperatures, the maximum, minimum and average air pressures, the maximum,
minimum and average wind speeds, the total rainfall and the wind direction as sampled at 5 minute intervals.
Stimulus - The weather data collection system establishes a modem link with the weather station and
requests transmission of the data.
Response - The summarized data is sent to the weather data collection
system
Comments - Weather stations are usually asked to report once per hour but this frequency may
differ from one station to the other and may be modified in future.
NAVEEN SAGAYASELVARAJ 1610/8/2016
The automated weather station is a relatively simple system and its architecture can
again be represented as a layered model. Example: Click here
The three layers of interaction are:
 The interface layer which is concerned with all communications with other parts of the
system and with providing the external interfaces of the system
 The data collection layer which is concerned with managing the collection of data from the
instruments and with summarizing the weather data before transmission to the mapping
system
 The instruments layer which is an encapsulation of all of the instruments that are used to
collect raw data about the weather conditions
In general, decompose a system so that architectures are as simple as possible. A good
rule of thumb is that there should not be more than seven fundamental entities included
in an architectural model. Each of these entities can be described separately but, of
course, it may choose to reveal the structure of the entities
NAVEEN SAGAYASELVARAJ 1710/8/2016
 Identifying objects (or object classes) is the most difficult part of
object oriented design
 There is no “magic formula” for object identification
 It relies on the skill, experience
and domain knowledge of system designers
 Object identification is an iterative process
 You are unlikely to get it right first time
Example: Click here
NAVEEN SAGAYASELVARAJ 1810/8/2016
 Use a grammatical approach based on a natural language
description of the system (used in HOOD method)
 Base the identification on tangible things in the application
domain
 Use a behavioural approach and identify objects based on what
participates in what behaviour
 Use a scenario-based analysis – the objects, attributes and
methods in each scenario are identified
NAVEEN SAGAYASELVARAJ 1910/8/2016
DESIGN MODELS
 Design models show the objects and object classes and relationships
between these entities
 Static models describe the static structure of the system in terms of
object classes and relationships
 Dynamic models describe the dynamic interactions between objects.
10/8/2016NAVEEN SAGAYASELVARAJ 20
EXAMPLES OF DESIGN
MODELS
 Sub-system models that show logical groupings of objects into
coherent subsystems
 Sequence models that show the sequence of object interactions
 State machine models that show how individual objects change
their state in response to events
 Other models include use-case models, aggregation models,
generalisation models,etc.
10/8/2016NAVEEN SAGAYASELVARAJ 21
SUBSYSTEM MODELS
 Shows how the design is organised into logically related groups of
objects
 In UML, these are shown using packages - an encapsulation
construct. This is a logical model. The actual organisation of objects
in the system may be different.
10/8/2016NAVEEN SAGAYASELVARAJ 22
WEATHER STATION
SUBSYSTEMS
10/8/2016NAVEEN SAGAYASELVARAJ 23
SEQUENCE MODELS
 Sequence models show the sequence of object interactions that
take place
 Objects are arranged horizontally across the top
 Time is represented vertically so models are read top to bottom
 Interactions are represented by labelled arrows, Different styles of arrow
represent different types of interaction
 A thin rectangle in an object lifeline represents the time when the object is
the controlling object in the system
10/8/2016NAVEEN SAGAYASELVARAJ 24
DATA COLLECTION
SEQUENCE
10/8/2016NAVEEN SAGAYASELVARAJ 25
STATE CHARTS
 Show how objects respond to different service requests and the
state transitions triggered by these requests
 If object state is Shutdown then it responds to a Startup() message
 In the waiting state the object is waiting for further messages
 If reportWeather () then system moves to summarising state
 If calibrate () the system moves to a calibrating state
 A collecting state is entered when a clock signal is received
10/8/2016NAVEEN SAGAYASELVARAJ 26
WEATHER STATION STATE
DIAGRAM
10/8/2016NAVEEN SAGAYASELVARAJ 27
OBJECT INTERFACE
SPECIFICATION
 Object interfaces have to be specified so that the objects and other
components can be designed in parallel
 Designers should avoid designing the interface representation but
should hide this in the object itself
 Objects may have several interfaces which are viewpoints on the
methods provided
 UML uses class diagrams for interface specification but Java may
also be used
10/8/2016NAVEEN SAGAYASELVARAJ 28
WEATHER STATION
INTERFACEinterface WeatherStation {
public void WeatherStation () ;
public void startup () ;
public void startup (Instrument i) ;
public void shutdown () ;
public void shutdown (Instrument i) ;
public void reportWeather ( ) ;
public void test () ;
public void test ( Instrument i ) ;
public void calibrate ( Instrument i) ;
public int getID () ;
} //WeatherStation
10/8/2016NAVEEN SAGAYASELVARAJ 29
DESIGN EVOLUTION
 Hiding information inside objects means that changes made to an
object do not affect other objects in an unpredictable way
 Assume pollution monitoring facilities are to be added to weather
stations. These sample the air and compute the amount of
different
pollutants in the atmosphere
 Pollution readings are transmitted with weather data
10/8/2016NAVEEN SAGAYASELVARAJ 30
CHANGES REQUIRED
 Add an object class called ‘Air quality’ as part of WeatherStation
 Add an operation reportAirQuality to WeatherStation. Modify the
control software to collect pollution readings
 Add objects representing pollution monitoring instruments
10/8/2016NAVEEN SAGAYASELVARAJ 31
POLLUTION MONITORING
10/8/2016NAVEEN SAGAYASELVARAJ 32
KEY POINTS
 OOD is an approach to design so that design components have their own private
state and operations
 Objects should have constructor and inspection operations. They provide
services to other objects
 Objects may be implemented sequentially or concurrently
 The Unified Modeling Language provides different notations for defining
different object models
 A range of different models may be produced during an object-oriented design
process. These include static and dynamic system models
 Object interfaces should be defined precisely using e.g. a programming
language like Java
 Object-oriented design simplifies system evolution
10/8/2016NAVEEN SAGAYASELVARAJ 33
Object and Object Class
The class Employee
defines a number of
attributes that hold
information about
employees including their
name and address, social
security number, tax code,
etc. The ellipsis (...)
indicates that there are
more attributes associated
with the class that are not
shown here.
NAVEEN SAGAYASELVARAJ 34
An employee object
10/8/2016
Generalisation and inheritance
Image shows the
association between
objects of class
Employee and objects
of class Department
and between objects of
class Employee and
objects of class
Manager.
NAVEEN SAGAYASELVARAJ 35
A generalization hierarchy
10/8/2016
Concurrent objects
NAVEEN SAGAYASELVARAJ 36
An association model
10/8/2016
Active objects
Image shows how an active
object may be defined and
implemented in Java. This
object class represents a
transponder on an aircraft. The
transponder keeps track of the
aircraft’s position using a
satellite navigation system. It
can respond to messages from
air traffic control computers. It
provides the current aircraft
position in response to a
request to the give Position
method.
NAVEEN SAGAYASELVARAJ 37
Implementation of an active object using Java threads
10/8/2016
 Layered architecture for weather mapping system
Figure shown the different
layers and have included
the layer name in a UML
package symbol that has
been denoted as a
subsystem. A UML package
represents a collection of
objects and other packages.
It here to show that the
design of each layer
includes a number of other
components.
NAVEEN SAGAYASELVARAJ 3810/8/2016
 Packages in the weather mapping system
Figure expanded on this
abstract architectural model
by showing that the
components of the
subsystems. Again, these are
very abstract and they have
been derived from the
information in the description
of the system. The design
example by focusing on the
weather station subsystem
that is part of the data
collection layer.
NAVEEN SAGAYASELVARAJ 3910/8/2016
 The weather station architecture
NAVEEN SAGAYASELVARAJ 4010/8/2016
 Examples of object classes in the weather station
system
NAVEEN SAGAYASELVARAJ 4110/8/2016

Mais conteúdo relacionado

Mais procurados

11. Storage and File Structure in DBMS
11. Storage and File Structure in DBMS11. Storage and File Structure in DBMS
11. Storage and File Structure in DBMSkoolkampus
 
Function Oriented Design
Function Oriented DesignFunction Oriented Design
Function Oriented DesignSharath g
 
Architectural modeling chapter 5 of omd
Architectural modeling chapter 5 of omdArchitectural modeling chapter 5 of omd
Architectural modeling chapter 5 of omdjayashri kolekar
 
The Ultimate Sequence Diagram Tutorial
The Ultimate Sequence Diagram TutorialThe Ultimate Sequence Diagram Tutorial
The Ultimate Sequence Diagram TutorialCreately
 
3 Tier Architecture
3 Tier Architecture3 Tier Architecture
3 Tier Architectureguestd0cc01
 
Overview of UML Diagrams
Overview of UML DiagramsOverview of UML Diagrams
Overview of UML DiagramsManish Kumar
 
STRUCTURE OF SQL QUERIES
STRUCTURE OF SQL QUERIESSTRUCTURE OF SQL QUERIES
STRUCTURE OF SQL QUERIESVENNILAV6
 
Design concept -Software Engineering
Design concept -Software EngineeringDesign concept -Software Engineering
Design concept -Software EngineeringVarsha Ajith
 
Coupling and cohesion
Coupling and cohesionCoupling and cohesion
Coupling and cohesionSutha31
 
Uml in software engineering
Uml in software engineeringUml in software engineering
Uml in software engineeringMubashir Jutt
 
Component and Deployment Diagram - Brief Overview
Component and Deployment Diagram - Brief OverviewComponent and Deployment Diagram - Brief Overview
Component and Deployment Diagram - Brief OverviewRajiv Kumar
 
Sequence diagram
Sequence diagramSequence diagram
Sequence diagramRahul Pola
 

Mais procurados (20)

11. Storage and File Structure in DBMS
11. Storage and File Structure in DBMS11. Storage and File Structure in DBMS
11. Storage and File Structure in DBMS
 
Class diagrams
Class diagramsClass diagrams
Class diagrams
 
Function Oriented Design
Function Oriented DesignFunction Oriented Design
Function Oriented Design
 
Architectural modeling chapter 5 of omd
Architectural modeling chapter 5 of omdArchitectural modeling chapter 5 of omd
Architectural modeling chapter 5 of omd
 
The Ultimate Sequence Diagram Tutorial
The Ultimate Sequence Diagram TutorialThe Ultimate Sequence Diagram Tutorial
The Ultimate Sequence Diagram Tutorial
 
Use Case Modeling
Use Case ModelingUse Case Modeling
Use Case Modeling
 
3 Tier Architecture
3 Tier Architecture3 Tier Architecture
3 Tier Architecture
 
Overview of UML Diagrams
Overview of UML DiagramsOverview of UML Diagrams
Overview of UML Diagrams
 
Sequence diagram
Sequence diagramSequence diagram
Sequence diagram
 
STRUCTURE OF SQL QUERIES
STRUCTURE OF SQL QUERIESSTRUCTURE OF SQL QUERIES
STRUCTURE OF SQL QUERIES
 
Design concept -Software Engineering
Design concept -Software EngineeringDesign concept -Software Engineering
Design concept -Software Engineering
 
UML
UMLUML
UML
 
Coupling and cohesion
Coupling and cohesionCoupling and cohesion
Coupling and cohesion
 
Data Models
Data ModelsData Models
Data Models
 
Uml in software engineering
Uml in software engineeringUml in software engineering
Uml in software engineering
 
Component and Deployment Diagram - Brief Overview
Component and Deployment Diagram - Brief OverviewComponent and Deployment Diagram - Brief Overview
Component and Deployment Diagram - Brief Overview
 
Functional and non functional
Functional and non functionalFunctional and non functional
Functional and non functional
 
Database System Architectures
Database System ArchitecturesDatabase System Architectures
Database System Architectures
 
Object Oriented Design
Object Oriented DesignObject Oriented Design
Object Oriented Design
 
Sequence diagram
Sequence diagramSequence diagram
Sequence diagram
 

Semelhante a Object oriented and function oriented design

Object Oriented Design in Software Engineering SE12
Object Oriented Design in Software Engineering SE12Object Oriented Design in Software Engineering SE12
Object Oriented Design in Software Engineering SE12koolkampus
 
Ch7-Software Engineering 9
Ch7-Software Engineering 9Ch7-Software Engineering 9
Ch7-Software Engineering 9Ian Sommerville
 
System Models in Software Engineering SE7
System Models in Software Engineering SE7System Models in Software Engineering SE7
System Models in Software Engineering SE7koolkampus
 
Placement management system
Placement management systemPlacement management system
Placement management systemSurya Teja
 
[2016/2017] Introduction to Software Architecture
[2016/2017] Introduction to Software Architecture[2016/2017] Introduction to Software Architecture
[2016/2017] Introduction to Software ArchitectureIvano Malavolta
 
Ppt slides 05
Ppt slides 05Ppt slides 05
Ppt slides 05locpx
 
Object oriented methodologies
Object oriented methodologiesObject oriented methodologies
Object oriented methodologiesnaina-rani
 
[2017/2018] Introduction to Software Architecture
[2017/2018] Introduction to Software Architecture[2017/2018] Introduction to Software Architecture
[2017/2018] Introduction to Software ArchitectureIvano Malavolta
 
SOLID Principles and The Clean Architecture
SOLID Principles and The Clean ArchitectureSOLID Principles and The Clean Architecture
SOLID Principles and The Clean ArchitectureMohamed Galal
 

Semelhante a Object oriented and function oriented design (20)

Ch14
Ch14Ch14
Ch14
 
Object Oriented Design in Software Engineering SE12
Object Oriented Design in Software Engineering SE12Object Oriented Design in Software Engineering SE12
Object Oriented Design in Software Engineering SE12
 
SECh1214
SECh1214SECh1214
SECh1214
 
Ch7
Ch7Ch7
Ch7
 
Ch7-Software Engineering 9
Ch7-Software Engineering 9Ch7-Software Engineering 9
Ch7-Software Engineering 9
 
SE - System Models
SE - System ModelsSE - System Models
SE - System Models
 
Ch8
Ch8Ch8
Ch8
 
System Models in Software Engineering SE7
System Models in Software Engineering SE7System Models in Software Engineering SE7
System Models in Software Engineering SE7
 
Placement management system
Placement management systemPlacement management system
Placement management system
 
UML
UMLUML
UML
 
Ch7 - Implementation
Ch7 - ImplementationCh7 - Implementation
Ch7 - Implementation
 
Ch7
Ch7Ch7
Ch7
 
Ch7
Ch7Ch7
Ch7
 
[2016/2017] Introduction to Software Architecture
[2016/2017] Introduction to Software Architecture[2016/2017] Introduction to Software Architecture
[2016/2017] Introduction to Software Architecture
 
Ch7 implementation
Ch7 implementationCh7 implementation
Ch7 implementation
 
SECh78
SECh78SECh78
SECh78
 
Ppt slides 05
Ppt slides 05Ppt slides 05
Ppt slides 05
 
Object oriented methodologies
Object oriented methodologiesObject oriented methodologies
Object oriented methodologies
 
[2017/2018] Introduction to Software Architecture
[2017/2018] Introduction to Software Architecture[2017/2018] Introduction to Software Architecture
[2017/2018] Introduction to Software Architecture
 
SOLID Principles and The Clean Architecture
SOLID Principles and The Clean ArchitectureSOLID Principles and The Clean Architecture
SOLID Principles and The Clean Architecture
 

Último

Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxJisc
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Pooja Bhuva
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxDr. Sarita Anand
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfNirmal Dwivedi
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the ClassroomPooky Knightsmith
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17Celine George
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 

Último (20)

Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 

Object oriented and function oriented design

  • 1. Objects, Object Classes and Inheritance Object Identification, an Object Oriented Design Example, Concurrent Objects, Data Flow Design Structural Decomposition, Detailed Design, A Comparison Of Design Strategies NAVEEN SAGAYASELVARAJ 1 10/8/2016
  • 2.  Traditional procedural systems separate data and procedures, and model these separately  Object orientation combines data and methods together into a cohesive whole  data abstraction  The purpose of Object-Oriented (OO) design is to define the classes (and their relationships) that are needed to build a system that meets the requirements contained in the SRS NAVEEN SAGAYASELVARAJ 210/8/2016
  • 3.  Object-oriented analysis, design and programming are related but distinct.  OOA is concerned with developing an object model of the application domain.  OOD is concerned with developing an object- oriented system model to implement requirements.  OOP is concerned with realising an OOD using an OO programming language such as Java or C++. NAVEEN SAGAYASELVARAJ 310/8/2016
  • 4.  Objects are abstractions of real-world or system entities and manage themselves  Objects are independent and encapsulate state and representation information  System functionality is expressed in terms of object services  Shared data areas are eliminated. Objects communicate by message passing  Objects may be distributed and may execute sequentially or in parallel NAVEEN SAGAYASELVARAJ 410/8/2016
  • 5.  Easier maintenance. Objects may be understood as stand-alone entities.  Objects are potentially reusable components.  For some systems, there may be an obvious mapping from real world entities to system objects. NAVEEN SAGAYASELVARAJ 510/8/2016
  • 6.  Objects are entities in a software system which represent instances of real-world and system entities  Object classes are templates for objects. They may be used to create objects  Object classes may inherit attributes and services from other object classes  Example: Click here NAVEEN SAGAYASELVARAJ 610/8/2016
  • 7.  Conceptually, objects communicate by message passing.  Messages  The name of the service requested by the calling object;  Copies of the information required to execute the service and the name of a holder for the result of the service.  In practice, messages are often implemented by procedure calls  Name = procedure name;  Information = parameter list. Example: // Call a method associated with a buffer // object that returns the next value // in the buffer v = circularBuffer.Get () ; // Call the method associated with a // thermostat object that sets the // temperature to be maintained thermostat.setTemp (20) ;NAVEEN SAGAYASELVARAJ 710/8/2016
  • 8.  Objects are members of classes that define attribute types and operations.  Classes may be arranged in a class hierarchy where one class (a super-class) is a generalisation of one or more other classes (sub- classes).  A sub-class inherits the attributes and operations from its super class and may add new methods or attributes of its own  Generalisation in the UML is implemented as inheritance in OO programming languages  Example: Click here NAVEEN SAGAYASELVARAJ 810/8/2016
  • 9. Advantages  It is an abstraction mechanism which may be used to classify entities.  It is a reuse mechanism at both the design and the programming level.  The inheritance graph is a source of organisational knowledge about domains and systems. Problems  Object classes are not self-contained. they cannot be understood without reference to their super-classes.  Designers have a tendency to reuse the inheritance graph created during analysis. Can lead to significant inefficiency.  The inheritance graphs of analysis, design and implementation have different functions and should be separately maintained. NAVEEN SAGAYASELVARAJ 910/8/2016
  • 10. NAVEEN SAGAYASELVARAJ 10  Objects and object classes participate in relationships with other objects and object classes  In UML, such a relationship is indicated by an association  Associations may be annotated with information that describes the association 10/8/2016
  • 11.  The nature of objects as self-contained entities make them suitable for concurrent implementation.  The message-passing model of object communication can be implemented directly if objects are running on separate processors in a distributed system  Most object-oriented programming languages have as their default a serial execution model where requests for object services are implemented in the same way as function calls  Example: Click here NAVEEN SAGAYASELVARAJ 1110/8/2016
  • 12. Servers  The object is implemented as a parallel process (server) with entry points corresponding to object operations. If no calls are made to it, the object suspends itself and waits for further requests for service. Active objects  Objects are implemented as parallel processes and the internal object state may be changed by the object itself and not simply by external calls. Example: Click here NAVEEN SAGAYASELVARAJ 1210/8/2016
  • 13.  Threads in Java are a simple construct for implementing concurrent objects.  Threads must include a method called run() and this is started up by the Java run-time system.  Active objects typically include an infinite loop so that they are always carrying out the computation. NAVEEN SAGAYASELVARAJ 1310/8/2016
  • 14.  Structured design processes involve developing a number of different system models  They require a lot of effort for development and maintenance of these models and, for small systems, this may not be cost-effective  However, for large systems developed by different groups design models are an essential communication mechanism Object-oriented design process stages:  Understand and define the context and the modes of use of the system  Design the system architecture  Identify the principal objects in the system  Develop design models  Specify object interfaces NAVEEN SAGAYASELVARAJ 14 Example: Layer Architecture Click Here Package Click Here 10/8/2016
  • 15. The system context and the model of system use represent two complementary models of the relationships between a system and its environment:  The system context is a static model that describes the other systems in that environment.  The model of the system use is a dynamic model that describes how the system actually interacts with its environment. NAVEEN SAGAYASELVARAJ 1510/8/2016
  • 16. System – Weather station Use-Case – Report Actor – Weather data collection system, Weather station Data - The weather station sends a summary of the weather data that has been collected from the instruments in the collection period to the weather data collection system. The data sent are the maximum minimum and average ground and air temperatures, the maximum, minimum and average air pressures, the maximum, minimum and average wind speeds, the total rainfall and the wind direction as sampled at 5 minute intervals. Stimulus - The weather data collection system establishes a modem link with the weather station and requests transmission of the data. Response - The summarized data is sent to the weather data collection system Comments - Weather stations are usually asked to report once per hour but this frequency may differ from one station to the other and may be modified in future. NAVEEN SAGAYASELVARAJ 1610/8/2016
  • 17. The automated weather station is a relatively simple system and its architecture can again be represented as a layered model. Example: Click here The three layers of interaction are:  The interface layer which is concerned with all communications with other parts of the system and with providing the external interfaces of the system  The data collection layer which is concerned with managing the collection of data from the instruments and with summarizing the weather data before transmission to the mapping system  The instruments layer which is an encapsulation of all of the instruments that are used to collect raw data about the weather conditions In general, decompose a system so that architectures are as simple as possible. A good rule of thumb is that there should not be more than seven fundamental entities included in an architectural model. Each of these entities can be described separately but, of course, it may choose to reveal the structure of the entities NAVEEN SAGAYASELVARAJ 1710/8/2016
  • 18.  Identifying objects (or object classes) is the most difficult part of object oriented design  There is no “magic formula” for object identification  It relies on the skill, experience and domain knowledge of system designers  Object identification is an iterative process  You are unlikely to get it right first time Example: Click here NAVEEN SAGAYASELVARAJ 1810/8/2016
  • 19.  Use a grammatical approach based on a natural language description of the system (used in HOOD method)  Base the identification on tangible things in the application domain  Use a behavioural approach and identify objects based on what participates in what behaviour  Use a scenario-based analysis – the objects, attributes and methods in each scenario are identified NAVEEN SAGAYASELVARAJ 1910/8/2016
  • 20. DESIGN MODELS  Design models show the objects and object classes and relationships between these entities  Static models describe the static structure of the system in terms of object classes and relationships  Dynamic models describe the dynamic interactions between objects. 10/8/2016NAVEEN SAGAYASELVARAJ 20
  • 21. EXAMPLES OF DESIGN MODELS  Sub-system models that show logical groupings of objects into coherent subsystems  Sequence models that show the sequence of object interactions  State machine models that show how individual objects change their state in response to events  Other models include use-case models, aggregation models, generalisation models,etc. 10/8/2016NAVEEN SAGAYASELVARAJ 21
  • 22. SUBSYSTEM MODELS  Shows how the design is organised into logically related groups of objects  In UML, these are shown using packages - an encapsulation construct. This is a logical model. The actual organisation of objects in the system may be different. 10/8/2016NAVEEN SAGAYASELVARAJ 22
  • 24. SEQUENCE MODELS  Sequence models show the sequence of object interactions that take place  Objects are arranged horizontally across the top  Time is represented vertically so models are read top to bottom  Interactions are represented by labelled arrows, Different styles of arrow represent different types of interaction  A thin rectangle in an object lifeline represents the time when the object is the controlling object in the system 10/8/2016NAVEEN SAGAYASELVARAJ 24
  • 26. STATE CHARTS  Show how objects respond to different service requests and the state transitions triggered by these requests  If object state is Shutdown then it responds to a Startup() message  In the waiting state the object is waiting for further messages  If reportWeather () then system moves to summarising state  If calibrate () the system moves to a calibrating state  A collecting state is entered when a clock signal is received 10/8/2016NAVEEN SAGAYASELVARAJ 26
  • 28. OBJECT INTERFACE SPECIFICATION  Object interfaces have to be specified so that the objects and other components can be designed in parallel  Designers should avoid designing the interface representation but should hide this in the object itself  Objects may have several interfaces which are viewpoints on the methods provided  UML uses class diagrams for interface specification but Java may also be used 10/8/2016NAVEEN SAGAYASELVARAJ 28
  • 29. WEATHER STATION INTERFACEinterface WeatherStation { public void WeatherStation () ; public void startup () ; public void startup (Instrument i) ; public void shutdown () ; public void shutdown (Instrument i) ; public void reportWeather ( ) ; public void test () ; public void test ( Instrument i ) ; public void calibrate ( Instrument i) ; public int getID () ; } //WeatherStation 10/8/2016NAVEEN SAGAYASELVARAJ 29
  • 30. DESIGN EVOLUTION  Hiding information inside objects means that changes made to an object do not affect other objects in an unpredictable way  Assume pollution monitoring facilities are to be added to weather stations. These sample the air and compute the amount of different pollutants in the atmosphere  Pollution readings are transmitted with weather data 10/8/2016NAVEEN SAGAYASELVARAJ 30
  • 31. CHANGES REQUIRED  Add an object class called ‘Air quality’ as part of WeatherStation  Add an operation reportAirQuality to WeatherStation. Modify the control software to collect pollution readings  Add objects representing pollution monitoring instruments 10/8/2016NAVEEN SAGAYASELVARAJ 31
  • 33. KEY POINTS  OOD is an approach to design so that design components have their own private state and operations  Objects should have constructor and inspection operations. They provide services to other objects  Objects may be implemented sequentially or concurrently  The Unified Modeling Language provides different notations for defining different object models  A range of different models may be produced during an object-oriented design process. These include static and dynamic system models  Object interfaces should be defined precisely using e.g. a programming language like Java  Object-oriented design simplifies system evolution 10/8/2016NAVEEN SAGAYASELVARAJ 33
  • 34. Object and Object Class The class Employee defines a number of attributes that hold information about employees including their name and address, social security number, tax code, etc. The ellipsis (...) indicates that there are more attributes associated with the class that are not shown here. NAVEEN SAGAYASELVARAJ 34 An employee object 10/8/2016
  • 35. Generalisation and inheritance Image shows the association between objects of class Employee and objects of class Department and between objects of class Employee and objects of class Manager. NAVEEN SAGAYASELVARAJ 35 A generalization hierarchy 10/8/2016
  • 36. Concurrent objects NAVEEN SAGAYASELVARAJ 36 An association model 10/8/2016
  • 37. Active objects Image shows how an active object may be defined and implemented in Java. This object class represents a transponder on an aircraft. The transponder keeps track of the aircraft’s position using a satellite navigation system. It can respond to messages from air traffic control computers. It provides the current aircraft position in response to a request to the give Position method. NAVEEN SAGAYASELVARAJ 37 Implementation of an active object using Java threads 10/8/2016
  • 38.  Layered architecture for weather mapping system Figure shown the different layers and have included the layer name in a UML package symbol that has been denoted as a subsystem. A UML package represents a collection of objects and other packages. It here to show that the design of each layer includes a number of other components. NAVEEN SAGAYASELVARAJ 3810/8/2016
  • 39.  Packages in the weather mapping system Figure expanded on this abstract architectural model by showing that the components of the subsystems. Again, these are very abstract and they have been derived from the information in the description of the system. The design example by focusing on the weather station subsystem that is part of the data collection layer. NAVEEN SAGAYASELVARAJ 3910/8/2016
  • 40.  The weather station architecture NAVEEN SAGAYASELVARAJ 4010/8/2016
  • 41.  Examples of object classes in the weather station system NAVEEN SAGAYASELVARAJ 4110/8/2016