While ''porting'' Riena to RAP we encounter several issues (some say challenges). Most (or probably all) of these issues are well known and RAP has already solutions for them - see [[RAP/FAQ|FAQs]] and [[RapTipsTricks|Tips and Tricks]].

+

+

+

=== Platform specific implementations ===

=== Singletons ===

=== Singletons ===

Revision as of 01:46, 18 August 2010

This page is a whiteboard with information about running Riena on RAP and known issues.

Common Problems

While porting Riena to RAP we encounter several issues (some say challenges). Most (or probably all) of these issues are well known and RAP has already solutions for them - see FAQs and Tips and Tricks.

Platform specific implementations

Singletons

Class.staticMethods() based singletons (based on static methods and static fields, i.e there is some state), e.g. ApplicationNodeManagerNote: Classes with only static methods and no static fields are not singletons

Two solve the singleton problem within RAP it provides the (abstract) SessionSingletonBase class that is able to create session-dependent singletons. This class may be used directly by calling it's (static) getInstance(Class type) method or by sub-classing and providing a taylored (static) getInstance() method.
With this it is very easy to transform the first singleton type and a little bit more work to transform the second type - both without breaking the current interface of course.

The straightforward technique of just passing a class to the getInstance() method is for most cases sufficent. However, it does not allow to:

use constructors with parameters

it is not possible to "wire" the singleton (wiring is the term we use for Riena's dependency injection)

Of course, it possible to create workarounds:

use setters instead of constructor paramters - may result in undesired usage

do the wiring within the constructor - makes e.g. unit testing more complicated

The introduction of e.g. an IInstanceFactory interface with a single getInstance() method could solve this. The class implementing the IInstanceFactory could then internally be used for creating the key to store the singleton in the session store.
And the usage of generics would be a nice bonus.