Object Oriented Concepts Sarfaraz M Manik
Content Overview Procedural Approach Vs Object Oriented Approach. Object and Class Object Identification using CRC Encapsulation Inheritance Polymorphism Composition Properties and Constructor Interface Abstract Class and Methods
What is Object-Orientation? A Technique for System Modeling Model: A model is an abstraction of something. It helps us to understand an aspect of reality. Examples: Highway Map, Architectural Models, Mechanical Models.
 
John Object Oriented Model Car Tree House lives in drives
What is an Object? An object is: Something tangible (e.g. John, Car) Something that can be apprehended intellectually (e.g. DOB, time, account)
What is an Object? An object has: State (attributes) Behavior (operations) Unique Identity
Example: John is a tangible object State (attributes) Name Age Behavior (operations) Eats Drives Unique Identity Name
Example-1: Date is a tangible object State (attributes) Name Age Behavior (operations) Eats Drives Unique Identity Name
Example-2: Car is a tangible object State (attributes) Model Color Behavior (operations) Accelerate Change Gear Unique Identity Registration Number
Example-3: Time is an object intellectually apprehended State (attributes) Hours Minutes Seconds Behavior (operations) Get hours, Get minutes, Get seconds Set hours, Set minutes, Set seconds Unique Identity Lunch Time or Study Time
Another Example: “ … customers  are allowed to have different types of  bank accounts ,  deposit   money ,  withdraw   money  and  transfer   money  between  accounts ”
Procedural vs. Object-Oriented Procedural Withdraw, deposit, transfer Object Oriented Customer, money, account
Procedural Approach Focus is on procedures All data is shared: no protection More difficult to modify Hard to manage complexity
Advantages of Object Orientation People think in terms of object OO models map to reality OO models are: Easy to develop  Easy to understand.
Objects and Classes Classes reflect concepts, objects reflect instances that embody those concepts. girl class object Daria Jane Brittany Jodie
Objects and Classes Classes are templates based on which objects are created. For e.g. Book is a class but a particular book like Programming with C# is an object of the book class.
Conclusion OO = encapsulation  +  inheritance modularity -- autonomous entities, cooperation through exchanges of messages  deferred commitment -- the internal workings of an object can be redefined without  changing other parts of the system  reusability -- refining classes through inheritance  naturalness -- object-oriented analysis/design, modeling

Object Oriented Concept

  • 1.
    Object Oriented ConceptsSarfaraz M Manik
  • 2.
    Content Overview ProceduralApproach Vs Object Oriented Approach. Object and Class Object Identification using CRC Encapsulation Inheritance Polymorphism Composition Properties and Constructor Interface Abstract Class and Methods
  • 3.
    What is Object-Orientation?A Technique for System Modeling Model: A model is an abstraction of something. It helps us to understand an aspect of reality. Examples: Highway Map, Architectural Models, Mechanical Models.
  • 4.
  • 5.
    John Object OrientedModel Car Tree House lives in drives
  • 6.
    What is anObject? An object is: Something tangible (e.g. John, Car) Something that can be apprehended intellectually (e.g. DOB, time, account)
  • 7.
    What is anObject? An object has: State (attributes) Behavior (operations) Unique Identity
  • 8.
    Example: John isa tangible object State (attributes) Name Age Behavior (operations) Eats Drives Unique Identity Name
  • 9.
    Example-1: Date isa tangible object State (attributes) Name Age Behavior (operations) Eats Drives Unique Identity Name
  • 10.
    Example-2: Car isa tangible object State (attributes) Model Color Behavior (operations) Accelerate Change Gear Unique Identity Registration Number
  • 11.
    Example-3: Time isan object intellectually apprehended State (attributes) Hours Minutes Seconds Behavior (operations) Get hours, Get minutes, Get seconds Set hours, Set minutes, Set seconds Unique Identity Lunch Time or Study Time
  • 12.
    Another Example: “… customers are allowed to have different types of bank accounts , deposit money , withdraw money and transfer money between accounts ”
  • 13.
    Procedural vs. Object-OrientedProcedural Withdraw, deposit, transfer Object Oriented Customer, money, account
  • 14.
    Procedural Approach Focusis on procedures All data is shared: no protection More difficult to modify Hard to manage complexity
  • 15.
    Advantages of ObjectOrientation People think in terms of object OO models map to reality OO models are: Easy to develop Easy to understand.
  • 16.
    Objects and ClassesClasses reflect concepts, objects reflect instances that embody those concepts. girl class object Daria Jane Brittany Jodie
  • 17.
    Objects and ClassesClasses are templates based on which objects are created. For e.g. Book is a class but a particular book like Programming with C# is an object of the book class.
  • 18.
    Conclusion OO =encapsulation + inheritance modularity -- autonomous entities, cooperation through exchanges of messages deferred commitment -- the internal workings of an object can be redefined without changing other parts of the system reusability -- refining classes through inheritance naturalness -- object-oriented analysis/design, modeling