Features of Object Orientation
Abstraction
When you go to buy a washing machine, you will concentrate on the features that a particular brand of washing machine offers, like the wash mode and the color, in the context of your requirements. However, if an engineer comes home to repair your washing machine, he would concentrate on the “inside” of the machine, the working of the different components of the machine, and the item code of the part to be replaced.
Here, you as a user of the washing machine concentrate on the essential attributes and behaviors from your point of view, whereas the engineer views the washing machine at a different level of detail.
Abstraction, therefore, represents the essential characteristics of an object/class that differentiates it from other objects/classes with respect to the viewer’s perspective.
Inheritance
Inheritance is a mechanism, which helps you to generalize common attributes and behaviors in separate classes from which various subclasses can be derived.
For example, the “Automatic Washing Machine” class is a subclass of the “Washing Machine” class and needs to contain only those attributes and behaviors that are specific to it. Other attributes and behaviors can be inherited from the “Washing Machine” class.
Encapsulation
Encapsulation helps you to hide unnecessary behaviors/attributes from the user and show only those attributes/behaviors that the users can directly use.
For example, the users of the washing machine need not know the intricacies of the internal working of the washing machine. They only need to know certain functions like switch on/off, wash mode settings etc.
Polymorphism is the ability of an object to behave differently under different circumstances.
For example, Joseph Picardo’s washing machine is an object of the “Washing machine” class. It behaves differently based on the mode setting. If the mode setting is “Wash”, the machine carries out the washing operation, whereas if the mode setting is “Spin Dry” a different action is performed.
Related Articles
- Advantages of Object Orientation Why do we opt for the object-oriented approach? The principal reasons are: - Realistic modeling Since we live in a world full of objects, it logically follows that the object oriented approach models the real world more accurately
- Object Oriented Approach An object is one of the first things that an infant learns to recognize. The multitude of 'things' that hover above its crib, that smile and talk to it, that pat its head and pinch its cheeks are people. Sometime
- The best Motorola mobile phone There are 11 premium games pre-loaded, three of which are played using the motion sensor and even more motion games can be downloaded. With two phones players can compete against each other via Bluetooth. It’s an interesting concept and has
- Xbox 360 Features - The Outstanding Facilities Are you contended with the Xbox 360 features? I bet you’re because the Xbox 360 features are very wonderful. These are what that can please you in every game. Since Xbox 360 achieves its atractiveness in all over the world,
- What is a Dome Security Camera Getting a good system for home security involves that you will need to supply lots of different security products to help you protect your home in the best possible way. Such of these products is a security camera. Surely it
- Build A Web Site Today! See XSitePro In ActionOne of the best inventions especially for beginners is the easy to use website builder. These programs can be part of a package deal when you sign up with a particular company to host your website
Comments
Leave a Reply




































