• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Software Development - Thinking Object's Way
 

Software Development - Thinking Object's Way

on

  • 217 views

 

Statistics

Views

Total Views
217
Views on SlideShare
217
Embed Views
0

Actions

Likes
0
Downloads
6
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Software Development - Thinking Object's Way Software Development - Thinking Object's Way Presentation Transcript

    • Object Oriented Concepts Thinking Object’s way -Sanjay Gadge (sgadge@gmail.com)
    • What is Object?
    • What is Object?• Tangible entity and close to real world• It has state and behavior• It has responsibilities, it has to adhere to• It expects respect from rest of the world• It provides services to other objects• World is collection of collaborating entities called “objects”• Object is born and it has to die
    • OO Paradigm • Encapsulation • Abstraction • Inheritance • Polymorphism • Composition
    • Abstraction• An abstraction denotes the essential characteristics of an object that distinguish it from all other kinds of objects and thus provide crisply defined conceptual boundaries, relative to the perspective of the viewer• Focuses upon the observable behavior of the object
    • Abstraction• Abstraction provides reusability• More generic than specific – “Take me to airport” Vs “Turn Left”, “Turn Right”, “Start”, “Stop”• Abstraction provides a mean to divide and conquer problem statement• Abstraction helps in pattern identification• Abstract classes and Interfaces
    • EncapsulationEncapsulation means:• Information hiding• Hiding details : Don’t tell me how do you do it, just do it.
    • Encapsulation• An object should only expose the services required to interact with it. Details not important to the user of the object should be hidden• Services are implemented by the object• # of services should be kept minimal• Any local changes (algorithm/data) will not affect the service provided. This makes system resilient.• Services provided by the object should be seen as a contract between user-of-the-object and object-under-discussion. Both the parties should honor the contract.• The scope of data manipulation code is limited to the object thus provides better control on the data.• Give the user objects only what they absolutely needs• Services are exposed as “public” access-modifier
    • Inheritance• “Is-a” relationship• Helps in code/services reuse• Helps in locating the common code at one place hence a common change can be applied at one place only. Hence less maintenance efforts & increased readability• Base class services can be used as-it-is or can be overridden
    • Polymorphism• Literal meaning: many Shape { shapes } public void Draw();• Provides analogous Circle Rectangle interface (with different { public void Draw() { public void Draw() implementation) to { } { } users of object } }• Polymorphism- Abstraction-inheritance often go hand in hand
    • Using “private, public, protected”wiselyPrivate• Internal to object – Class level variables – Sub routines• Does not make much sense out side the object boundaries – Helper methods• Needs to be secured/shielded from out side world – Variables holding important information crucial for algorithms and values needs to be checked before assigning/setting• Contributes to the stable-state of the object – Object attributes
    • ………Using “private, protected, public”wiselyProtected• Internal to object and its derived objects and Does not make much sense out side the object boundaries but may be assessed by derived objects – Helper methodsPublic• Only meant for out side world• Mostly represent the services provided by object• Can be overridden by derived objects
    • Thank you!