You are hereAria User Guide / Appendix / Upgrading
Upgrading
- Upgrading
A significant number of changes have occured between version 1.0.4 of Aria and Aria 2.0. Many of these changes are barely noticeable but other include complete refactoring of components and subsystems and the deprecation of whole classes. This chapter covers some of the major issues involved in upgrading from previous versions of the Aria library.
Projects
In earlier versions of Aria a number of singletons were used to provide easy access to key classes and key resources. While this worked reasonably well for a single project it meant that multiple projects did not sit well with one another in the same JVM. The use of static references also complicated the initialization process and therefore the process of loading project resources.
Aria 2.0 does away with almost all of these statics and instead has one central reference point, the ProjectManager . The project manager class in effect now `owns' each project and is also the root of the object hierarchy. Each project in turn owns a set of manager classes (the classes that were singletons). Many of the reference methods to the singleton classes are still provided but they merely delegate to the ProjectManager and Project classes.
Many methods have now been expanded to include a reference to the owner project and in this way it is a little easier to ensure the correct object hierarchy. Many of the classes that use project references in this way include accessible member variables that store the project reference, for example the Page class now contains a protected member project .
Projects
As part of the restructuring of projects the ResourceManager has been deprecated and moved. The class was no longer consistent with the role of the project as the owner of resources. In most cases a reference to the ResourceManager can be replaced with a reference to the project and in the case of pages this reference is available in the parent class as mentioned above.
Page split
Another major change introduced in Aria 2.0 is the splitting of the Page class. The Page class is probably the most important class in the entire framework and contains many valuable methods. The class was part of the user interface component hierarchy and was therefore shared across widget packages. As the library has grown it has become more difficult to maintain this hierarchy without duplication and therefore we split the page class. Now most of the functionality of the class is provided by the PageHelper class.
Most of the time you should be unaware of the change. In some cases you may want to refer to the member variables in the class and for this reason access to the members has been deliberately left open.
The split also facilitates alternative page implementations, perhaps even for other platforms.
ComponentAdapters
The AWT and Swing widgets in Aria 1.0.4 all shared a common ancestor, the java.awt.Component class. Unfortunately this does not hold true for other widget sets include SWT and most other widget sets. To provide support for other widget sets we have abstracted the interaction between the framework and the widgets using a ComponentAdapter with concrete implementations of this interface being provided for Swing, AWT and SWT widget sets.
Widening of methods
One consequence of the broader support for widget sets is that we needed to widen some of the interfaces and hence many methods now take Object references where previously the took Component or Container references.
Some methods such as findComponent also now return Object references and you may need to cast the return value to the type you need.
Page references
The page class now has a number of member variables for convenience and to facilitate coding. These include references to the project and the model root. Please refer to the API document for more details.
New features
Some parts of the code and notably the examples have been changed to use new features introduced in Aria 2.0. Examples of this include the NavigationHelper class that now employs library functions whereas previously in necessitated a class derived from Page .
Aria 3.0 deprecates the NavigationHelper class as it no longer servers much use.
Deprecation
Several classes are now deprecated, these classes are moved to the org.formaria.deprecated package. The classes remain functional but be advised that we will probably drop the classes from the next major distribution of Aria.
Omitted components
Aria now relies of NetBeans to provide many of the editing facilities needed to build projects (of course you can still build applications using other tools). The NetBeans plug--in, Aria Editor is now a powerful tool with which to build Aria and Aria applications.
because of this move to the NetBeans platform the editor that was part of early distributions is now entirely omitted and will not be maintained. The new editor has a much richer feature set.