Class Modeling : Object and Classes

A class model covers the static type structure of the system by defining the objects in the system, the relationships between objects, and the attributes and operations for each class of objects. The class model is one of three very important models. I tend to think of building a system around objects rather than functionality, as an object-oriented system more closely matches the real world and is consequently more flexible with respect to change. Class models provide knowledge of the graphical representation of the system which enables them to communicate with customers.

Object and Class Concepts

Objects

The main objective of class modeling is to depicting objects. An object is a concept, abstraction, or identifiable thing that means an application. Objects often appear or may use as proper nouns or specific references in problem descriptions and discussions with users. Some objects have real world counterparts, while others are conceptual entities. The choice of objects depends on the decision and the nature of the problem: there may be several correct representations.

All things have their own identity and they are different from each other. Just as there are two mangoes of the same colour, size and still different mangoes, a person may eat one mango and then eat another. Similarly, identical twins are two different individuals, even though they look alike. The term identity means that objects can be distinguished by their inherent existence, and not by the descriptive properties that they may possess.

Classes

An object is an instance or event of a class. A class describes a group of objects with similar properties (called attributes), behavior (called operations), types of relationships, and semantic. Person, Company, Process, and Window all are belongs in classes. Each person has a name and date of birth and can work on the job. Each process has an owner, priority, and a list of required resources. Classes often appear as common nouns and noun phrases in problem descriptions and discussions with users.
Objects in a class have the same properties and kinds of behavior. Most objects derive their personality from differences in their characteristic values ​​and specific relationships from other objects. However, objects with the same attribute value and relation are possible. The choice of classes depends on the nature and scope of an application and is a matter of decision.
Objects in a class share a common semantic purpose, above and beyond requiring common characteristics and behavior. Every object "knows" about its class. Many Object Oriented programming languages ​​can determine an object's class at run time. The class of an object is an inherent property of the object.

Class Diagram

Here, there is two type of models structure- (i) class diagram and (ii) object diagram.

The class diagram gives a graphical notation for modeling classes and their relationships, to describe all possible objects. Class diagrams are very important for both modeling abstractions and designing real (main) programs.

An object diagram represents all individual objects and their relationships. Object diagrams are helpful for documenting test cases and discussing examples. A class diagram is equivalent to an infinite set of object diagrams.

Values ​​and Properties

Value means a piece of data. For example you can get the value by checking the problem documentation. An attribute is a named property of a class that explain about the value held by each object of the class. You can find attributes by looking for adjectives or by abstracting specific values. Structural constructs i.e. class and relationship govern class model. Attributes are not more importent and serve a wide range of classes and relations.

Operations and Methods

An operation(behaviour) is a function or procedure that can be implemented in a class or by an object in a class. Hire, Fire and Pay Dividend are may be operations on class company. There are open, close, hide, and redisplay operations on the class window. All objects in a class share the same operation.

All operations (behaviors) have a target object as an implicit argument. The behavior of the operation depends on the class of its target. An object "knows" about its class, and hence the correct implementation of operations.

The same operation(behaviors) may apply to many different-different classes. This kind of operation is polymorphic: i.e. the same operation occurs in different forms in different classes. A method is an implementation of an operation for a class. For example, an operation in a class file might be print.

Post a Comment

0 Comments