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

Lecture-02-Object-Orientation-and-analysis - Copy

The document provides an overview of Object Oriented Analysis (OOA) and Object Oriented Design (OOD), emphasizing the importance of analyzing requirements and designing conceptual solutions using Unified Modeling Language (UML). It covers key concepts such as encapsulation, inheritance, polymorphism, and the benefits of the object model, including faster development and easier maintenance. The course aims to equip learners with skills to effectively analyze and design software systems in an object-oriented manner.

Uploaded by

owas khan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Lecture-02-Object-Orientation-and-analysis - Copy

The document provides an overview of Object Oriented Analysis (OOA) and Object Oriented Design (OOD), emphasizing the importance of analyzing requirements and designing conceptual solutions using Unified Modeling Language (UML). It covers key concepts such as encapsulation, inheritance, polymorphism, and the benefits of the object model, including faster development and easier maintenance. The course aims to equip learners with skills to effectively analyze and design software systems in an object-oriented manner.

Uploaded by

owas khan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 37

Object Oriented Analysis and

Design
Overview
 In this course we will learn to perform
analysis on a given domain and come up
with an Object Oriented Design (OOD).
 Unified Modeling Language (UML) will

be used as a tool to demonstrate the


analysis and design ideas.
Analysis and Design
 Analysis emphasizes an investigation of the
problem and requirements, rather than a
solution(Requirements Gathering, Domain Analysis, Users Interact). For
example, if a new online trading system is desired,
how will it be used? What are its functions?
 Design emphasizes a conceptual solution that

fulfills the requirements, rather than its


implementation(High-Level Design, Detailed Design, Design Specifications). For
example, a description of a database schema and
software objects.
What Is Analysis and Design?
Cont’d

Analysis and design have been


summarized in the phase,

do the right thing and do the thing


(analysis,ethical, right (design,best
privacy, disinfo) prectic).
Object–Oriented Analysis (OOA)

 Object–Oriented Analysis (OOA) is the procedure


of identifying software engineering requirements
and developing software specifications in terms of
a software system’s object model, which comprises
of interacting objects.

 (e-commerce system, you would specify classes such as Customer, Product, Order, and their
interactions like Customer places Order or Order contains Products.) In the e-commerce system,
a Customer object will have attributes such as name and email, and behaviors (methods) like
placeOrder(). A Product object will have attributes like productID and price, and methods like
applyDiscount()
Contd..
 The primary tasks in object-oriented analysis (OOA) are −
 Identifying objects(product, book)
 Organizing the objects by creating object model diagram( object model

comprises classes and objects(book, member, borrowing))

 Defining the internals/attributes of the objects, or object attributes


 The common models used in OOA are use cases and object models.
Object Oriented Design (OOD)

A critical ability in OO development is to


skillfully assign responsibilities to software
objects.
Object-Oriented Design
 Object–Oriented Design (OOD) involves
implementation of the conceptual model produced
during object-oriented analysis. In OOD, concepts
in the analysis model, which are
technology−independent, are mapped onto
implementing classes, constraints are identified
and interfaces are designed, resulting in a model
for the solution domain, i.e., a detailed description
of how the system is to be built on concrete
technologies.
Analysis and design example
 Let’s design a “dice game”
 In which software simulates a player rolling

two dice. If the total is seven, they win;


otherwise, they lose.
Analysis and design example
 Let’s design a “dice game”
 In which software simulates a player rolling

two dice. If the total is seven, they win;


otherwise, they lose.
Define Use case
Define Domain Model
Define Interaction diagram
Design Class diagram
• Sequence diagram leads to the partial design class
diagram
• Since a play message is sent to a DiceGame object,
the DiceGame class requires a play method, while
class Die requires a roll and getFaceValue method.
• In contrast to the domain model showing real-world
classes, this diagram shows software classes.
Applying UML
 UML is just a standard diagramming
notation. It is just a tool, not a skill that is
valuable in itself. Knowing UML helps
you communicate with others in creating
software.
Assigning Responsibilities
 Themost important skill in Object-
Oriented Analysis and Design is
assigning responsibilities to objects.
That determines how objects interact
and what classes should perform what
operations.
Requirements Analysis
 All Software Analysis and Design is
preceded by the analysis of requirements.
 One of the basic principles of good design
is to defer decisions as long as possible.
The more you know before you make a
design decision, the more likely it will be
that the decision is a good one.
 TFCL: Think First, Code Later!
Use Cases
 Writing Use Cases is not a specifically
Object Oriented practice. But it is a best
practice for elaborating and
understanding requirements. So we will
study Use Cases.
The Unified Process
A standardized approach to analysis and
design helps to ensure that all necessary
tasks are understood and completed in
software development.
Other Necessary Skills
 Requirements Analysis, Object-Oriented
Analysis and Object-Oriented Design are not
a complete toolkit for a software developer.
There are many other skills necessary in
Software development, including
programming.
• For example, usability engineering and user
interface design are critical to success; so is
database design. This course only covers a subset
of the necessary skills.
What is Object Oriented Analysis?

 The emphasis is on finding and


describing the objects (or concepts) in
the problem domain.
 In a Library Information System, some of

the concepts include Book, Library, and


Patron.
What is Object Oriented Design?

 The emphasis is defining software


objects and how they collaborate to fulfill
the requirements.
 In a Library Information System, a Book

software object may have a title attribute


and a get Chapter method.
Objects and Classes
 Object: An object is a real-world element in an object–oriented
environment that may have a physical or a conceptual
existence. Each object has identity that distinguishes it from
other objects in the system.
 State(attribute) that determines the characteristic properties of
an object as well as the values of the properties that the object
holds.
 Behavior that represents externally visible activities performed
by an object in terms of changes in its state.
 Objects can be modelled according to the needs of the
application. An object may have a physical existence, like a
customer, a car, etc.; or an intangible conceptual existence, like
a project, a process, etc.
Contd..
 Class: A class represents a collection of
objects having same characteristic
properties that exhibit common behavior.
It gives the blueprint or description of the
objects that can be created from it.
Creation of an object as a member of a
class is called instantiation. Thus, object
is an instance of a class.
Encapsulation and Data Hiding
 Encapsulation
 Encapsulation is the process of binding both

attributes and methods together within a class.


Through encapsulation, the internal details of a
class can be hidden from outside. It permits the
elements of the class to be accessed from outside
only through the interface provided by the class.
Like bank account, screen of the phone, apps
interface vs internal operation, API
Inheritance
 Inheritance is the mechanism that permits new classes to
be created out of existing classes by extending and
refining its capabilities. The existing classes are called the
base classes/parent classes/super-classes, and the new
classes are called the derived classes/child
classes/subclasses. The subclass can inherit or derive
the attributes and methods of the super-class(es)
provided that the super-class allows so. Besides, the
subclass may add its own attributes and methods and
may modify any of the super-class methods. Inheritance
defines an “is – a” relationship.
Contd..
 Example
 From a class Mammal, a number of classes
can be derived such as Human, Cat, Dog,
Cow, etc. Humans, cats, dogs, and cows all
have the distinct characteristics of mammals.
In addition, each has its own particular
characteristics. It can be said that a cow “is –
a” mammal.
Types of Inheritance
 Single Inheritance − A subclass derives from a single super-class .
(A Car is a type of Vehicle)
 Multiple Inheritance − A subclass derives from more than one
super-classes.(Sparrow, Bird, Animal.)
 Multilevel Inheritance − A subclass derives from a super-class
which in turn is derived from another class and so on .(Animal, mammal ,
human.)
 Hierarchical Inheritance − A class has a number of subclasses
each of which may have subsequent subclasses, continuing for a
number of levels, so as to form a tree structure.(Uni, faculty,
department)
 Hybrid Inheritance − A combination of multiple and multilevel
inheritance.(Person, Student, employee, Intern)
Polymorphism
 Polymorphism is originally a Greek word that
means the ability to take multiple forms. In object-
oriented paradigm, polymorphism implies using
operations in different ways, depending upon the
instance they are operating upon. Polymorphism
allows objects with different internal structures to
have a common external interface. Polymorphism
is particularly effective while implementing
inheritance.
Example
 Let us consider two classes, Circle and
Square, each with a method findArea().
Though the name and purpose of the
methods in the classes are same, the internal
implementation, i.e., the procedure of
calculating area is different for each class.
When an object of class Circle invokes its
findArea() method, the operation finds the
area of the circle without any conflict with the
findArea() method of the Square class.
Abstraction
Benefits of Object Model
 Now that we have gone through the core
concepts pertaining to object orientation,
it would be worthwhile to note the
advantages that this model has to offer.
 The benefits of using the object model

are −
 It helps in faster development of
software.
Contd..
 It is easy to maintain. Suppose a module
develops an error, then a programmer can fix
that particular module, while the other parts
of the software are still up and running.
 It supports relatively hassle-free upgrades.

 It enables reuse of objects, designs, and

functions.
 It reduces development risks, particularly in

integration of complex systems.

You might also like