|
Last
revision of this document: |
This document gives an overview of the different classes belonging to a Business-Object.
Using
Business Objects to handle data-storage and retrieval is a
general introduction of the general architecture for persistent data
(in simpler words: writing to / reading from database-tables).
It
gives an overview how the different classes cooperate.
Inheritance
structure:
Base
Class,
containing variables for the common attributes and
for reporting the status to calling methods.
Business
Object for a dedicated business-case,
containing variables
for the business-case and methods for checking and calculating.
Business
Object with methods for the client-side.
Contains methods to
get / set the values from / to GUI-Elements,
Decides what
version of the application is running (Stand-Alone or Client to a
Java-Application-Server) and controls the Business Objects for the
server-side depending on the version.
The control of the
server-side Business Objects is done either within the application
(if the version is Stand-Alone) or over the EJB-mechanism (if the
version is Client to a Java-Application-Server).
Business
Object with methods for the server-side.
Controls the access
to database-tables by using the methods of Data-Base-Access Objects
(one class for each database-table).
Base
ClassThis
class contains
* the Common
Attributes for all database-tables (see the linked document for
an explanation),
* variables to pass a Status-Code and a
Status-Message (in the case that the Status-Code signals an
error),
* constants for Status-Codes that are common to all
Business Objjects and
* a method to copy the Common Attributes
from one business-object to another.
To see the code for this class, please follow this link.
General
ClassThis
class is tailored to a business entity (e.g. a 'product', a
'Delivery Notice' or an 'Invoice') and contains
* variables
specific for the business entity,
* constants for Status-Codes
that are specific for this business entity,
* a method to copy
the variables from one business-object (of this class) to another
and
* methods requiered specific for this business entity
(e.g. calculate the weight of a delivery out
of the 'Product's individual weight;
where the
products are referenced in the position of the delivery notice.
To see an example code for a general class, please follow this link.
For a detailed description and a guideline to code a General Class, please follow this link
Client-Side
ClassThis
class expands the General Class in the following fields:
*
Methods to transfer the values of the variables (defined in the
General Class) to / from GUI-Elments (Text-Fields, Combo-Boxes,
etc).,
* Methods to be called when data should be stored or
retrieved from the database.
These methods
construct and control the fitting Server-Side Class
depending
if the Run-Version of the application is 'Stand-Alone' or
'Client-Server'.
Please se the detailed
description for more information !
To see an example code for a client-side class, please follow this link.
For a detailed description and a guideline to code a Client-Side Class, please follow this link
Server-Side
ClassThis
class expands the General Class in the following fields:
*
Methods to read from one or more database-tables by calling the
classes for Data-Base-Access.
There can be
various read-methods inplemented to use different attributes as
search criteria.
* When storing data, a mechanism is used to
incorporate the history of changes.
See Common
Attributes for all database-tables for a detailed description
how change-history is implemented.
* When storing data, a
verification process is run to prevent 2 objects
with
the same 'User-known primary key' and overlapping validity.
*
When
storing data, a verification process is run to check
that
the object was not changed since the read from the database.
To see an example code for a server-side class, please follow this link.
For
a detailed description and a guideline to code a Server-Side Class,
please follow this
link.
Related
Documents:A
simplified overview how data is written to / read from a
database:
Using
Business Objects to handle data-storage and retrieval.