[jbosstools-dev] Design Question: WTP Facets

Rob Cernich rcernich at redhat.com
Wed Jan 11 09:51:42 EST 2012


Hey Max,

> > Thanks for the reply.  My immediate need was to allow the inclusion
> > of component specific dependencies and configuration within a
> > SwitchYard project.  For example, when using BPM within a
> > SwitchYard project, the SwitchYard BPM dependencies must be added
> > to the POM and the SwitchYard configuration builder (mojo) must be
> > configured to scan BPM files when generating the SwitchYard
> > configuration.
> 
> Yes, but how ? are you using jboss tools maven integration for this
> which enables maven for WTP projects in general or how ?

I use m2e, with a soft dependency on JBT Maven integration.  (I use a dynamic preset for the "core" SwitchYard settings, which includes jboss.m2 if it is available.)  m2e-wtp provides configurators for setting up the deployables correctly.  As for adding the dependencies, that's just straight m2e.  And facet configuration is done by a m2e project configurator which detects the presence of the SwitchYard mojo.

If you'd like to see the current implementation, it resides here: https://github.com/jboss-switchyard/tools/tree/master/eclipse/plugins/org.switchyard.tools.ui

> > Given the above concrete example, I can either create a separate
> > component facet that can be added to the project
> 
> Since it is "simply" manipulating pom.xml based on switchyard being
> in there or not I would say this does not require a sub-facet ?

Yes, but it would also enable complementary facets (e.g. BPEL), which I assume would enable other tools on the project (e.g. validators).

> > or I can have a SwitchYard property page on the project that can be
> > used for configuring SwitchYard capabilities on the project.  In
> > the latter case, that could even mean applying component facets
> > when the user modifies the configuration.
> 
> That is what the Facet configuration UI or the Configure Project
> submenu is for….wether there is a property page or not I'm not sure.
> Doesn't hurt I guess.

That allows the facet set to be configured, but doesn't directly support configuration of the individual facets once they've been installed.

> What need to be considered too is what happens when you import the a
> switchyard maven pom project - then I assume you have a m2e
> configurator that enables this switchyard facet based on the
> presence of the dependencies, switchyard config file or the
> switchyard mojo ?

Yep.  Already in there.

> > The main reason I was considering facets for components was the
> > ability to specify requirements on other facets (e.g. SwitchYard
> > Bean component requires CDI), which (I'm assuming here) would
> > enable existing tooling functionality for those required facets on
> > the project (CDI, BPEL, etc.).  (It's also a convenient way for
> > adding/removing component functionality, through the Project
> > Facets property page.)  However, if this is not the case, then I
> > probably don't need to worry about facets for component specific
> > functionality.
> 
> That is what facets are for but SwitchYard is not the place to
> specify BPEL and BPMN facets is it ? That should be in those
> respective plugins and then you configure your facet based on this?

I think it really depends on what the user does.  If they create a SwitchYard project, then decide they want to add a BPEL service, the project settings will be updated appropriately (by SwitchYard).

> > Some more background on SwitchYard in general.  SwitchYard
> > functionality can be included in any JEE archive.  The simplest
> > case is a stand-alone SwitchYard application, which is packaged
> > and deployed as a utility JAR.  However, the SwitchYard facet may
> > be added to an existing WEB project (so long as it's a Maven based
> > project), which configures the project appropriately for
> > SwitchYard.
> 
> Is that Maven stuff a hard requirement for this to work ?  Sounds
> weird to me ?

I suppose it may be, but the SwitchYard configuration generator only exists in a Maven mojo.  A user could always hand-code everything and JAR it up themselves.

Thanks again,
Rob




More information about the jbosstools-dev mailing list