34
OOAD Lecture#1 Ms. Hina

OOAD - ShiningStudy€¦ · OOAD Lecture#1 Ms. Hina . Prerequisite OOP. OOP(OBJECT ORIENTED PROGRAMMING) – Oop concepts – Classes – Objects – Methods and constructors –

  • Upload
    others

  • View
    14

  • Download
    1

Embed Size (px)

Citation preview

Page 1: OOAD - ShiningStudy€¦ · OOAD Lecture#1 Ms. Hina . Prerequisite OOP. OOP(OBJECT ORIENTED PROGRAMMING) – Oop concepts – Classes – Objects – Methods and constructors –

OOAD

Lecture#1

Ms. Hina

Page 2: OOAD - ShiningStudy€¦ · OOAD Lecture#1 Ms. Hina . Prerequisite OOP. OOP(OBJECT ORIENTED PROGRAMMING) – Oop concepts – Classes – Objects – Methods and constructors –

Prerequisite

OOP

Page 3: OOAD - ShiningStudy€¦ · OOAD Lecture#1 Ms. Hina . Prerequisite OOP. OOP(OBJECT ORIENTED PROGRAMMING) – Oop concepts – Classes – Objects – Methods and constructors –

OOP(OBJECT ORIENTED

PROGRAMMING)

– Oop concepts

– Classes

– Objects

– Methods and constructors

– Instances

– Polymorphism

– Inheritance

– Encapsulation

– interfaces

Page 4: OOAD - ShiningStudy€¦ · OOAD Lecture#1 Ms. Hina . Prerequisite OOP. OOP(OBJECT ORIENTED PROGRAMMING) – Oop concepts – Classes – Objects – Methods and constructors –

classes

– A class is a template, or blueprint, from which objects are created.

– Objects are used to implements the classes.

Public class house

{

}

Page 5: OOAD - ShiningStudy€¦ · OOAD Lecture#1 Ms. Hina . Prerequisite OOP. OOP(OBJECT ORIENTED PROGRAMMING) – Oop concepts – Classes – Objects – Methods and constructors –

objects

Object is instance the of the class which has all the properties of its respective

class

Class_name object_name=new constructor();

Page 6: OOAD - ShiningStudy€¦ · OOAD Lecture#1 Ms. Hina . Prerequisite OOP. OOP(OBJECT ORIENTED PROGRAMMING) – Oop concepts – Classes – Objects – Methods and constructors –

methods

– A method is a set of code which is referred to by name and can be called at any

point in a program simply by utilizing the method’s name.

– Functions are the methods.

Page 7: OOAD - ShiningStudy€¦ · OOAD Lecture#1 Ms. Hina . Prerequisite OOP. OOP(OBJECT ORIENTED PROGRAMMING) – Oop concepts – Classes – Objects – Methods and constructors –

constructors

Constructors are used to initialize the variables.

Public class house

{

Public house()

{

String room=null;

}

}

Page 8: OOAD - ShiningStudy€¦ · OOAD Lecture#1 Ms. Hina . Prerequisite OOP. OOP(OBJECT ORIENTED PROGRAMMING) – Oop concepts – Classes – Objects – Methods and constructors –

instance

– An instance is a specific realization of any object, The creation of a

realized instance is called instantiation. Each time a program runs, it is

an instance of that program.

– Example:

Computer in an office

Page 9: OOAD - ShiningStudy€¦ · OOAD Lecture#1 Ms. Hina . Prerequisite OOP. OOP(OBJECT ORIENTED PROGRAMMING) – Oop concepts – Classes – Objects – Methods and constructors –

polymorphism

– polymorphism refers to the fact that you can have multiple methods with the

same name in the same class.

– Method overloading(Two or more methods or constructors with different signatures)

– Method overriding(Replacing an inherited method with another having the same signature)

Page 10: OOAD - ShiningStudy€¦ · OOAD Lecture#1 Ms. Hina . Prerequisite OOP. OOP(OBJECT ORIENTED PROGRAMMING) – Oop concepts – Classes – Objects – Methods and constructors –

inheritance

– Inheritance is the mechanism that allows us to reuse the attributes and methods of one class in

the implementation of another class.

Page 11: OOAD - ShiningStudy€¦ · OOAD Lecture#1 Ms. Hina . Prerequisite OOP. OOP(OBJECT ORIENTED PROGRAMMING) – Oop concepts – Classes – Objects – Methods and constructors –

encapsulation

– Encapsulation is a mechanism of wrapping the data (variables) and code acting

on the data (methods) together as a single unit

Page 12: OOAD - ShiningStudy€¦ · OOAD Lecture#1 Ms. Hina . Prerequisite OOP. OOP(OBJECT ORIENTED PROGRAMMING) – Oop concepts – Classes – Objects – Methods and constructors –

interfaces

– Using an interface we can tie classes together into a nice package

– It is a collection of abstract methods.

public interface Playable

{

public void play();

}

Page 13: OOAD - ShiningStudy€¦ · OOAD Lecture#1 Ms. Hina . Prerequisite OOP. OOP(OBJECT ORIENTED PROGRAMMING) – Oop concepts – Classes – Objects – Methods and constructors –

Some concepts of

software engineering

What are the software models???

Page 14: OOAD - ShiningStudy€¦ · OOAD Lecture#1 Ms. Hina . Prerequisite OOP. OOP(OBJECT ORIENTED PROGRAMMING) – Oop concepts – Classes – Objects – Methods and constructors –

Software models

– Waterfall Model.

– V-Shaped Model.

– Evolutionary Prototyping Model.

– Spiral Model

– Iterative and Incremental Method.

– Extreme programming (Agile development)

Page 15: OOAD - ShiningStudy€¦ · OOAD Lecture#1 Ms. Hina . Prerequisite OOP. OOP(OBJECT ORIENTED PROGRAMMING) – Oop concepts – Classes – Objects – Methods and constructors –

Waterfall Model

Page 16: OOAD - ShiningStudy€¦ · OOAD Lecture#1 Ms. Hina . Prerequisite OOP. OOP(OBJECT ORIENTED PROGRAMMING) – Oop concepts – Classes – Objects – Methods and constructors –

V-Shaped Model

Page 17: OOAD - ShiningStudy€¦ · OOAD Lecture#1 Ms. Hina . Prerequisite OOP. OOP(OBJECT ORIENTED PROGRAMMING) – Oop concepts – Classes – Objects – Methods and constructors –

Evolutionary Prototyping Model

Page 18: OOAD - ShiningStudy€¦ · OOAD Lecture#1 Ms. Hina . Prerequisite OOP. OOP(OBJECT ORIENTED PROGRAMMING) – Oop concepts – Classes – Objects – Methods and constructors –

Spiral Model

Page 19: OOAD - ShiningStudy€¦ · OOAD Lecture#1 Ms. Hina . Prerequisite OOP. OOP(OBJECT ORIENTED PROGRAMMING) – Oop concepts – Classes – Objects – Methods and constructors –

Iterative and Incremental

Method

Page 20: OOAD - ShiningStudy€¦ · OOAD Lecture#1 Ms. Hina . Prerequisite OOP. OOP(OBJECT ORIENTED PROGRAMMING) – Oop concepts – Classes – Objects – Methods and constructors –

Extreme programming (Agile

development)

Page 21: OOAD - ShiningStudy€¦ · OOAD Lecture#1 Ms. Hina . Prerequisite OOP. OOP(OBJECT ORIENTED PROGRAMMING) – Oop concepts – Classes – Objects – Methods and constructors –

Ooa(Object oriented analysis)

– Investigation of problem and requirements

– Requirements analysis

– OO analysis

Page 22: OOAD - ShiningStudy€¦ · OOAD Lecture#1 Ms. Hina . Prerequisite OOP. OOP(OBJECT ORIENTED PROGRAMMING) – Oop concepts – Classes – Objects – Methods and constructors –

Ood(object oriented design)

– Conceptual solution – Less detailed

– NOT implementation

– OO design

– Database design

Page 23: OOAD - ShiningStudy€¦ · OOAD Lecture#1 Ms. Hina . Prerequisite OOP. OOP(OBJECT ORIENTED PROGRAMMING) – Oop concepts – Classes – Objects – Methods and constructors –

OO Analysis and Design

– OO- Analysis :

Finding and describing objects or concepts in problem domain

– OO- Design :

Defining objects and their collaboration to fulfill requirements

Page 24: OOAD - ShiningStudy€¦ · OOAD Lecture#1 Ms. Hina . Prerequisite OOP. OOP(OBJECT ORIENTED PROGRAMMING) – Oop concepts – Classes – Objects – Methods and constructors –
Saif
Typewriter
over budget, incomplete
Page 25: OOAD - ShiningStudy€¦ · OOAD Lecture#1 Ms. Hina . Prerequisite OOP. OOP(OBJECT ORIENTED PROGRAMMING) – Oop concepts – Classes – Objects – Methods and constructors –
Page 26: OOAD - ShiningStudy€¦ · OOAD Lecture#1 Ms. Hina . Prerequisite OOP. OOP(OBJECT ORIENTED PROGRAMMING) – Oop concepts – Classes – Objects – Methods and constructors –
Page 27: OOAD - ShiningStudy€¦ · OOAD Lecture#1 Ms. Hina . Prerequisite OOP. OOP(OBJECT ORIENTED PROGRAMMING) – Oop concepts – Classes – Objects – Methods and constructors –
Page 28: OOAD - ShiningStudy€¦ · OOAD Lecture#1 Ms. Hina . Prerequisite OOP. OOP(OBJECT ORIENTED PROGRAMMING) – Oop concepts – Classes – Objects – Methods and constructors –
Page 29: OOAD - ShiningStudy€¦ · OOAD Lecture#1 Ms. Hina . Prerequisite OOP. OOP(OBJECT ORIENTED PROGRAMMING) – Oop concepts – Classes – Objects – Methods and constructors –

Basic principles of object

orientation

– 4 building blocksObject Orientation

Ab

stra

ctio

n

Enca

psu

lati

on

Mo

du

lari

ty

hie

rarc

hy

Page 30: OOAD - ShiningStudy€¦ · OOAD Lecture#1 Ms. Hina . Prerequisite OOP. OOP(OBJECT ORIENTED PROGRAMMING) – Oop concepts – Classes – Objects – Methods and constructors –

What Is Abstraction?

– The essential characteristics of an entity that distinguish it from all other kinds

of entities

• Defines a boundary relative to the perspective of the viewer

Page 31: OOAD - ShiningStudy€¦ · OOAD Lecture#1 Ms. Hina . Prerequisite OOP. OOP(OBJECT ORIENTED PROGRAMMING) – Oop concepts – Classes – Objects – Methods and constructors –

What Is Encapsulation?

– Hide implementation from clients. ƒ

– clients depend on interface

Page 32: OOAD - ShiningStudy€¦ · OOAD Lecture#1 Ms. Hina . Prerequisite OOP. OOP(OBJECT ORIENTED PROGRAMMING) – Oop concepts – Classes – Objects – Methods and constructors –

What Is Modularity?

– Modularity is the breaking up of something complex into manageable pieces.

– Modularity helps people to understand complex systems.

Page 33: OOAD - ShiningStudy€¦ · OOAD Lecture#1 Ms. Hina . Prerequisite OOP. OOP(OBJECT ORIENTED PROGRAMMING) – Oop concepts – Classes – Objects – Methods and constructors –
Page 34: OOAD - ShiningStudy€¦ · OOAD Lecture#1 Ms. Hina . Prerequisite OOP. OOP(OBJECT ORIENTED PROGRAMMING) – Oop concepts – Classes – Objects – Methods and constructors –

What Is Hierarchy?

– Elements at the same level of the hierarchy should be at the same level of

abstraction.