Dear visitor,
welcome
to the tutorial to develop a Fat-Client application in Java !
However
you were guided to this site, maybe by mere accident or by a
recommendation, you will find the documentation about my method to
develop 'Fat-Clients' in Java.
As commercial programs usually work
with persistant data, they need an access to a database.
The
documentation shows, how database access can be directly integrated
into the 'Fat-Client' or the 'Fat-Client' uses EJBs running on a
Java-Application-Server (JAS) which are responsible for
database-access.
If this documentation helps you to learn how to utilize this technology I am pleased !
The
J2EE-developer:
Kurt Gstöttner - Information-Technology with
Java
To write me an E-Mail,
please click onto the hungry mailbox in the upper left corner.
If you are looking for the step-by-step guideline to develop a Fat-Client in Java, you may directly skip to this document.
|
Last
revision of this document: |
Prerequisites
are stated at the individual tutorials.
It is recommended that
the following tutorials are read and exercised at an early step:
*
JS_Base01
- HelloWorld.
* JS_Base02
- DataBase-Loader with a GUI.
Warning:
Reading
of the listed documents might be difficult if you miss basic
knowledge of programm-structures, Java elements or XML-elements.
At
least you should already have gained the following knowledge:
*
Basic structures of programming (if, for, while, calling subroutines
or functions and passing parameters to them).
* Basic knowledge
of object-oriented programming (create an object, passing
parameters).
* Knowledge of GUI-design in Java; I recommend the
tutorial JS_Base02 - A
DataBase-Loader with a GUI (Graphic User Interface).
* Basic
knowledge about the structure of XML.
General
scheme of the Fat-Client architecture:|
|
When the Java-Application is started, the main function contains the code to create a Frame of type JFrame. |
|
Within
the Constructor of the Frame, the function initialize
is called.
Thereafter the 'Command-Center' is waiting for an user-interaction. |
|
|
After the user has decided what to do (and choosing the right selection), another Frame of Type JFrame is created. Depending on the intention (and correct implementation) of this Frame (furthermore called 'Task-Frame'), the user can fulfill the proposition. |
Contents:The
following table shows you the steps to develop a 'Fat-Client' that
maintains error-messages in a database and produces a file in
xml-format that contains the data.
As sidesteps the code in the
base-classes (that is inhereted from the application that is
developed in this tutorial) will be explained.
Furtheron, the locally connected database will be connected to an EJB (Enterprise Java Bean) running in an application server and the 'Fat-Client' will be expanded by code to maintain the data using the EJB instead of directly writing to / reading from the locally connected database.
As final task, the data is written out into a file in xml-format and in the base-classes is implemented, that an 'Error-Dialog' can be called.
|
Tutorial |
Task |
Prerequisites |
|
Index of the
tutorials with base-knowledge for developing Fat-Clients with
Java. |
None |
|
|
JS_ErrDB_CommandCenter, |
Index
of the documents with complete code developed for this
tutorial. For a list of Code for the Base-Classes, please follow this link. |
None |
|
Index of the files with the XML-structures to control various parts of the application. |
None |
|
|
|
Description of the database-table to understand the values used for the 'Error-Dialog' later on. |
None |
|
JS_FC01b - Create a new workspace and the Project in Eclipse |
Create a new
workspace in Eclipse. |
Eclipse installed. |
|
|
Depending |
JS_FC01b - Create a new workspace and the Project in Eclipse completed - and its prerequisites too. |
|
A very simple
Graphic User Interface is created. |
Recommended: |
|
|
|
A step with no
visible result. |
Recommended: |
|
This step deals with Java-libraries to read files containing data in xml-format and to search within the xml-structure. |
Recommended: |
|
|
The ability to call methods recursively is used to 'pass by' all GUI-elements of the frame, determine their type (JFrame, JLabel, JText, etc) and search the XML-structure for language dependant text for the processed GUI-element. |
Recommended: Building
a GUI in Java using Panels read. |
|
|
JS_FC01h - Setting the properties of the GUI-elements, Part 2 |
The setting of properties, which was shown for JFrame in the previous step, is extended to JLabel, JTextField and JButton. |
|
|
|
A Graphic User
Interface to maintain 'Projects' is created. |
|
|
Warning: For some theory
please consult This lesson starts with creating a Base Class for Business Objects. |
In fact, this step
is independant from previous steps; |
|
|
JS_FC01k – Develop the General Class for the Business Object 'Project' |
The General Class
of a Business Object contains the variables and all methods that
are needed on both the Server-Side and the Client-Side of the
application. |
|
|
JS_FC01l – Develop the Client-Side Class for the Business Object 'Project' |
The Client-Side
Class of a Business Object is an extension of the General Class
and contains methods that are only needed on the Client-Side of an
application. |
|
|
JS_FC01m – Develop the Data-Base-Access (DBA) Object for the table 'Project' |
The
Data-Base-Access (DBA) Object is the low-level implementation to
perform SQL-operations toward the database. |
In fact, this step
could be the first one when developing an application; |
|
JS_FC01n – Develop the Base Class for the DataBase-ConnectionManager |
The Server-Side
derivation of the Business Object 'Projject' (developed in the
next step) needs to open a connection to the database. |
This step has only
to be done if you decided to code the Base-Classes by yourself. Recommended: |
|
JS_FC01o – Develop the Server-Side Class for the Business Object 'Project' |
The Server-Side
Class of a Business Object is an extension of the General Class
and contains methods that are only needed on the Client-Side of an
application. |
|
|
JS_FC01p – Create the database table 'Project' and establish the connection |
Before data can be
stored, a database and the database-table with its attributes has
to be created. |
Within this
turorial, |
|
JS_FC01q – React to the 'Store' button and save the data in the database |
Now it is time to
store the entered data in the database. |
|
|
JS_FC01r – Re-Display the list with the Project/Language combinations |
As a re-display of the entered data was missing in the previous step, here is documented how a list of existing database-records can be displayed. |
|
Recommended
Documents:There
is much more to increase the useability of Fat-Clients and to
beautify the appearence.
For the index of the bits and pieces of
the code please follow this link:
Advanced
Fat-Client-Development - index.
For
a To Do List to develop Fat-Client applications please follow this
link:
Fat-Client-Development
- To Do List.