GeneralThis section contains do's and don'ts and some general good practices that might be helpful to ULC application developers.
Call-back functionsNotification 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.
Static variablesNever keep instances of ULC classes in static variables (ULCIcons neither!). They cannot be shared between different sessions.
ULCComponent instancesThe 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.
RenderersCurrently, 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.
Event handlingDo not use asynchronous event handling, except when you are aware of its consequences.
Thread-safetyDo not access ULC components except from within the ULC thread. Otherwise, the behaviour of your application is not specified.
Serializable SessionKeep 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)).
Session TerminationAlways terminate a session by calling ApplicationContext.terminate(). Never use System.exit().
Component ReuseKeep the server and client memory-footprint low by reusing ULC components like ULCFrame, ULCWindow, etc. Hold these components in a pool and reconfigure them before display. Keep your pool in the ApplicationContext.
Cool GUIsThis section contains some ideas how you can make your Swing GUIs look more appealing.
ULCBoxPaneWhen 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.
IconsUse meaningful icons for buttons, toolbar entries, menus, windows, splash screens, etc.
Rollover IconsUsing rollover icons gives your toolbar buttons a nice touch.
Look&FeelOn MS Windows clients, use the JGoodies Look&Feel. On Mac OS X clients, use the system Look&Feel.
ULC Online Shop JGoodies Homepage
Splash ScreenUse 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.
Writing ExtensionsSee the ULC Extension Guide for information about the use of the new Extension API.
OperationThis section contains some suggestions what to do before and during operation.
Simulate low bandwidthDiscover 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 proxiesMake 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.
All Rights Reserved
All Rights Reserved