| Developer's Daily | Java Education |
| front page | java | perl | unix | DevDirectory |
Introduction
It is true that you don't need a computer degree to know how to program. However to do it with a quality that allows easy maintenance and changes is another matter.
According to Software Engineering (SE) principles, a software product life-cycle consists of these phases:
Focus on the Design Phase
In this article, I'm assuming that you fully understand the Requirement Analysis phase of the software development, and I'm just going to put the focus on the Design phase of a software product.
According to Object Oriented Analysis and Design (OOAD) in SE principles, objects in a system should exhibit two most important properties. They are:
Sample design of two "radio" objects
Let's examine the Java 1.1 Delegation Event Model by designing two objects to simulate the way an AM/FM radio system works in the real world. I name these objects "radio broadcaster" and "radio listener", based on their roles in the design. These names come from the analogy that radio broadcasting stations play in our daily life. In a given country (equivalent to a software product), anybody (objects) can set up a radio station if he/she has enough resources and presumably is qualified.
If one chooses to set up a radio station and become a radio broadcaster, one becomes a source of information (an object that provides a new service for the system) for other people, i.e., the audience.
The audience, or radio listeners, are those that consume this
information. In this analogy, these are objects that need the service
from the radio broadcaster.
Dynamic object, stable object
In real life, radio programs change every day, yet the interests of the radio listeners tends to be the same. As an example, if a person normally likes financial news, you can safely assume that he will will not hate the financial news tomorrow and choose entertainment news instead. Therefore, because the radio listener does not change as often as the radio programs, in this design, the radio broadcasters' role will be reserved for those objects that constitute the dynamic part of the software components.
From the standpoint of a company developing software, a new employee who just joined a company or has not had enough understanding of an existing software product is suitable for developing radio broadcaster objects. It can be a child or a subclass that provides new services for the system.
At this point, I guess you may have realized the part of the software
components that will be assigned radio listeners role. Yes, radio
listeners are reserved for those objects/classes that construct the core
components or base framework of the whole software system. These
radio listeners should be the part of the objects that are most likely
to be stable and require the fewest changes (if any) of the software system.
A parent (superclass) or a container object that needs to be extended to
provide new functionality is one of those objects.
Although this role participation should not be rigid since any objects can be radio listeners or radio broadcaster in this design model, remember that it is always good to plan earlier and choose wisely, so as not to affect the total development efforts in the later phases.
| About the author
E Ming Tan is currently with LearningByte International, Minneapolis MN, as a Java consultant. He's developing Java-based (Swing/JFC) multimedia courseware components, and can be reached at eming@learningbyte.com. |
|
|