[jboss-as7-dev] API Feedback Releases: ShrinkWrap Descriptors 1.2.0-alpha Series

Andrew Lee Rubinger andrew.rubinger at redhat.com
Thu Sep 15 11:26:49 EDT 2011


Thanks for the feedback, Remy.  Inline.

On 09/14/2011 09:31 AM, Remy Maucherat wrote:
 > On Tue, 2011-09-13 at 17:20 +0200, Andrew Lee Rubinger wrote:
 >> Hi all:
 >>
 >> Last week we made available ShrinkWrap Descriptors 1.2.0-alpha-1.
 >>
 >> The scope of this project is very simple: Provide a object model DSL for
 >> metadata.  For instance:
 >>
 >> final WebAppDescriptor desc = Descriptors.create(WebAppDescriptor.class)
 >>     .createSessionConfig().sessionTimeout(timeout)
 >>     .getOrCreateCookieConfig().name(name).domain(domain)
 >>     .path(path).maxAge(maxAge).up()
 >>     .trackingMode(TrackingModeType._COOKIE.name()).up();
 >> final String exported = desc.exportAsString();
 >
 > Since you used web as an example, I had a (relatively quick) look, and I
 > have some observations:
 > - It doesn't do taglib descriptors.

https://issues.jboss.org/browse/SHRINKDESC-94

 > - No jboss-web.xml either.

https://issues.jboss.org/browse/SHRINKDESC-93

 > - In the absolute ordering thing, the position of "others" in the list
 > is needed.

Probably this should be applied to all iterable types, right?  To 
determine the order in any list of Elements?

 > - Shouldn't the EE elements be moved in superclasses ? Maybe it's easier
 > this way though.

Superclasses are a function of code organization, really.  In 
Descriptors we take a bit of a different tack because the source is 
generated from the XSDs.  So typical rules like clean structure go out 
the window, and all that matters is the bottom-line API and that the 
impl passes our end-user tests.

 > Right now, I think it would be ok to handle this using a "parser" for
 > JBoss Metadata, which would convert the SW descriptors to the JBoss
 > metadata objects.

What I'd like to do in the short-term is nail down the Descriptors EE 
APIs, then we can ask if it makes sense to build layers atop this to 
provide the other functions currently given by jboss-metadata (ie. 
merging, validation, defaults).  That's if AS7 subprojects start to use 
this as the metadata view.

Right now, the main use case for Descriptors is in easily generating 
metadata for tested archives (ie. Arquillian + ShrinkWrap @Deployments)

S,
ALR

-- 
Andrew Lee Rubinger
Senior Software Engineer
JBoss by Red Hat
Twitter: @ALRubinger
http://about.me/alrubinger


More information about the jboss-as7-dev mailing list