Object-Oriented Concepts and Constructs

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).

Figure 12.1 provides a pictorial description of the OO structures and key concepts. For example, "Account", "SavingsCheckingAccount", "HomeEquity", and "CertificateAccount" are all classes. "Account" is also an abstract class; the other classes are its subclasses, which are concrete classes. "Ken Brown'sSavingsAccount" and "Ken Brown's HomeEquity Account" are objects. The "Account" class has three subclasses or children. "AccountNumber" is an instance variable, also called an attribute, and getBalance() is a method of the "Account" class. All instance variables and methods for the "Account" class are also the instance variables and methods of its subclasses through inheritance. The object "Ken Brown'sSavingsAccount" sends a message to the object "Ken Brown's HomeEquity Account", via the "transfer()" method and thereby invokes the "setMonthlyPayment()" method. Therefore, the class "SavingsCheckingAccount" is coupled to the class "HomeEquity" through the message.

Figure 12.1. An Object-Oriented Class Hierarchy

graphics/12fig01.gif

What Is Software Quality?

Software Development Process Models

Fundamentals of Measurement Theory

Software Quality Metrics Overview

Applying the Seven Basic Quality Tools in Software Development

Defect Removal Effectiveness

The Rayleigh Model

Exponential Distribution and Reliability Growth Models

Quality Management Models

In-Process Metrics for Software Testing

Complexity Metrics and Models

Metrics and Lessons Learned for Object-Oriented Projects

Availability Metrics

Measuring and Analyzing Customer Satisfaction

Conducting In-Process Quality Assessments

Conducting Software Project Assessments

Dos and Donts of Software Process Improvement

Using Function Point Metrics to Measure Software Process Improvements

Concluding Remarks

A Project Assessment Questionnaire

show all menu





Metrics and Models in Software Quality Engineering
Metrics and Models in Software Quality Engineering (2nd Edition)
ISBN: 0201729156
EAN: 2147483647
Year: 2001
Pages: 176
Similar book on Amazon

Flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net