Thursday, 16 May 2013

Chapter 2- Characteristics of the Object Oriented Approach

Chapter 2- Characteristics of the Object Oriented Approach
            At the past post i have been talking about object.  We will continue about that.  In addition to the object having a state, behavior, and identity, it exists as a stand-alone entity that can be used in any relevant context or in another meaning it can be used in many closely connected ways.  Therefore, its a a reusable component.  For example, if you have a chair, you can use the same chair in an office, in a classroom, or in a garden.

                  An existing object can be used to create a similar object.  For example, you have a simple wooden chair and you need to add a headrest to it.  You do not need to create a new chair because you can easily add a headrest to the existing chair.  This is known as flexibility to change.   Now i am going to explain it in detail
                  We live in a world of objects.  Therefore, it logically follows that the object-oriented approach models the real world more accurately or follows the modelling of real world.  The object oriented approach allow you to identify entities as objects having attributes or properties  and behavior.  Attribute and behavior typically depict how the object acts and reacts.  For example, a boat is an object belonging to the class, Vehicle.  The boat has attributes such as speed, color, and weight and displays behavior such as being stationary or moving.


                  In  software industry, using existing classes or objects from other applications saves resources spent in recreating the classes from the beginning.  Consider the following example:
                  Carcare is a leading car making company.  It makes two-seater cars that are very popular among the customers aged between 20 and 24.  The company has decided to enter the family segment market and has decided to manufacture a four-seater model.
                   Carcare can either design a new car for the family segment or convert the two-seater model to a four-seater model.  The cost to design a new model is very high as compared to the cost to convert the two -seater model to a four-seater model.
                   Therefore, the management and the design team may decide to convert the two seater model into a four-seater model.
                   Two seater car:

                  Four-seater Car
                     ----Two seater car: Attributes
                     ----Two seater car: Behavior
                     ----New Attributes
                     ----New Behavior

                    The preceding example shows the concept of re-usability that is supported by the object-oriented approach.  This process of creating a new class by adding some new features to an existing class is known as inheritance .  The concept of re-usability saves time and effort, which result in cost benefits.


                   The object oriented approach allows system to evolve.  When a change is needed, the old system need not be completely abandoned.
                   Flexibility to change adds to extensibility.  The ability of a class to inherit features from another class also makes object oriented programs more extensible.  For the same reason, even during construction, parts of the system under development can be refined without any major changes to other parts.
                   Readers if you want to learn more please revisit my blog and  please comment if you want improvement .  I m anxiously waiting for you comments

No comments:

Post a Comment