OK, after the recent Jewish holiday I've had some time to reflect on this stuff. :)
Generally speaking, domain-specific extensions were always part of the plan so I'm
pretty psyched that Aslak's already started to dig in here. I've always had some
concerns about their implementation however (Aslak's addressed many so far).
1) Keep DSL stuff decoupled from the Archive stuff
I view these as two completely separate concerns. DSL is an API for generating
descriptors. Basically an object model from which we can parse into (from a template
web.xml from example) or serialize out from (marshalling). As such I'd like to be
sure we keep this all cleanly away from the rest of the Archive stuff.
Aslak's already done a pretty good job here by introducing the notion of a
"Descriptor". One sticky point is that the descriptor is put into place by
default to be this object model thing; if the user calls "setWebXml" then we
lose the facility of "addFilter" etc.
I'd instead like to see the addition of a "DescriptorAsset" which may be
backed by any descriptor. Then we may have an overloaded
WebArchive.setWebXml(WebXmlDescriptorAsset) method. In this setup things like
"addServlet" are removed from the Container/Archive classes and kept only in the
descriptor.
2) Don't bring in any external dependencies
Currently not an issue in the prototypes on stage. JDK6 JAXB is used, so ... awesome.
ShrinkWrap still requires nothing except the JDK.
3) Reinventing the wheel
A sticky point is that we've already done this before, and it's called
jboss-metadata.
http://anonsvn.jboss.org/repos/jbossas/projects/metadata/trunk/ The
problem here is that jboss-metadata:
* Has too many dependencies (jboss-logging, JBossXB, etc)
* Performs actual business logic (more than an object model should)
Just something to be aware of. We can also copy/steal a bunch of code from this project
to save us time, and retrofit it as needed.
4) Don't leak this into the user API until it's done
This is more a timing issue. We're gearing up for a release of ShrinkWrap to the
community very soon, and the DSL stuff isn't a required feature. So We have to be
careful to keep it all hidden until it's complete/working from the user API.
This can be accomplished by keeping API stuff under the "spi" project, and doing
a bulk move later.
Also I need to read/understand more about the latest comments in this Thread. My post
here is really just taking Aslak's initial post and code samples into account. For
instance I'm *still* not seeing the need/purpose behind "specialize". ;)
S,
ALR
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4257641#...
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&a...