JSwat Development Documentation
Development Table of Contents
Design Table of Contents
General Design Goals
- Flexibility
- In general, JSwat will be designed with flexibility as one of
the most important considerations. This program will grow and
improve over some time to come, so decisions made now must not
limit future opportunities.
- Extensibility
- JSwat is a very extensible program. New debugger commands can
be written and added to the debugger without having to change the
existing code. Additionally, new actions and interface adapters can
also be easily written.
- Loose-Coupling
- The term "loose-coupling" refers to the manner in
which the various parts of a system connect with one another.
Classes that are tightly-coupled will refer to each other directly,
by name. This generally leads to inflexible designs that are hard
to extend to future needs. Loose-coupling is achieved by using
design patterns like Observer, Bridge, Strategy, Mediator, and so
on (see Design Patterns -
Elements of Reusable Object-Oriented Software by Gamma,
Helm, Johnson, Vlissides).
Output
Output from JSwat is generally displayed using the graphical
interface, via dialogs, panels, or the messages text area. This is
the normal means by which the program transmits messages to the user.
Output to the console is forbidden for all but a handful of reasons,
outlined below.
- User invokes the
stdout
or stderr
command.
- Program is running in console mode.
- Messages are being directed to standard output via the
"Capture Messages" action.
- An error occurred that could not be displayed by any other
means. This is limited to the
Main
class, which has no
elegant way of reporting errors, and the Log
class,
which sends output to the console when none of the registered
output streams are functioning.
Logging
The use of the java.util.logging.Logger
class to
report errors or warnings is forbidden. Instead, use the
UIAdapter.showMessage()
method to report any problems.
The interface adapter is reachable from a Session
instance.