Upload
others
View
14
Download
1
Embed Size (px)
Citation preview
OOAD
Lecture#1
Ms. Hina
Prerequisite
OOP
OOP(OBJECT ORIENTED
PROGRAMMING)
– Oop concepts
– Classes
– Objects
– Methods and constructors
– Instances
– Polymorphism
– Inheritance
– Encapsulation
– interfaces
classes
– A class is a template, or blueprint, from which objects are created.
– Objects are used to implements the classes.
Public class house
{
}
objects
Object is instance the of the class which has all the properties of its respective
class
Class_name object_name=new constructor();
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.
constructors
Constructors are used to initialize the variables.
Public class house
{
Public house()
{
String room=null;
}
}
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
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)
inheritance
– Inheritance is the mechanism that allows us to reuse the attributes and methods of one class in
the implementation of another class.
encapsulation
– Encapsulation is a mechanism of wrapping the data (variables) and code acting
on the data (methods) together as a single unit
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();
}
Some concepts of
software engineering
What are the software models???
Software models
– Waterfall Model.
– V-Shaped Model.
– Evolutionary Prototyping Model.
– Spiral Model
– Iterative and Incremental Method.
– Extreme programming (Agile development)
Waterfall Model
V-Shaped Model
Evolutionary Prototyping Model
Spiral Model
Iterative and Incremental
Method
Extreme programming (Agile
development)
Ooa(Object oriented analysis)
– Investigation of problem and requirements
– Requirements analysis
– OO analysis
Ood(object oriented design)
– Conceptual solution – Less detailed
– NOT implementation
– OO design
– Database design
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
Basic principles of object
orientation
– 4 building blocksObject Orientation
Ab
stra
ctio
n
Enca
psu
lati
on
Mo
du
lari
ty
hie
rarc
hy
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
What Is Encapsulation?
– Hide implementation from clients. ƒ
– clients depend on interface
What Is Modularity?
– Modularity is the breaking up of something complex into manageable pieces.
– Modularity helps people to understand complex systems.
What Is Hierarchy?
– Elements at the same level of the hierarchy should be at the same level of
abstraction.