Object Model
From Suhrid.net Wiki
Jump to navigationJump to searchContents
Intro
- The fundamental property of the object model is that computation takes place in and between objects.
- Individual objects are responsible for maintaining a part of systems data and for implementing parts of its functionality.
- Objects therefore combine two fundamental aspects of computer programs - data and processing.
Classes and Objects
- There can be thousands of objects of the same kind with different data.
- So the common structure of a set of objects which represent the same kind of entity is a class.
Visualization
- A running program can be seen as a network or a graph of objects. The objects form the nodes in the graph and the arcs connecting the objects are the links.
- Each object represents data and the structure of the network represents the relationships between this data.
- Objects can be created and destroyed at run time and links can also change. The structure of the graph is very dynamic.
Object Properties
- State: Objects act as containers for data.
- Behaviour: Objects have a number of operations.
- Identity: Every object is distinct from another object.
Applicability
- It is claimed that modeling with objects is easy and that objects required in a software system can be found by just looking at the real world.
- This is not really true, we also need to think about needs like ease of use, maintainability, resource utilization etc.
- So, simply copying real world objects will not work. Design is important !
- For e.g. we may need to introduce objects that are abstractions and do not correspond to real world physical things.
- The most significant benefit of the object model is not that it can model the real world, but an OO structure is likely to possess desirable properties such as easy to understand and maintain.
- It is an approach on the problem of how to relate data and processing in software systems.
Object Design
- A common metaphor is that objects should be characterized by their responsibilities.
- Objects have two basic types of responsibilities - to maintain some data and to support some processing.