Unit – 1 (Introduction to OOAD)

Embed Size (px)

Citation preview

  • 8/14/2019 Unit 1 (Introduction to OOAD)

    1/61

    1

    Unit 1 (Introduction to OOAD)

    An overview of object oriented systems

    development.

    Object basics object oriented systems development life

    cycle

  • 8/14/2019 Unit 1 (Introduction to OOAD)

    2/61

    2

    Important Programming Models

    Procedure OrientedAlgorithms Object Oriented Classes & Objects

  • 8/14/2019 Unit 1 (Introduction to OOAD)

    3/61

    3

    1.Space efficiency

    2.Time efficiency

    2.1 Worst case efficiency

    2.2 Best case efficiency

    2.3 Average case efficiency

    Algorithm Analysis

  • 8/14/2019 Unit 1 (Introduction to OOAD)

    4/61

    4

    Algorithm analysis (Continued)

    1. Worst case efficiency

    It is the efficiency for worst case input ( worst case

    input is the one for which the algorithm runs longest).

    2. Best case efficiency

    It is the efficiency for best case input ( best case input is

    the one for which the algorithm runs fastest).

    3. Average case efficiency

    It is the efficiency for Average case input

  • 8/14/2019 Unit 1 (Introduction to OOAD)

    5/61

    5

    Algorithm analysis (Continued)

    Case 1:

    If the algorithm is depending only on the input size ,

    we need not to find best,worst and average case efficiencies

    separately.

    Case 2:

    If the algorithm is depending not onlyon the inputsize ,bust also some factors then find we have to fine

    worst,best and average case efficiencies separately.

  • 8/14/2019 Unit 1 (Introduction to OOAD)

    6/61

    6

    Differentiate OOP, OOA & OOD.

  • 8/14/2019 Unit 1 (Introduction to OOAD)

    7/61

    7

    Object Oriented Programming

    A language is object oriented if and only if

    it satisfies the following requirements:

    1.Supports objects

    2.Objects have a class

    3.Class may inherit attributes from super class.

  • 8/14/2019 Unit 1 (Introduction to OOAD)

    8/61

    8

    Object Oriented Analysis

    It is a method of analysis that examinesrequirements from the users.

    .contd

  • 8/14/2019 Unit 1 (Introduction to OOAD)

    9/61

    9

    Object Oriented Design

    It leads to an object oriented

    decomposition.

    Uses different notations to expressdifferent models.

  • 8/14/2019 Unit 1 (Introduction to OOAD)

    10/61

    10

    Introduction

    System developmentrefers to all activities thatproduces the solution.

    System development activities consists ofanalysis, modeling, design, implementation, testing &maintenance.

    A software development methodologyis aseries of processes that, if followed , can lead to thedevelopment of an application.

  • 8/14/2019 Unit 1 (Introduction to OOAD)

    11/61

    11

    Object Model

    The main principles of object model area) abstraction

    b) encapsulation

    c) modularityd) hierarchy

    e) typing

    f) concurrencyg) persistence

  • 8/14/2019 Unit 1 (Introduction to OOAD)

    12/61

    12

    Major Elements of Object Model

    a) abstraction

    b) encapsulation

    c) modularity

    d) hierarchy

  • 8/14/2019 Unit 1 (Introduction to OOAD)

    13/61

    13

    Minor Elements of Object Model

    a) typing

    b) concurrency

    c) persistence

  • 8/14/2019 Unit 1 (Introduction to OOAD)

    14/61

    14

    It focuses upon the essential characteristics of

    objects.

    (e.g.) Project Abstract

    a) What is Abstraction?

  • 8/14/2019 Unit 1 (Introduction to OOAD)

    15/61

    15

    b) What is Encapsulation?

    Hides the details of the implementation (data &

    procedure) of an object(e.g.) Hides the details of the implementation from

    clients.

    - Provides the interface.

  • 8/14/2019 Unit 1 (Introduction to OOAD)

    16/61

    16

    c) What is Modularity?

    The breaking up of something complex

    into manageable pieces

    Effective Modular design1.Cohesion

    2.Coupling

  • 8/14/2019 Unit 1 (Introduction to OOAD)

    17/61

    17

    Ranking or Ordering of abstraction

    d-1) What is Hierarchy?

    Decreasingabstraction

    Increasing

    abstraction Vehicle

    Elements at the same level of the hierarchyshould be at the same level of abstraction

    Car

    Ford

    Mustang Taurus Thunderbird

  • 8/14/2019 Unit 1 (Introduction to OOAD)

    18/61

    18

    d-2) What is Hierarchy?

    At the top of the hierarchy are the most

    general classes.

    At the bottom are the most specific. A subclass inherits all of the properties &

    methods from the superclass.

  • 8/14/2019 Unit 1 (Introduction to OOAD)

    19/61

    19

    e) Typing

    It is the enforcement of the class of an

    object, such that objects different types

    may not be interchanged, or at the most ,

    they may be interchange only in veryrestricted ways.

    Strong typing prevents mixing

    abstractions.

  • 8/14/2019 Unit 1 (Introduction to OOAD)

    20/61

    20

    f) Concurrency

    It allows different objects to act at the

    same time.

    Its the property that distinguishes an

    active object from one that is not active.

  • 8/14/2019 Unit 1 (Introduction to OOAD)

    21/61

    21

    g) Persistence

    It is the property of an object through

    which the object continues exists after its

    creator ceases to exists and / or the

    objects location moves from the addressphase in which it was created.

  • 8/14/2019 Unit 1 (Introduction to OOAD)

    22/61

    22

    Basic Concepts of Object

    Orientation Object

    Class

    Attribute (Property) Method (Procedure)

    Inheritance

    Interface (Polymorphism) Relationships

    1 ) Wh t i Obj t?

  • 8/14/2019 Unit 1 (Introduction to OOAD)

    23/61

    23

    1a) What is an Object?

    It is a combination of data & logic that

    represents some real world entity, eitherphysical, conceptual, or software

    Physical entity (e.g.) car

    Conceptual entity (e.g.) chemical process

    Software entity (e.g.) linked list

    1b) R ti Obj t

  • 8/14/2019 Unit 1 (Introduction to OOAD)

    24/61

    24

    An object is represented as rectangles

    with underlined names

    1b) Representing Objects

    : Professor

    Professor Nandhini

    ProfessorNandhini:

    Professor

    ProfessorNandhini

    Object Name Only

    Class and Object Name

    Class Name Only

  • 8/14/2019 Unit 1 (Introduction to OOAD)

    25/61

    25

    2a) What is a Class?

    A class is a set of objects with common

    properties (attributes), behavior (operations),

    and relationships

    - An object is an instance of a class

    ) C

  • 8/14/2019 Unit 1 (Introduction to OOAD)

    26/61

    26

    A class is represented using acompartmented rectangle

    2b) Representing Classes

    Professor

    Professor Rani

    a + b = 10

    2 ) Cl C

  • 8/14/2019 Unit 1 (Introduction to OOAD)

    27/61

    27

    2c) Class Compartments

    A class is comprised of three sections

    The first section contains the class name

    The second section shows the structure

    (attributes)

    The third section shows the behavior(operations)

    ProfessornameempID

    create( )save( )delete( )change( )

    Class Name

    Attributes

    Operations

    2d)The Relationship Bet een

  • 8/14/2019 Unit 1 (Introduction to OOAD)

    28/61

    28

    Objects are grouped into classes

    2d)The Relationship Between

    Classes and Objects

    Objects

    Professor Smith

    Professor Jones

    Professor Mellon

    Class

    Professor

    3 Wh t i Att ib t ?

  • 8/14/2019 Unit 1 (Introduction to OOAD)

    29/61

    29

    3 What is an Attribute?

    Class

    Example

    Attributes

    Car

    Cost

    Color

    Manufacturer

    Model

    Another name properties

    It describe the state (data) of an object.

  • 8/14/2019 Unit 1 (Introduction to OOAD)

    30/61

    30

    Define its behavior (what an object is

    capable of doing).

    CourseOffering

    addStudent

    deleteStudent

    getStartTime

    getEndTime

    Class

    Operation

    4) What is method (or) procedure?

  • 8/14/2019 Unit 1 (Introduction to OOAD)

    31/61

    31

    5a) Inheritance

    It allows objects to be built from other

    objects.

    It is a relational ship between classes.

    (one class is the parent of other (derived)

    class.

    The parent class is also known as the

    base class (or) super class.

    5b) E l Si l I h it

  • 8/14/2019 Unit 1 (Introduction to OOAD)

    32/61

    32

    Account

    balancenamenumber

    Withdraw()CreateStatement()

    Checking

    Withdraw()

    Savings

    GetInterest()Withdraw()

    Superclass

    (parent)

    Subclasses

    Generalization

    Relationship

    Ancestor

    Descendents

    5b) Example: Single Inheritance

    One class inherits from another

  • 8/14/2019 Unit 1 (Introduction to OOAD)

    33/61

  • 8/14/2019 Unit 1 (Introduction to OOAD)

    34/61

  • 8/14/2019 Unit 1 (Introduction to OOAD)

    35/61

    35

    Poly means many

    Morph means form

    Polymorphism

    the same operation maybehave differently on different classes.

    Booch defines Polymorphism as the

    relationship of objects of many different classes

    by some common super class.

    6) What is Polymorphism ?

  • 8/14/2019 Unit 1 (Introduction to OOAD)

    36/61

    36

    Association

    Aggregation

    Dependency

    Generalization

    Realization

    7a) Relationships

    7b)Relationships: Association

  • 8/14/2019 Unit 1 (Introduction to OOAD)

    37/61

    37

    Professor UniversityWorks for

    Class

    Association

    Association Name

    Professor University

    EmployerEmployee

    Role Names

    7b)Relationships: Association It represents the relationships between objects &

    classes.

    7c)Relationships: Association

  • 8/14/2019 Unit 1 (Introduction to OOAD)

    38/61

    38

    EmployerEmployee

    7c)Relationships: Association It is rendered as a solid line.

    It has a name & a role.

    Person Company

    Person Company

    Works for

    Association

    ROLES

    ASSOCIATION NAMESName Direction

    Name

    Association Role Name

  • 8/14/2019 Unit 1 (Introduction to OOAD)

    39/61

    39

    7d)Relationships: Aggregation

    A special form of association that models a

    whole-part relationship between an

    aggregate (the whole) and its parts

  • 8/14/2019 Unit 1 (Introduction to OOAD)

    40/61

    40

    College Department

    Whole

    Aggregation

    Part

    7e) Relationships: Aggregation

    (e.g.)

    7f) R l ti hi A ti

  • 8/14/2019 Unit 1 (Introduction to OOAD)

    41/61

    41

    Engine wheel

    7f) Relationships: Aggregation (e.g.) a car object of other objects such as

    engine, seat and wheel objects.

    Car

    Seat

    7g) Relationships: Dependency

  • 8/14/2019 Unit 1 (Introduction to OOAD)

    42/61

    42

    Client Supplier Class

    Dependency relationship

    7g) Relationships: Dependency

    A relationship between two model elements where a

    change in one may cause a change in the other Non-structural, using relationship

    7h) Relationships: Generalization

  • 8/14/2019 Unit 1 (Introduction to OOAD)

    43/61

    43

    7h) Relationships: Generalization

    It is a relationship between a general thing

    (called the super class or parent) & a more

    specific kind of that thing (called the

    subclass or child)

    Generalization is an is-a-kind of

    relationship

    7j) Relationships: Generalization

  • 8/14/2019 Unit 1 (Introduction to OOAD)

    44/61

    44

    7j) Relationships: GeneralizationShape

    origin

    move( )

    resize( )

    display( )

    Rectangle

    Corner : Point

    Circle

    Corner : Point

    Polygon

    Points : List

    Display

    Square Leaf class

    Generalization

    Base class

    7k) Relationships: Realization

  • 8/14/2019 Unit 1 (Introduction to OOAD)

    45/61

    45

    Use Case Use-Case Realization

    Canonical form

    7k) Relationships: Realization

    b) It is used for tracebility

  • 8/14/2019 Unit 1 (Introduction to OOAD)

    46/61

    46

    (continued)

    8) Review: Introduction to Object Orientation

    What are the four basic principles of objectorientation? Provide a brief description of each.

    What is an Object and what is a Class? What is the

    difference between them?

    What is an Attribute? What is an Operation?

    What is an Interface? What is Polymorphism?

    Name the 4 basic UML relationships and describe

    each.

    Describe the strengths of object orientation.

    Software Development Life

  • 8/14/2019 Unit 1 (Introduction to OOAD)

    47/61

    47

    Software Development Life

    Cycle

    System developmentrefers to all activities thatproduces the solution.

    System development activities consists ofanalysis, modeling, design, implementation, testing &maintenance.

    A software development methodologyis aseries of processes that, if followed , can lead to thedevelopment of an application.

  • 8/14/2019 Unit 1 (Introduction to OOAD)

    48/61

    48

    Linear Sequential Model (Or) Waterfall model

    Prototyping model

    Evolutionary Model Incremental model

    Spiral model

    WIN - WIN model

    Object oriented model

    2e) Software Development Process

  • 8/14/2019 Unit 1 (Introduction to OOAD)

    49/61

    49

    analysis design code test

    System/information

    engineering

    Linear Sequential Model

  • 8/14/2019 Unit 1 (Introduction to OOAD)

    50/61

    50

    (e.g.) The waterfall software development process

    What

    How

    Do It

    Test

    Use

  • 8/14/2019 Unit 1 (Introduction to OOAD)

    51/61

    51

    Prototyping Model

    Customer

    Communication Quick Design

    BuildPrototype

    Customer

    evaluation ofPrototype

    I t l M d l

  • 8/14/2019 Unit 1 (Introduction to OOAD)

    52/61

    52

    analysis design code test

    analysis design code test

    analysis design code test

    analysis design code test

    increment 2

    increment 3

    increment 4

    increment 1

    delivery of1st increment

    delivery of2nd increment

    delivery of3rd increment

    delivery of4th increment

    calendar time

    IncrementalModel

    S i l M d l

  • 8/14/2019 Unit 1 (Introduction to OOAD)

    53/61

    53

    Spiral Model

    CustomerCommunication

    Planning

    Construction & Release

    Customer

    Evaluation

    Engineering

    Risk Analysis

    3 ) OO S t D l t A U

  • 8/14/2019 Unit 1 (Introduction to OOAD)

    54/61

    54

    3a) OO System Development : A Usecase

    Driven Approach

    Using CASE

    Tools and/or

    OO

    programming

    languages

    Build a Use-Cases

    model

    Object analysis

    Validate test

    Design classes, define

    attributes and methods

    Build object

    model

    Build User Interface

    & Prototype

    User satisfaction

    & Quality test

    Usersatisfaction &

    Quality test

    3b) OO System Development : A

  • 8/14/2019 Unit 1 (Introduction to OOAD)

    55/61

    55

    3b) OO System Development : A

    Usecase Driven Approach

    OO System Development includes the

    following activities:

    OO Analysis

    OO Design

    Prototyping

    Component based development Testing

  • 8/14/2019 Unit 1 (Introduction to OOAD)

    56/61

    56

    4c) OO Analysis

    OO analysis includes the following

    activities:

    Determining the system requirements.

    Identifying classes and their relationship to

    other class in the problem domain.

  • 8/14/2019 Unit 1 (Introduction to OOAD)

    57/61

    57

    4d) OO Design

    OO Design includes the following

    activities:

    Design the classes.

    Design the user interface

  • 8/14/2019 Unit 1 (Introduction to OOAD)

    58/61

    58

    4e) OO Design - Guidelines

    Reuse rather than build a new class.

    Design a large no. of simple classes rather

    than a small no. of complex classes.

    Design methods.

    Critique what you have proposed. If

    possible, go back & refine the classes.

    4f) Prototyping

  • 8/14/2019 Unit 1 (Introduction to OOAD)

    59/61

    59

    4f) Prototyping

    A version of a software product developedin the early stage of the products life cyclefor specific, experimental purposes.

    Easy to understand Types of Prototyping

    1.Close ended (or) Throwaway

    2.Open ended (or) Evolutionary

  • 8/14/2019 Unit 1 (Introduction to OOAD)

    60/61

    60

    4g) Testing

    1.White box testing

    2.Black box Testing

  • 8/14/2019 Unit 1 (Introduction to OOAD)

    61/61

    THANK YOU!