Belongs to following categories: Tips, ULC6.1, ULC6.2, UltraLightClient '08,
This section contains do's and don'ts and some general good practices that might be helpful to ULC application developers.
Notification is always done through call-back functions, which are realized as listener interfaces. It is not possible to stop somewhere in your server-side code and wait until the user triggers something and to only then continue the server-side code on the next line. Your code got triggered as a reaction to a user request and we have to return a response to finish the round-trip. This is different from a pure Swing application.
Never keep instances of ULC classes in static variables (ULCIcon
s neither!). They cannot be shared between different sessions.
The same instance of a ULCComponent
cannot be added to different panes at the same time. This behaviour is analogous to Swing. Since ULCIcon
is not an instance of ULCComponent
, for a given session, you can reuse an instance of ULCIcon
within any number of panes.
Currently, you cannot modify the text in a renderer of any widget. Therefore, make sure your widget's model returns the text to be displayed. As an alternative, provide a decorator model that converts your data to its UI representation.
Do not use asynchronous event handling, except when you are aware of its consequences.
Do not access ULC components except from within the ULC thread. Otherwise, the behaviour of your application is not specified.
Keep your session serializable in order to allow proper integration into Servlet and EJB application servers. This means that all objects having your IApplication
instance as an ancestor should be serializable and any objects put in the ApplicationContext
should be serializable as well (or need to be marked as transient using ApplicationContext.setAttribute(key, value, true)
Always terminate a session by calling ApplicationContext.terminate()
. Never use System.exit()
Keep the server and client memory-footprint low by reusing ULC components like ULCFrame
, etc. Hold these components in a pool and reconfigure them before display. Keep your pool in the ApplicationContext
This section contains some ideas how you can make your Swing GUIs look more appealing.
When using the ULCBoxPane
, make sure that for each column, at least one component has its vertical constraint property set to EXPAND and for each row, at least one component has its horizontal constraint property set to EXPAND. Otherwise, your UI might like odd when extra space is available.
Use meaningful icons for buttons, toolbar entries, menus, windows, splash screens, etc.
Using rollover icons gives your toolbar buttons a nice touch.
On MS Windows clients, use the JGoodies Look&Feel. On Mac OS X clients, use the system Look&Feel.
ULC Online Shop
Use a splash screen that is shown between connecting to ULC's server-side and until the libraries and UI descriptions are uploaded to the client.
See the ULC Extension Guide
for information about the use of the new Extension API.
This section contains some suggestions what to do before and during operation.
Simulate low bandwidth
Discover client-server traffic and communication bottlenecks already during development time. This can be achieved by launching ULC's DevelopmentRunner
using the -useGui
program parameter and changing the communication speed to a lower rate.
Check reachability through firewalls and proxies
Make sure your application can be accessed from remote clients. If it fails, this might be due to firewall or proxy settings (client-side or server-side). Use the Ping tool to narrow down the problem.