Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[riena-dev] FacadeFactory - How it works

Hi Stefan,

first: thanks for the tests.

Regarding your proposal, I've to disagree.

The facade factory only works because of some careful bundle /
classpath engineering on my part. It is crafted for one particular use
- picking between RWT / RWT. I'll spill the tricks below. I don't see
any way of making this generic -- however the pattern could be reused
in other contexts.

Here are the prerequisites:

- Three bundles are necessary. Two of them have different dependencies
(swt vs rwt)
- FacadeFactory and the facade implementations are in the same package
in all three bundles
- The .swt.rap and swt.rcp bundles are buddies to o.e.r.ui.swt so that
the FacadeFactory has access to their classpaths and can instantiante
classes from the common package.
- There is a naming convention <FacadeName>RAP <FacadeName>RCP

There are the tricks, but I don't think it can be made generic.

If you need a generic mechanism, I would rather look into OSGi
services (an alternative way of accomplishing this). As you know one
service can have multiple implementations.

Hope this helps,
Elias.

On Thu, Aug 12, 2010 at 6:20 AM, Liebig, Stefan
<Stefan.Liebig@xxxxxxxxxxxx> wrote:
> Hi Elias,
>
> This is really great! The RAPified Riena app is really impressive.
>
> As far as I understand there are several facades which handle the RAP/RCP specific implementations. Those facades use the FacadeFactory to create the specifc facades.
> Currently, the FacadeFactory is in the bundle org.eclipse.riena.ui.swt because it has a dependency to SWT (it uses SWT.getPlatform() to discriminate). This is the only "thing" that stops it from being moved e.g. to riena.core.
> I assume that we could use the FacadeFactory also for non-UI stuff like the navigation model. So, another home for it would be nice.
> Within riena.core we have a ContainerModel that can tell whether the code is running on the server or the client side. I wonder whether we could just use this (or some other mechanism) to discriminate between RAP/RCP?
>
> What do you think?
>
> Tschüß,
> Stefan

-- 
Elias Volanakis | Technical Lead | http://eclipsesource.com
elias@xxxxxxxxxxxxxxxxx | +1 503 929 5537 | @evolanakis


Back to the top