W01+02 01 9
W01+02 01 9
01.Object-Oriented Paradigm.1
• Goals
• Design Methods
• Functional Decomposition
• Introduce an OO paradigm
• Contrast it with a functional decomposition
• Discuss important concepts of OO programming
• Goals
• Design Methods
• Functional Decomposition
• Start of a Journey
• Start of a Journey
• Analysis
• Requirements
• Problems of Requirements
• The problem?
• Experienced developers will tell you that …
• Requirements are incomplete and do not tell the whole
story.
• Requirements are typically wrong.
• Factually wrong or become obsolete
• Requirements and users are misleading.
• In addition, users may be non-technical and may not
understand the range of options that could solve their
problem.
• Their ill informed suggestions may artificially constrain
the space of solutions.
• Analysis
• Requirements
• Problems of Requirements
• Cohesion
• Coupling
• Ripple Effects
• Cohesion
• Coupling
• Ripple Effects
• OO Paradigm
• Comparisons
• In 1st scenario
• You know everything, you are responsible for
everything, if something changes you would be
responsible for handling it.
• You give explicit instructions to each entity in the
system.
• In 2nd scenario
• You expect other entities to be self sufficient.
• You give general instructions and expect other entities
to know how to apply the instructions to their specific
situation.
• OO Paradigm
• Comparisons
• OO Paradigm
• Object Responsibilities
• OO Paradigm
• Object Responsibilities
• Objects
• Classes
• If you have two Student objects, each has its own data.
• Student A has different values for its attributes than
Student B.
• But they have the same methods.
• Because methods are associated with the class that acts
as a blueprint for creating new objects
• Objects are instances of a class.
• Classes define complete behavior of their objects.
• What data and methods they have, and how the
features are accessed ,whether they are public or
private
• Objects
• Classes
• Accessibility
• Assume that …
• Object A is an instance of class X.
• Object B is an instance of class Y which is a subclass of X.
• Object C is an instance of class Z which is unrelated to X
and Y.
• UML model
• Accessibility
• Polymorphism
• Abstract Class
• Summary
• Polymorphism
• Abstract Class
• Summary