您的位置:寻梦网首页编程乐园Java天地Core JavaJava Lecture Notes

Introduction

Content

Apply

Reflect

Extend

previous.gif
 (3087 bytes)

next.gif
 (2959 bytes)


Content Index

Content Page # 10

Overview of object concepts

Object concepts are not limited to computer programming. Fundamentally, object concepts provide a framework for modelling in terms of the objects which make up a system. Other, more traditional, modelling techniques have concentrated on either the data managed by a system (e.g. data flow modelling) or on the operations the system carries out (e.g. functional decomposition). Object-oriented analysis and design allows both data and operations to be modelled (encapsulated) together, in a way that can be used to design and implement computer programs that preserve and exploit such an encapsulated view of systems and their component objects.

The fundamental concept in all object-oriented technologies is the object. At a high level of abstraction an object is a software component that has:

  • behaviour: an object can do work
  • state: an object can remember aspects of its work
  • individuality: an object can be distinguished from other objects without having to look at any part of its state – i.e. each object can be referred to via an individual identifier

An object is an instance of a class. There may be many objects all based on the same class.

To imagine an instance of a class, consider the Notepad application that is provided as an accessory in Windows operating systems. (Whether or not Notepad is object-oriented does not matter, it behaves in an object-oriented manner.) You can imagine starting Notepad a number of times (see later activity) Each time you start an instance of Notepad is like creating an object of the class Notepad. Each instance is different from another although we as humans can probably only tell the difference by what is written on the pad or by the name we give to a note pad document.

An important part of analysing what classes might be involved in an object-oriented system also involves analysing what responsibilities objects of a class might have and how they might collaborate with objects of other classes. This should become apparent as you go through the module.

Back to top

basicline.gif (169 bytes)

RITSEC - Global Campus
Copyright ?1999 RITSEC- Middlesex University. All rights reserved.
webmaster@globalcampus.com.eg