SlideShare a Scribd company logo
Object-Oriented Analysis and Design



          Introduction
Cutajar
  &
Cutajar
What is an Object?
          An object has…
             State
               ◦ Changes over time
             Behavior
               ◦ What the object does in response to messages
             Identity
               ◦ What makes the object unique
Cutajar
  &
Cutajar
State
          Not only do these people look different, they have different properties (also
          called attributes) that let us tell one from the other. Some of the properties
          that a person might have are name, age, height, and so on. Some of these,
          like age, might change (are mutable) and some, like name, might never
          change (are immutable)..



                            John                                 Maria
                            Age: 32                              Age: 35
                            Height: 6’ 2”                        Height: 5’ 10”
Cutajar
  &
Cutajar                     Jane                               Joe
                            Age: 21                            Age: 35
                            Height: 5’ 8”                      Height: 5’ 10”
Behavior
                sit!            Behavior is what the object can
                                do. That is, the effect of the
                                object responding to a message
                                or a call to a method.


                return BONE!     Some methods
                                 return something
                                 to the caller



Cutajar        eat(drumstick)
  &                                                  I said SIT!
Cutajar
                         Some methods
                         need something
                         from the caller
Identity




Cutajar
  &
Cutajar     Usually, one can tell one object from another through some
          combination of the properties. In fact, there MUST be some way
             of telling one object from another. Java uses the object’s
                                       address.
Classes
             Define the properties and behavior of objects
             Can have behavior and properties that are defined in the class but are
              independent of the individual objects




Cutajar
  &
Cutajar
Inheritance                       Object-oriented languages support
                                               some type of inheritance. Many
                                               support inheritance from more
                                               than one parent class. This is
          Human (Super Class)
                                               called multiple inheritance. Java
            having common
                                               supports only single inheritance,
             attributes and
                                               but allows a class to implement
               behaviors
                                               multiple interfaces.



                                                                         Multiple
                                                                       inheritance
Cutajar
                                                                           not
  &                                                                     permitted
Cutajar      Male                                                        in Java
                                            Female              Baby


          Subclasses inherit common features and changes or adds some of their own
Interface




Cutajar
  &
Cutajar   A Class can implement
          various interfaces and
           must define methods
          used for that interface
Polymorphism
             Different type of objects can respond to the same message
             The actual method that executes is not determined until run time
              ◦ Dynamic (or late) binding
                                                    PLAY !




Cutajar
  &
Cutajar
Overloading
              The method which the object performs is determined by the type and
               number of parameters passed to it.


                                       play(radio)




Cutajar
  &                                                                   play(guitar)
Cutajar


          play(piano)
Overriding
                                    The method in a subclass
                                     hides the method in the
                                     super class. This permits a
                                     redefinition of a method
                 I know how it       according to the particular
                should be done       needs of the subclass


            overriding                    overriding


          I know how                                   I know how
           boys do it.                                   girls do it.


Cutajar
  &
Cutajar
Encapsulation
          We are hiding the implementation details of
          a behavior. The way an object responds to
          a message is not exposed, just the fact
          that it can respond and the result type
          (response). One of the biggest advantages
          of O-O is the ability to make changes to an
          object’s implementation without affecting
          other parts of the program.

                                    How did he do
                                       that ?
Cutajar
  &
Cutajar

More Related Content

PDF
Javanotes
PDF
System design
PDF
Module 5 2010
PDF
Intermediate machine architecture
PDF
System Design
PDF
Assembly language 8086
DOCX
Keyword of java
PDF
Optimizing Combustion using a Flue Gas Analyser
Javanotes
System design
Module 5 2010
Intermediate machine architecture
System Design
Assembly language 8086
Keyword of java
Optimizing Combustion using a Flue Gas Analyser

Viewers also liked (20)

PDF
Minimum Energy Performance Standards for Boilers in India
PDF
Online Efficiency Monitoring and Diagnostics in Coal Fired Boiler
PDF
New Technologies in Process Heating
PDF
Relational
PDF
SImple SQL
PDF
Databases
PDF
PDF
Developments in Industrial Boilers, WHR and Power Boilers
PDF
Indigenization of Russian Make WHR by Vizag Steel
PDF
Boiler Water Treatment for LP,MP and HP Boiler
PDF
Hydrologic Design of a Percolation Tank
PPT
Topic11 sortingandsearching
PDF
Relational Database Examples
PDF
Intermediate Operating Systems
PDF
Boiler Superheater Design Modification
PDF
Efficient steam systems - Generation to WHR
PPT
Virtualbox
PPT
Installing virtual box and windows server 2008 R2
PPT
Inheritance, Object Oriented Programming
PPTX
Inheritance in oops
Minimum Energy Performance Standards for Boilers in India
Online Efficiency Monitoring and Diagnostics in Coal Fired Boiler
New Technologies in Process Heating
Relational
SImple SQL
Databases
Developments in Industrial Boilers, WHR and Power Boilers
Indigenization of Russian Make WHR by Vizag Steel
Boiler Water Treatment for LP,MP and HP Boiler
Hydrologic Design of a Percolation Tank
Topic11 sortingandsearching
Relational Database Examples
Intermediate Operating Systems
Boiler Superheater Design Modification
Efficient steam systems - Generation to WHR
Virtualbox
Installing virtual box and windows server 2008 R2
Inheritance, Object Oriented Programming
Inheritance in oops
Ad

Oop principles

  • 1. Object-Oriented Analysis and Design Introduction Cutajar & Cutajar
  • 2. What is an Object? An object has…  State ◦ Changes over time  Behavior ◦ What the object does in response to messages  Identity ◦ What makes the object unique Cutajar & Cutajar
  • 3. State Not only do these people look different, they have different properties (also called attributes) that let us tell one from the other. Some of the properties that a person might have are name, age, height, and so on. Some of these, like age, might change (are mutable) and some, like name, might never change (are immutable).. John Maria Age: 32 Age: 35 Height: 6’ 2” Height: 5’ 10” Cutajar & Cutajar Jane Joe Age: 21 Age: 35 Height: 5’ 8” Height: 5’ 10”
  • 4. Behavior sit! Behavior is what the object can do. That is, the effect of the object responding to a message or a call to a method. return BONE! Some methods return something to the caller Cutajar eat(drumstick) & I said SIT! Cutajar Some methods need something from the caller
  • 5. Identity Cutajar & Cutajar Usually, one can tell one object from another through some combination of the properties. In fact, there MUST be some way of telling one object from another. Java uses the object’s address.
  • 6. Classes  Define the properties and behavior of objects  Can have behavior and properties that are defined in the class but are independent of the individual objects Cutajar & Cutajar
  • 7. Inheritance Object-oriented languages support some type of inheritance. Many support inheritance from more than one parent class. This is Human (Super Class) called multiple inheritance. Java having common supports only single inheritance, attributes and but allows a class to implement behaviors multiple interfaces. Multiple inheritance Cutajar not & permitted Cutajar Male in Java Female Baby Subclasses inherit common features and changes or adds some of their own
  • 8. Interface Cutajar & Cutajar A Class can implement various interfaces and must define methods used for that interface
  • 9. Polymorphism  Different type of objects can respond to the same message  The actual method that executes is not determined until run time ◦ Dynamic (or late) binding PLAY ! Cutajar & Cutajar
  • 10. Overloading  The method which the object performs is determined by the type and number of parameters passed to it. play(radio) Cutajar & play(guitar) Cutajar play(piano)
  • 11. Overriding  The method in a subclass hides the method in the super class. This permits a redefinition of a method I know how it according to the particular should be done needs of the subclass overriding overriding I know how I know how boys do it. girls do it. Cutajar & Cutajar
  • 12. Encapsulation We are hiding the implementation details of a behavior. The way an object responds to a message is not exposed, just the fact that it can respond and the result type (response). One of the biggest advantages of O-O is the ability to make changes to an object’s implementation without affecting other parts of the program. How did he do that ? Cutajar & Cutajar