User Defined Types  «Prev  Next»
Lesson 6 Multiple objects
Objective Describe the Difference between an Object and a Class

Describe the Difference between an Object and a Class

At any one time, there may be many different instances of one class. Then again, there may be only one or even no instances of the class.
Use the series of images below to see an example:

Multiple objects in Classes

1) Here are two different point objects
1) Here are two different Point objects. There is still only one Point class though.

2) The state of an object is the combinatino of the values of the attributes of the object
2) The state of an object is the combination of the values of the attributes of the object. Different objects may have the same state, just as two different people may both be named John Smith. For example, here are two points, p1 and p2, which have the same state.

3) An object's state is allowed to change during its lifetime
3) In general, an object's state is allowed to change during its lifetime. For example, the point object p2 may be created with the initial values x=32.5 and y=-987.34, but later those values might be changed to x=50.0 and y = 32.0

Object-Oriented Design

Problems that lead to Requirement Ambiguity

A common problem that leads to requirement ambiguity is a fuzzy and ambiguous description, such as
  1. "fast response time" or
  2. "very easy and very secure updating mechanisms" .

A requirement such as fast response time is open to interpretation, which might lead to user dissatisfaction if the user's interpretation of a fast response is different from the system analyst's interpretation. Incomplete requirements mean that certain requirements necessary for successful system development are not included for a variety of reasons. These reasons could include
  1. the users' forgetting to identify them,
  2. high cost,
  3. politics within the business, or
  4. oversight by the system developer.

However, because of the iterative nature of object-oriented analysis and the unified approach most of the incomplete requirements can be identified in subsequent tries. When addressing features of the system, keep in mind that every additional feature could affect the performance, complexity, stability, maintenance, and support costs of an application. Features implemented by a small extension to the application code do not necessarily have a proportionally small effect on a user interface. For example, if the primary task is selecting a single object, extending it to support selection of multiple objects could make the frequent, simple task more difficult to carry out. A number of other factors also may affect the design of an application. For example, deadlines may require delivering a product to market with a minimal design process, or comparative evaluations may force considering additional features. Remember that additional features and shortcuts can affect the product.
  • Several Instances If there are several instances of a class, that is, several objects, changes that affect one object do not affect the others. Their attributes remain unchanged. For example, if Jo Smith, the example customer from the previous lesson, pays outstanding fees to reduce the account balance to zero, this does not pay off all the balances of all the other customers in the store. Their attributes are unaffected.

Objects Classes - Quiz

Click the quiz link below to confirm your understanding of objects and classes.
Objects Classes - Quiz

SEMrush Software