The SR-Richclient-Framework I wanted to create a similar environment for richclient applications, that an application server offeres to web applications. Additionally I wanted to have a persistence layer, that works with sql-databases without having to code any sql-statement at application level. One challenge was not to force design decisions, but to offer base functionality and services without to constrict the developer. Result is a lean framework for construction of applications with grafical user interface and the possibility to load those applications dynamically from JAR-files. It is possible to extend the services by loadable JAR-files also. The degree of documentation is "alpha" (as the same framework) - so I ask for your lenience. I will complete code and documentation as soon I get the time to do so. I choosed the following libraries as base for the framework (and of cause as base for the application): - springframework - the framework uses only small parts, but it does not harm, to take a look at that library. The framework uses
ApplicationContext and the XML-layer to setup that context. - jgoodies a Swing-library that faszinated me from first touch
- glazedlists what jgoodies is respect to Swing, is glazedlists respect to lists. Unbeatable!
- JDBC - I startet with using springframework here too, but then I decided to create my own data abstraction layer based on JDBC directly. At the moment only mysql is supported (support for other databases is prepared, but not tested yet). postgresql only promised the needed functions, but they don't work in stable debian (my standard), Derby I consider beeing just an insultation and I did not have the time yet, to care about other databases.
| The SR-Richclient-Framework consists of: - SRDAlib
- the data access layer - the base of any application
Main reason, to create a new data abstraction layer was the desire, that each business-object could be implemented by caring about one single (java-)file only. I started with a little technology study, but now several child-relations are implemented and working. Partially read entities are supported also, as well as saving single attributes or entire entity hierarchy, use different datasources at the same time, or use a migration-datasource, which means reading the same entity from one datasource and write it to another one. From applications point of view, business-objects are just javabeans, that implement an Entity interface. It is also possible to derive the business-class from an AbstractEntity . Applications interface to persistence is Repository , which hides all internal persitence helpers. Give an Entity instance to Repository to save it, of give Repository a bunch of attributes to get a list of entities, that contain that attributes. Transactions are also transparent to applications. Who wants to care about transactions can use the calls from Repository . Otherwise transactions will be created on the fly when needed. - SRGuiLib
- the grafical base classes and standard controls/dialogs to ensure a consistent look and feel.
The application frame offeres three kinds of window behaviours: MDIDesktop - "multiple document interface", which means, that there will be one real application window and all loaded applications get their virtual windows inside that window. MWIDesktop - "multiple window interface", which means, that each loaded application has its own toplevel window and the same root for all that windows is not that evident. SWIDesktop - "single window interface", which means, as with MDIDesktop there's only one real application window but this time there are no virtual windows. All loaded applications share the same visual area, where they show their content. Applications can be switched to, but it's not visible at first sight, how many applications are active. The window-handling is fully transparent to the application. It does not have to care about. Menuebars, toolbars and statusbars are adapted and changed without applications interaction. All user-interaction is implemented by Action -classes. ActionHandler s are used to setup these Actions and to centralize access to actions. An ActionHandler may be for setup only in the simplest case. - SRAppBaselib
- the service layer and baseclasses for applications.
All services that the framework or a loaded application offers, will be published by a central service. The interface for applications is the ApplicationServiceProvider -class. By the use of the ApplicationContext basic services will be configured and published. An application, that wants to use a service calls getService and receives the published service. An application, that wants to offer a service at runtime calls registerService . This way an existing service can be changed. - SRAppFrame
- the main()-Funktion and a Sample-application
| Consequences for application development - the sample application (VdrAssistant) comes without a single sql-statement at application level. The persistence layer is ready for over 90% of common database applications. If you need more complex sql-statements, it is easy to add such support.
- each business class is an implementation of
Entity , or a child of AbstractEntity . The data abstraction layer heavily uses reflection. So each businessclass has to obey the rules for Javabeans. - the framework uses dependency injection or IOC (inversion of control) a lot. That means, factory classes don't offer services by static methods. They offer their services by instance methods and are published by the
ApplicationServiceProvider . This way functionality can be changed transparently. - lots of bindings only work by contract, which is not visible from application code. So it is inevitable to read documentaion. For changing default behaviour it may be necessary, to dive into the frameworks code.
- Each user-interaction is just an
Enum -entry for the application. ActionHandler will bind that value to an application function. Invisible helpers load an image or a message matching that enum definition. - There are serveral ready to use dialogs or abstract base classes, that need only little implementaion. I.e. there's a colorselection, that allows to choose the alpha-channel also, or a font selection, that allows to choose the font with an individual usertext, ...
| |