> List of tutorials

Index for Advanced Java Fat-Client-Development

Business Object, Server-Side Class - Advanced Java Fat-Client-Development

* For this document and all references (links) please obey the hints and regulations concerning copyright, disclaimer and trademarks.

  • The owner of this web-site (www.javascout.biz) is not responsible for the content of web-sites linked within this document or other documents of www.javascout.biz.

  • If this document or other documents of this web-site (www.javascout.biz) infringes your rights or you think that rights of others (third parties) are infringed, please inform the author.
    An e-mail can be sent by clicking onto the 'hungry mailbox' in the upper right corner.

Last revision of this document:
2006-07-18

This document gives an overview of the different classes belonging to a Business-Object.

Prerequisites:

Mission of the Server-Side-Class:

The Server-Side Class of the Business Object, designed to run on the machine were the database-system is installed, comprehends
* methods to establish a database-connection if it was not already passed as parameter,
* one methods on a high level to store the business-values of the Business Object into the database-system
   (technical term: make the data persistent),
* methods on a high level to retrieve data and fill the business-variables of the Business Object;
   even if the data is spread over more than one database-table,
* methods to construct Data-Base-Access (DBA) Objects and call the methods of the DBA
   to perform low-level database-operations, and
* methods to transfer the values of the variables of the Business Object to the variables of Data-Base-Access (DBA) Objects and
* a decision logic if a transaction (a set of database operations which assure the integrity of data-relations on the database)
   was completely fulfilled and can be committed or
   failed at one step and the database-operations before have to be 'rolled back'.

top.

To-Do-List to implement the class:

Please obey, that all Server-Side Classes for Business Objects are put into a package (suggestion: application.bos) that is different for those for General Classes (suggestion: application.bo) and Client-Side Classes (suggestion: application.boc).
This is done to simplify the packaging-script when the application is versioned to run as Client/Server.
The Server-Side class is only needed on the EJB (Enterprise Java Bean) running on the JAS (Java Application Server) and packed into the JAR-file for the EJB.
The General Classes are needed on both the Client Application and the Server-Side (and packed into the JAR-file for the Client-Side as well as into the JAR-file for the EJB) while the Client-Side Classes are only needed for the Fat-Client application.

A fast way to get the code is to copy from an existing class and modify it.
A class with working code (from the tutorial Develop a Fat-Client in Java) is JS_ErrDB_Project_BOS.

Steps to code the class:

The next implementation steps (for this class) need the Server-Side class to be implemented to a degree that allows to 'store' the values to the relevant database-tables.
If you want to do some 'testing' using the debugger, it is advisable to programm the code that is triggered by the decisive event to transfer the values from the GUI-elements to the variables of the Business Object.
If you want to continue with the task to store and retrieve data, start coding the DBA Object and then the Server-Side class of the Business Object.

All 'getBy....' methods that may deliver more than the data of one database-record are coded in an own class.
To see an example of such a class, please follow this link.

top.

Related Documents: