.

Web.com Web Hosting
Sign up for PayPal and start accepting credit card payments instantly.

.

Hello If you are new here, so you might want to subscribe for my feed so Subscribe in a reader. Or bring updates In Your Email

Sunday, July 18, 2010

Characteristics of the Object-Oriented Approach in C#

As discussed earlier, an object has a state, behavior and identity. An object is reusable. Therefore, an object exists as a stand-alone entity that can be used in any relevant context, 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 resilience to change.

Realistic Modeling

Because you live in a world of objects, it logically follows that the object-oriented approach models the real world more accurately. the object-oriented approach allows you to identify entities as objects having attributes and behavior. Attributes and behavior typically depict how the object acts and reacts. For example, the car is an object belonging to the class Vehicle. The car has attributes such as speed, color and power. It displays behavior such as being stationary, moving slowly or accelerating.

Reusability

In the software industry, using existing classes or objects from other applications saves resources spent in recreating the classes from scratch. Consider the following analogy:

Carcare is a leading car manufacturing company. Carcare manufactures two-seater cars that are very popular among the consumers aged between 20 and 24. The company has decided to enter the market of 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 involved in designing a new moedl is very high as compared to the cost involved in converting 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 family segment model.

The preceding scenario depicts the concept of reusability that is supported by the object-oriented approach. The process of creating a new class by adding features to an existing class is known as Inheritance. The benifit of reusability translates to savings in time and effort, which in turn results in cost benefits

No comments:

Post a Comment

Related Posts with Thumbnails