Abstraction• The main purpose of using the abstractionmechanism is to consider only those aspects ofthe problem that are relevant to given purpose• To suppress all aspects of the problem that arenot relevant.• Feature Abstraction• Data Abstraction
• Feature Abstraction A class hierarchy can be viewed as definingseveral levels of abstraction, where each class isan abstraction of its subclasses. The class is a simplified(abstract) representationof its derived classes and retains only thosefeatures that common to all its children classesand ignores the rest of the features. Thus, the inheritance mechanism can be thoughtof as providing feature abstruction
• Data Abstraction An Object itself can be considered as a dataabstraction entity. Its abstract out the exact way in which it storesits various private data items. Provides a set of methods to other object toaccess and manipulate these data items. Data Abstraction implies that each object hidesfrom other object the exact way in which it storedits internal information is organized andmanipulated.• Abstraction is a powerful mechanism forreducing the perceived complexity ofsoftware design.
Encapsulation• The data of an object is encapsulated within itsmethods.• To access the data internal to an object, otherobject have to invoke its methods, and cannotdirectly access the data.
• Encapsulation offers three important advantageas follows: Protection from unauthorized data access:It protects an object’s variable from corruption byother objects. Like : Unauthorized access,Concurrent Access to data such as deadlock andinconsistent values. Data HidingHides the internal structure of an object so that allinteractions with the object are simple andstandardized. Weak CouplingEnhance understandability of design.
Polymorphism• Poly(Many)+ morphism(Forms).• Polymorphism denotes that a method mayrespond differently.• Depends on the exact polymorphic method thatis bound.• The parameters of methods would have to bedifferent for the object to respond differently.
Polymorphism can be:• Static Polymorphism The same method call results inn differentactions depending on parameter type. Known as Static Binding.• Dynamic Polymorphism Address of invoked method can be known onlyat run time. Dynamic binding occurs when methods of thebase class overridden by the derived classesand instances of derived classes are stored inthe instances of the base class.
Related Technical Terms• Persistence Objects Usually get destroyed once a programfinishes. Persistent Objects are stored permanently.• Agents A passive object is one that performs someaction only when requested through invocation ofsome of its methods. An Agent(Active Object) monitors eventsoccurring in the application and take action. Used in applications for monitoring excptions.
• Widgets Stands for Window Object. Is a Primitive Object used for Graphical UserInterface(GUI) design. Complex GUI Widgets can be derived by basicWidgets using inheritance mechanism. Maintains the internal data such as thegeometry of window, background & forground,cursor, size, etc. Widgets are becoming the standard Componentof GUI design.
Advantage of OODThe main reason for the popularity of OOD is thatit hold the following promises.• Code and design reuse.• Increased Productivity• Ease of testing and maintenance• Better code and design understandability.
The Chief Advantage of OOD isimproved productivity• Code reuse by the use of redeveloped classlibraries.• Code reuse due to inheritance.• Simpler and more intuitive abstraction• Better Problem Decomposition.