Lect1
-
Upload
sujit-karande -
Category
Documents
-
view
81 -
download
1
description
Transcript of Lect1
Object Oriented Analysis&
Design
04/08/2023 1
Syllabus
• Two views of software Developments:• SSAD and OOAD.• Why Object –Orientation?
04/08/2023 2
Systems development life cycle (SDLC)• SDLC: process of building, deploying,
using, and updating an information system
Plan
DevelopUse &
Maintain
04/08/2023 3
System development methodology
• SD Methodlogy – Guidelines for developing system. – Kind of knowledge.
• Two kinds of methodologies – Structured (since 1970s)– Newer, rapid development
04/08/2023 4
Structured methodology
Also called “Waterfall” methodology
INSTALLATION, TESTING
04/08/2023 5
Waterfall Model – from ‘what’ to ‘use’
04/08/2023 6
Software Development Process
7
Requirement Specification
System Analysis
System Design
Testing
Implementation
Maintenance
Deployment
04/08/2023
Requirement Specification
8
Requirement Specification
System Analysis
System Design
Testing
Implementation
Maintenance
Deployment
A formal process that seeks to understand the problem and document in detail what the software system needs to do. This phase involves close interaction between users and designers.
Most of the examples in this book are simple, and their requirements are clearly stated. In the real world, however, problems are not well defined. You need to study a problem carefully to identify its requirements. 04/08/2023
System Analysis
9
Requirement Specification
System Analysis
System Design
Testing
Implementation
Maintenance
Deployment
Seeks to analyze the business process in terms of data flow, and to identify the system’s input and output.
Part of the analysis entails modeling the system’s behavior. The model is intended to capture the essential elements of the system and to define services to the system.
04/08/2023
System Design
10
Requirement Specification
System Analysis
System Design
Testing
Implementation
Maintenance
Deployment
The process of designing the system’s components.
This phase involves the use of many levels of abstraction to decompose the problem into manageable components, identify classes and interfaces, and establish relationships among the classes and interfaces.04/08/2023
Implementation
11
Requirement Specification
System Analysis
System Design
Testing
Implementation
Maintenance
Deployment
The process of translating the system design into programs. Separate programs are written for each component and put to work together.
This phase requires the use of a programming language like Java. The implementation involves coding, testing, and debugging.
04/08/2023
Testing
12
Requirement Specification
System Analysis
System Design
Testing
Implementation
Maintenance
Deployment
Ensures that the code meets the requirements specification and weeds out bugs.
An independent team of software engineers not involved in the design and implementation of the project usually conducts such testing.
04/08/2023
Deployment
13
Requirement Specification
System Analysis
System Design
Testing
Implementation
Maintenance
Deployment
Deployment makes the project available for use.
For a Java applet, this means installing it on a Web server; for a Java application, installing it on the client's computer.
04/08/2023
Relationships among Classes
• Association
• Aggregation
• Composition
• Inheritance
1404/08/2023
Association
Association represents a general binary relationship that describes an activity between two classes.
15
Student * 5..60 Take Teach
0..3 1 Teacher
Faculty Course
An association is usually represented as a data field in the
class.
04/08/2023
Association Between Same Class
Association may exist between objects of the same class. For example, a person may have a supervisor.
16
Person Supervisor
1
1
04/08/2023
Aggregation and CompositionAggregation is a special form of association, which represents an ownership relationship between two classes. Aggregation models the has-a relationship. If an object is exclusively owned by an aggregated object, the relationship between the object and its aggregated object is referred to as composition.
17
Name Address Person
Composition Aggregation
04/08/2023
04/08/2023 18
Aggregation and Composition
04/08/2023 19
Aggregation and Composition
04/08/2023 20
Aggregation and Composition
04/08/2023 21
Aggregation and Composition
04/08/2023 22
What is a navigable association in UML?Associations are relationships between classes in a UML Class Diagram. They are represented by a solid line between classes. Associations are typically named using a verb or verb phrase which reflects the real world problem domain. The normal kind of association is bidirectional by default. This means that if an association exists between two classes, then both objects know about each other. However, when creating a class diagram it is possible to use a navigable association between two classes. This is shown by adding an arrowhead at one end of the association.
04/08/2023 23
What is a navigable association in UML?
If “A” is the source class and “B” is the target class, the
arrowhead would be placed on the “B” side of the
association. A navigable association of this type means
that at runtime object “A” knows about object “B”, but
object “B” has no knowledge of or visibility into object
“A”.
04/08/2023 24
What is a navigable association in UML?
04/08/2023 25
What is a navigable association in UML?
04/08/2023 26
What is a navigable association in UML?
StaffMember Student1..* *instructs
instructor
Association name
Role name
MultiplicityNavigable
(uni-directional) association
Courses
pre - requisites
0..3Reflexive
association
Role
*
Inheritance
Inheritance models the is-an-extension-of relationship between two classes.
27
Person Faculty
public class Faculty extends Person {
/** Data fields */
/** Constructors */
/** Methods */
}
(A) (B)
04/08/2023
Objects
• An object is an individual unit which is used as the basic building block of programs. The term object is also used to refer to any "thing".
• Each object is capable of receiving messages, processing data, and sending messages to other objects.
• Each object can be viewed as an independent little machine or actor with a distinct role or responsibility.
2804/08/2023
Object – key concept
• Object: Thing (data structure) with data (attributes) and methods (behaviors, processes, operations)
• Object “encapsulates” data and processes
• Examples of objects– Problem domain objects (student, customer)– User interface (buttons, text boxes)
04/08/2023 29
Object examples
Objects are associated and interact via messages.
04/08/2023 30
Classes
• Classes are used to group related variables and functions.
• A class specifies the structure of data which contains methods (functions) which manipulate the data of the object and perform tasks. A method is a function with a special property that it has access to data stored in an object.
• A class is the most specific type of an object in relation to a specific layer. A class may also have a representation (meta-object) at run-time, which provides run-time support for manipulating the class-related metadata.
3104/08/2023
Class• Class: Defines what all objects of a class
represent• Objects are instances of a class (Customer
object is an instance of a customer class)
Name
Attributes
Operations
Object – An instance of class with specified Values of Attributes (specific data)
1200509/10/2003
16/10/2003
Class
04/08/2023 32
Inheritance & Specialization/Generalization
Inheritance: Property of OO systems allowing for attributes and methods to be shared among objects.
Inheritance enables a special association between classes called Specialization/Generalization
04/08/2023 33
Inheritance & Specialization/ Generalization (Cont.)
34 of 13
• Specialization: Subclasses inherit attributes and operations of the super-class, plus have some of their own.
• Subclasses “specialize”
the super-class.
• Generalization represented by arrows from subclasses to super-class. • Class “generalizes”
attributes & methods of sub-classes.
04/08/2023
Each type of vehicle has its own version of calcPrice()
Message: ”Calculate price”
Inheritance and Polymorphism• Polymorphism: Ability for dissimilar objects to respond
to the same message in different ways.
04/08/2023 35
Ex. Inheritance for graphic figures: Each subclass inherits the attributes, operations, and associations of its superclasses
Figure
Color
center Position
penThickness
penType
Move
Select
Rotate
display
Diagram
name
ZeroDimensionalOneDimensional
orientation
scale
TwoDimensionalOrientation
fillType
Scale
fill
Point
display
Line
endPoints
display
ArcRadius
startAngle
arcAngle
display
Spline
controlPts
display
Polygon
numOfSides
verticesdisplay
Circle
diameter
Display
rotate
Radius
startAngle
arcAngle
display
ArcRadius
startAngle
arcAngle
display
ArcRadius
startAngle
arcAngle
display
ArcRadius
startAngle
arcAngle
display
ArcRadius
startAngle
arcAngle
display
1 *
dimensionality
04/08/2023 36
Specialization (EER – ENHANCED OR EXTENDED ENTITY RELATIONSHIP)
04/08/2023 37
• Generalization is the reverse of the specialization process • Several classes with common features are generalized into a
super-class; – original classes become its subclasses
• Example: CAR, TRUCK generalized into VEHICLE; – both CAR, TRUCK become subclasses of the super-class VEHICLE.– We can view {CAR, TRUCK} as a specialization of VEHICLE – Alternatively, we can view VEHICLE as a generalization of CAR
and TRUCK
Generalization
04/08/2023 38
Generalization
04/08/2023 39
Generalization
04/08/2023 40
Specialization
04/08/2023 41
Object Oriented Development
• The process of converting a problem specification into an object
oriented program is called as object oriented development.
• This program consists of a group of objects which communicates
with one another.
• These objects can be created or destroyed while the programs
execution as per the need.
4204/08/2023
Problems in Shifting from the Traditional Approach to Object Oriented Development are :
• Initially, the whole process becomes very tedious because – OO S/W must coexist with the legacy s/w.Stored data is in relational databases & now it must be
converted into objects.
Initially, we do not get experienced people to work with.The staff needs proper training to understand & employ
the OO development & infrastructure.
4304/08/2023
Contd.
Project Management is pervaded (spread)As the project leaders are not well Knowledgeable
with the new technology, architectural flaws cannot be detected in the early stages
Estimation & planning also fails up to some extent.As most of the estimation models rely upon the
previous data, so a level of mismanagement occurs.
4404/08/2023