|Re: Adding RAP specific code at runtime (without affecting RCP code) [message #140533 is a reply to message #140149]
||Thu, 16 July 2009 14:08
| Benjamin Muskalla
Registered: July 2009
the single sourcing techniques we provide (trough the newsgroup,
conferences or the single sourcing guide) are only meant to be "the way
we do single sourcing successfully". It doesn't mean that there are no
other ways (instead of fragments you could also use services, DS,
extension points, etc).
Regarding your aspect-oriented approach: it's something Tom Seidel also
tried in the last weeks
( http://www.richclient2.eu/2009_07_08/singlesourcing-rap-an-a spect-orientated-approach/).
While I see the charme of this approach in the first place, I really
have to say that, depending on your application, this can easily end up
in a big chaos.
Here are some of my (personal) thoughts about this approach:
* Missing API - You'd need to intercept any method calls to missing API
and need to provide an alternative in your aspect. This may work for one
or two things but I *think* this can easily end up going crazy. While
developing the application you never know if it would compile against
the RAP runtime and need to make sure that you really add all relevant
jointpoints to your aspect. If you forgot one, it will end up in a eg.
NoSuchMethodError during runtime - something I'd never want to see in a
production system. The whole problem is that your compiler is not able
to tell you anymore that what you are doing is correct.
I think this is only one side of the coin. Maybe you want to share your
expierences with regard to single sourcing with AspectJ and Equinox
Aspects. I think it's a way to go but maybe not my personal favorite.
But still - having a tutorial or least some expierences from your side
would be really great!
Erdal Karaca wrote:
> I am "patching" my RCP code at runtime using equinox aspects.
> This allows to add RAP specific code to the platform without applying
> much of single sourcing techniques.
> In RCP I have a service (just an java interface) which is returned by
> the activator of a bundle.
> Since in RAP this service must do user specific actions, it must become
> session aware. In RAP "mode" I just add a bundle which provides the
> patch to be applied at runtime. This patch will just return (and cache)
> a new service for each session once the activator is asked for the service.
> Are there any drawbacks/issues with this method of "single sourcing"?
> What are your thoughts on this?
Benjamin Muskalla | EclipseSource Karlsruhe
http://www.eclipsesource.com | http://twitter.com/eclipsesource
Powered by FUDForum
. Page generated in 0.01747 seconds