Lect1

44
Object Oriented Analysis & Design 07/02/2022 1

description

 

Transcript of Lect1

Page 1: Lect1

Object Oriented Analysis&

Design

04/08/2023 1

Page 2: Lect1

Syllabus

• Two views of software Developments:• SSAD and OOAD.• Why Object –Orientation?

04/08/2023 2

Page 3: Lect1

Systems development life cycle (SDLC)• SDLC: process of building, deploying,

using, and updating an information system

Plan

DevelopUse &

Maintain

04/08/2023 3

Page 4: Lect1

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

Page 5: Lect1

Structured methodology

Also called “Waterfall” methodology

INSTALLATION, TESTING

04/08/2023 5

Page 6: Lect1

Waterfall Model – from ‘what’ to ‘use’

04/08/2023 6

Page 7: Lect1

Software Development Process

7

Requirement Specification

System Analysis

System Design

Testing

Implementation

Maintenance

Deployment

04/08/2023

Page 8: Lect1

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

Page 9: Lect1

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

Page 10: Lect1

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

Page 11: Lect1

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

Page 12: Lect1

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

Page 13: Lect1

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

Page 14: Lect1

Relationships among Classes

• Association

• Aggregation

• Composition

• Inheritance

1404/08/2023

Page 15: Lect1

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

Page 16: Lect1

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

Page 17: Lect1

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

Page 18: Lect1

04/08/2023 18

Aggregation and Composition

Page 19: Lect1

04/08/2023 19

Aggregation and Composition

Page 20: Lect1

04/08/2023 20

Aggregation and Composition

Page 21: Lect1

04/08/2023 21

Aggregation and Composition

Page 22: Lect1

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.

Page 23: Lect1

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”.

Page 24: Lect1

04/08/2023 24

What is a navigable association in UML?

Page 25: Lect1

04/08/2023 25

What is a navigable association in UML?

Page 26: Lect1

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

*

Page 27: Lect1

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

Page 28: Lect1

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

Page 29: Lect1

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

Page 30: Lect1

Object examples

Objects are associated and interact via messages.

04/08/2023 30

Page 31: Lect1

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

Page 32: Lect1

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

Page 33: Lect1

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

Page 34: Lect1

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

Page 35: Lect1

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

Page 36: Lect1

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

Page 37: Lect1

Specialization (EER – ENHANCED OR EXTENDED ENTITY RELATIONSHIP)

04/08/2023 37

Page 38: Lect1

• 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

Page 39: Lect1

Generalization

04/08/2023 39

Page 40: Lect1

Generalization

04/08/2023 40

Page 41: Lect1

Specialization

04/08/2023 41

Page 42: Lect1

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

Page 43: Lect1

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

Page 44: Lect1

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