Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Implementing RAP from RCP - best practice?
Implementing RAP from RCP - best practice? [message #56688] Wed, 31 October 2007 23:12 Go to next message
Martin Dilger is currently offline Martin Dilger
Messages: 54
Registered: July 2009
Member
Hi,

i have an RCP Application. Now we have a new UseCase and some Logic from
the RCP CLient must be exposed to the Web.
RAP is perfect.

So what would be a best practice to work on this?
It would be important to change as few code as possible.
I thought about that. I think the best way would
be to create 2 workspaces. One for the RCP and the RAP - Application.
Every Plugin in the RCP-APplication has 2 Source-Folders, one for the RCP
dependant Code and one for the Common Code. The RAP Client has also 2
Folders, a RAP-Folder and a Source-Folder which links to the Common Code
of the RCP Application.

A Problem is, that the RCP CLient, which is already developed must be
refactored, so that RCP-dependent code is separated from the Domaincode.
Also there are several sourcefolders to be managed, and another problem
is, that the linked folders link to targets relative to the workspace, so
that every time one of my colleagues checks out the projects, the paths
have to be updated.

What are your thoughts about this? is there a better way to do that? or
how do you do that?

Thank in advance

Greetings

Martin
Re: Implementing RAP from RCP - best practice? [message #56716 is a reply to message #56688] Wed, 31 October 2007 23:17 Go to previous messageGo to next message
Martin Dilger is currently offline Martin Dilger
Messages: 54
Registered: July 2009
Member
The linked Folders are NOT relative to the workspace but absolute. Sorry,
itŽs far too late this evening.
Happy Helloween;)

Greetings

Martin
Re: Implementing RAP from RCP - best practice? [message #57288 is a reply to message #56716] Sun, 04 November 2007 17:58 Go to previous messageGo to next message
Martin Dilger is currently offline Martin Dilger
Messages: 54
Registered: July 2009
Member
No suggestions?
How do you solve such issues when both, the RCP and the RAP are developed
in parallel and the same source code should be used as far as possible?
I would really like any suggestions on this.

Martin
Re: Implementing RAP from RCP - best practice? [message #57339 is a reply to message #57288] Sun, 04 November 2007 21:39 Go to previous messageGo to next message
Eclipse User
Originally posted by: eclipse-dev.volanakis.de

Hi Martin,

we use the following approach for UI-code. We have three plug-ins:

foo.bar.ui.base - contains all common UI code
adds common contributions via plugin.xml
foo.bar.ui.rcp - contains RCP specific code
adds RCP specific contributions via plugin.xml
depends on foo.bar.ui.base
foo.bar.ui.rap - contains RAP specific code
adds RAP specific contributions via plugin.xml
depends on foo.bar.ui.base

Then we have two workspaces.
RCP workspace - has ui.base + ui.rcp. Uses RCP target.
RAP workspace - has ui.base + ui.rap. Uses RAP target.

In the beginning we had to spend some time refactoring, to move most of
the existing code to the ui.base plug-in.

Optionally: we also use a "service" approach to "inject" different
behavior into the base (example: an interface ISomething used in
ui.base. Ui.rcp / Ui.rap contribute a different implementation of
ISomething. We use a custom extension point for that. It seems you could
do the same with OSGi services too).

This works for us. YMMV.

Regards,
Elias.


Martin wrote:
> No suggestions?
> How do you solve such issues when both, the RCP and the RAP are
> developed in parallel and the same source code should be used as far as
> possible?
> I would really like any suggestions on this.
>
> Martin
>
Re: Implementing RAP from RCP - best practice? [message #57419 is a reply to message #57339] Mon, 05 November 2007 07:28 Go to previous messageGo to next message
Martin Dilger is currently offline Martin Dilger
Messages: 54
Registered: July 2009
Member
Hi,

thank you very much, this sounds quite well.
The Approach with linked source-folders is really
not practical.

Greetings

Martin
Re: Implementing RAP from RCP - best practice? [message #58081 is a reply to message #57339] Wed, 07 November 2007 00:49 Go to previous messageGo to next message
Eclipse User
Originally posted by: xinqiang_wang.yahoo.com

May I have a look on your plugin dependence setting
I am still doubt how to set the dependence for UI.BASE
thanks
Re: Implementing RAP from RCP - best practice? [message #58130 is a reply to message #58081] Wed, 07 November 2007 04:51 Go to previous messageGo to next message
Eclipse User
Originally posted by: eclipse-dev.volanakis.de

Hi David,

david wang wrote:
> May I have a look on your plugin dependence setting
> I am still doubt how to set the dependence for UI.BASE
> thanks
>

I can't post code since it is a closed source project, but I'm ok with
answering any specific questions you may have.

Essentially the issue with foo.bar.ui.base is that in the RCP scenario
it has to use the swt / jface / workbench implementation that is part of
RCP - and in the RAP scenario it has to use the RAP equivalents. So how
to you express this different dependencies in the MANIFEST.MF ?

It think this can be tackled in three ways:

(a) having two different MANIFEST.MFs in each workspace

(b) having a optional dependencies to both the org.eclipse.ui plugin and
the org.eclipse.rap.ui plugin. Since only one of those exists in any
target (RCP / RAP) you are fine. I just tried this approach and it works
for me. I like it because is relatively simple, but have to use it for a
bit more to see if there are any drawbacks.

The MANIFEST.MF looks like this:
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.ui;resolution:=optional,
org.eclipse.rap.ui;resolution:=optional

(c) Using Import-Package instead of Require-Bundle. With this you can
specify that you want to use some packages in your plug-in but do not
care from what plug-in the implementation is coming from. The OSGi crowd
favors this approach for the added flexibility (for example it does not
matter if you refactor the package and move it to another plug-in). The
drawback is that you potentially have to add many packages to the
Import-Package statement in the MANIFEST.MF until you have everything
you need.

Let me know if this helped. :-)

Regards,
Elias.
Re: Implementing RAP from RCP - best practice? [message #58154 is a reply to message #58130] Wed, 07 November 2007 06:16 Go to previous messageGo to next message
Eclipse User
Originally posted by: xinqiang_wang.yahoo.com

Yes! the b) is gooood for me

I have try the c) but i feel too tire to work

thank you very much
Re: Implementing RAP from RCP - best practice? [message #58254 is a reply to message #58154] Wed, 07 November 2007 09:09 Go to previous messageGo to next message
Martin Dilger is currently offline Martin Dilger
Messages: 54
Registered: July 2009
Member
Hi,

thank you very much!!
This helped me, I just had this problem and was searching for a nice
solution!
You really helped me, if we ever meet, IŽll pay the bill
for the beers;)

Kind regards

Martin Dilger
Re: Implementing RAP from RCP - best practice? [message #60150 is a reply to message #58254] Fri, 16 November 2007 01:08 Go to previous message
Eclipse User
Originally posted by: xinqiang_wang.yahoo.com

very gooood news


I have setup my project which for telecommunication SMS web-app
they need both RCP and RAP

I got most of developers work on RCP branch
so they are easy to develop and test
no need wait the browser to startup to play the RAP

the RAP and RCP can reuse all of the VIEWs code and some perspective's

that 's very excellent

----------------------------


I will pay bill too
once anybody trip to my town even my country
I will pay the beer and the dinner
Previous Topic:Hibernate and Jetty and Plugin
Next Topic:History of RAP
Goto Forum:
  


Current Time: Sat Sep 20 22:08:54 GMT 2014

Powered by FUDForum. Page generated in 0.05340 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software