Object-Oriented Concepts and Constructs

Author: spec-india

Class, object, method, message, instance variable, and inheritance are the basic concepts of the OO technology. OO metrics are mainly measures of how these constructs are used in the design and development process. Therefore, a short review of definitions is in order.
- A class is a template from which objects can be created. It defines the structure and capabilities of an object instance. The class definition includes the state data and the behaviors (methods) for the instances of that class. The class can be thought of as a factory that creates instances as needed. For example, an Account class may have methods to allow deposits and withdrawals, using a balance instance variable to hold the current balance. This definition defines how an Account works, but it is not an actual account.
- An abstract class is a class that has no instances, created to facilitate sharing of state data and services among similar, more specialized subclasses.
- A concrete class is a class that has instances. For example, there might be a Savings Account class with a number of instances in a bank application.
- An object is an instantiation of a class. It is anything that models things in the real world. These things can be physical entities such as cars, or events such as a concert, or abstractions such as a general-purpose account. An object has state (data) and behavior (methods or services), as defined for the class of objects it belongs to.
- A method is a class service behavior. It operates on data in response to a message and is defined as part of the declaration of a class. Methods reflect how a problem is broken into segments and the capabilities other classes expect of a given class.
- Message: Objects communicate via messages. To request a service from another object, an object sends it a message. This is the only means to get information from an object, because its data is not directly accessible (this is called encapsulation).
- Instance variable is a place to store and refer to an object’s state data. In traditional programming, this would be a data variable. In OO paradigm, data is made up of instance variables of an object.
- Inheritance: Similar classes of objects can be organized into categories called class hierarchies. The lower-level classes (called subclasses) can use the services of all the higher classes in their hierarchy. This is called inheritance. Inheritance is simply a way of reusing services and data. As an example, Savings accounts are types of general Account, and IRA accounts are types of Savings accounts. The Savings account inherits the capability to handle deposits from the Account class. The number of subclasses in the class hierarchy is called hierarchy nesting or depth of inheritance tree (DIT).
Spec India is a Custom Software Application Development and IT Solutions Company based in Ahmedabad, India. Our Services includes Mobile, Custom Software Development, Java Application Development, Mobile Framework Application, .Net Development and .Net Framework Application Development.

Article Source:

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...