[jbosstools-dev] Design Question: WTP Facets

Max Rydahl Andersen max.andersen at redhat.com
Tue Jan 10 06:14:42 EST 2012


> Does anybody have experience adding facets for technologies that use configurable components?

Yes.

> I'm in the process of integrating the SwitchYard tooling with WTP.  SwitchYard contains multiple components which allow the developer to integrated with various technologies (e.g. BPM, CDI, Camel, etc.).  From the following, wich is best?

The answer depends a lot on what these things are supposed to do ?

Are they generating new artifacts that are "just" basic "markers" (manifest.mf, beans.xml, persistence.xml) or more complex ones (jpa mapping files, descriptors with actual content etc.) ? Can they be done "standalone" or is it all part of one big "enablement" which just *has* to happen in a specific sequence?

If the latter, then a Wizard is probably best - if all small individual steps that can be captured in Facet's dependency model and installation hooks mechanism then it *could* be a facet - but you see even with something as simple as "creating a manifest.mf" it might be a bad thing for some, bad for others ;)

> 1. Use a single SwitchYard facet, along with a property page that allows the user to select various component support.

Depends what they do…i.e. a SwitchYard Facet should not enable CDI explicitly, it should support (or even require?) the CDI facet.

If its a "generate a camel" descriptor file and there are no real Camel facet or tooling already then having that as part of the facet could be
ok.

The main thing is that facets should be installable with minimal fuzz - i.e. not a lot of complexity. 

If it requires more then a Wizard to setup the right things might be a better way and just let the Facet concentrate about the basics (i.e. add the marker files, enable the natures etc.)

> 2. Create a facet for each component type.  (I'd probably group these under a "SwitchYard Components" category.)

depends what they do…Facets should not be too fine-grained IMO.

> 3. Other???
> 
> I'm leaning toward option 2, since those facets could be constrained to include other facets (e.g. BPEL), but it also seems a bit cumbersome.

Need more details to answer.

The worst thing that could happen is "spaghetti" facets where a set of facets can't work without the other facets being *just* right ….

/max
http://about.me/maxandersen






More information about the jbosstools-dev mailing list