You are hereThe MetroBank Demo
The MetroBank Demo
The Metrobank example is intended to showcase some of the more advanced and newer features of Aria and in particular the Spring and POJO integration.
A Quick Tour
The metroBank sample comprises an Aria swing client application which communicates with a Spring backend. The Spring backend persists data to a HSQLDB database via JPA.
On loading the application the Spring context is initialized. Depending upon the state of the backend this may take some time and therefore the load takes place on a background thread. The UI shows some news (and provides feedback on the load prgress). Switching between the tabs causes some low key animation to occur, as this is meant to be a business application the visual effects are subtle, but you probably get the idea.
Initially the application shows just the home page even though the application is running as a docking application with multiple panels and sidebars. Once logon is complete the normal docking view is restored.
Once the application starts it immediately begins to download and cache data from the backend. The cached data is not persisted at present, but it could easily be written to disk between sessions. Aria also includes the ability to record the layout and selection state of the UI between states, including features such as table column sizes and window positions that the user might have changed. On startup this information is restored so the user can more or less return to the position where they left off.
When the data has loaded the logon button is enabled (at present the first account is chosen so the logon details don't matter). As part of the load process the remote data is downloaded via Hessian as a set of DTOs and the POJOs that these DTOs represent are rendered as tables.
In the next screenshot (click on the image for an enlarged view) you can also see the new PojoDialog that can be popped up by right clicking the initial panel. As you can see the dialog is faded in and the background blurred to draw the user's attention, something that is vital in a 'rich' environment where there may be many visual distractions. Transparency is also support and you can see the non rectangular shape of the dialog, soften by rounded edges. At the time of writing however, there were some problems with the JDKs transparency that lead to artefacts when large transparent dialogs were moved about, but hopefully this can be switch on soon as it is quite an attractive feature when combined with the fade-in and out.
The dialog itself is composed from a common dialog template and adapter to the particular POJO being displayed.
The tables feature the new TableSplitter component where the first column is frozen while the others can scroll horizontally. The tables can also be sorted by clicking on the header, and a small badge is shown within the header to indicate which column is sorted (the badge painter is set via a startup property).
The third screenshot also shows the rollup bar on the left hand side which will provide quick access to key functionality, and the popup help panel on the right hand side. The popups automatically slide away when the mouse moves beyond their bounds. These features have been available in previous versions and demos, but they are now enhanced and support extended drag and drop functionality.
Programming Features
As mentioned briefly above, the MetroBank example includes many of the new features of Aria 4.0, both on the client side and on the server side. The objective of the application is not only to show the new features and their ease of use, but also to showcase the type of application that can be put together using Aria. In this light many of the features of earlier versions are included and since some of these features received liuttle exposure they may not be well known.
On the backend, one of the key features is the annotation support for Data Transfer Objects. The idea is that domain objects can be tagged for exposure to the client, Aria then dynamically creates DTOs that proxy the data held in these objects for transfer to the client. In the case of the MetroBank example the DTO are transmitted to the client via a Hessian service and cached on the client.
The client-side caching is vitally improtant for performance as otherwise a client may become overly chatty which could result in alot of wasted bandwidth and unnecessary load on the server.
Picking up from the cache is the extended support for POJOs that means that tables, forms and dialogs can be dynamically wrapped in UI components. The rendering of the POJOs can be controlled by setting attributes directly, by using view definition files or by just relying on defaults of the Aria framework. Aria includes support for basic CRUD (Create/Read/Update/Delete) operations, validations, error feedback and record navigation for these dynamica components, so there is very little to do other than pointing the framework at the relevant data to display, and even here Aria will provide rule based support for mapping and rendering various parts of the model.
Not all of these features are fully demonstrated in the MetroBank example and the application is far from being full features, but it will be fleshed out as the final release of Aria 4.0 approaches. Just as the UI is not complete, it should go without saying that the backend is not complete and the implementation is not intended to give any lessons about how an enterprise application should be structured, never mind how a banking application should be structured. In the case of this example that backend is merely there to provide sample data for the UI.
Running MetroBank
Download the Aria source, it contains the source code for both the client and server components of the MetroBank example (at samples\demos\MetroBank). Both parts are setup as NetBeans projects, but there is no reason why they won't work as Eclipse (or other IDE) projects too.
- Open the
AriaRuntimeCommonproject, or reconfigure the projects mentioned below to use theAriaRuntimeCommonjar file instead, or if you have the entire source code just open the dependant projects. - Start the MetroBank database by running the samples\demos\MetroBank\server\db\startServer.cmd batch file.
- Open the MetroBank web project (
samples\demos\MetroBank\server) and run it. A web page is shown when the server starts, but at present the web client is not finctional. - Open the MetroBank client application (
samples\demos\MetroBank\client\swing), and launch it. It should appear as in the screenshots above.
Rebuilding the Database
The database used by the application is populated with dummy data, later when the update and delete CRUD operations are in place it may be useful to restore the database and this can be done quite easily. The application uses a HSQLDB pure Java database located in the samples\demos\MetroBank\server\db folder. YOu can delete the database files and then run the create-tables.sql script to regenerate the table layout, or you can simply repopulate the tables by running the org.formaria.metrobank.db.PopulateDatabase application
More to do
Mostly the features of Aria 4.0 are now in place and are stable. The MetroBank example application will be used to showcase the remaining new features and once done a final release of Aria 4.0 will be imminent.
Work on the editor is suspended while these changes are made, but an update will be released for the next versions of both NetBeans and Eclipse. Once the MetroBank demo is complete the editor will be updated to provide support for the most significant new features, and those that really require editor support.
Some features of the older versions will be retired when the editor is updated, but mostly these were little used and obscure features. Time permitting some major new features (not yet release under SourceForge) will also be included for the release, so key an eye out.
Want to get involved?
There still plenty to do, so if you would like to contribute or get involved in shaping Aria in any way please get in touch, your help would be more than welcome.