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

Introduction

Content

Apply

Reflect

Extend

previous.gif
 (3087 bytes)

next.gif
 (2959 bytes)


Content Index

Content Page # 19

Kinds of real-world classes

Classes are usually of two different kinds, either classes of physical, real world objects that we wish to model on a computer (such as: Car, House, LibraryItem etc.) or classes of concepts that we wish to model on computer (such as:BankAccount, Job, StudyModule etc.).

It is usual when modelling and implementing computer programs for a system to find examples of both types of class. The difference between the two is that objects of real world classes are physical, e.g. you could kick a particular car owned by Jenny Jameson, or throw a stone through the window of the house object at 31, Pyramid Lane, Cityville. The objects of concept classes, such as John Smith’s bank account, or the module INT4120 are not physical things, although they too can be modelled and programmed and used as part of a computer system.

A note on the classes you will meet: often you will find that the objects from certain classes are solely responsible for interacting with the 'real' (i.e. non-software) world which we inhabit – for example, objects for windows, buttons, etc. You will create and use such objects from the Java library of classes. Other objects are created from classes you have identified a need for and programmed. Typically these are to do with some problem area, some domain. Hence the classes are called domain classes. Where the domain is one of business, you can see that they will have to somehow reflect the rules by which the business under consideration works. For example, if you have a banking business as the domain, any class that represents what happens with bank accounts, will have to reflect banking practices.

Back to top

basicline.gif (169 bytes)

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