geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bruce Snyder <bruce.sny...@gmail.com>
Subject Re: Sample plan bits for configId branch, please review!
Date Wed, 15 Feb 2006 04:32:37 GMT
On 2/14/06, David Jencks <david_jencks@yahoo.com> wrote:
> We need some widespread thought about the new xml schema we're
> getting in 1.1.   Dain and I are not particularly thrilled with the
> element names but haven't thought of improvements.  We also thought
> of an alternate way of presenting the info and would like opinions on
> which is better.
>
> The schema currently in svn in the configid branch results in plans
> that start like this:
>
> <configuration xmlns="http://geronimo.apache.org/xml/ns/deployment-1.1">
>    <environment>
>      <configId>
>        <groupId>geronimo</groupId>
>        <type>car</type>
>        <artifactId>geronimo-gbean-deployer</artifactId>
>        <version>1.0.1-SNAPSHOT</version>
>      </configId>
> <!-- name-key elements are very unlikely to be used by anything
> except "root" system plans
> such as j2ee-system.  Included here only to show what they look like -->
>      <name-key>
>        <key>domain</key>
>        <value>geronimo.maven</value>
>      </name-key>
>      <name-key>
>        <key>J2EEServer</key>
>        <value>geronimo</value>
>      </name-key>
>      <classloader>
>        <import>
>          <groupId>geronimo</groupId>
>          <type>car</type>
>          <artifactId>geronimo-system</artifactId>
>          <version>1.0.1-SNAPSHOT</version>
>        </import>
>        <dependency>
>          <groupId>geronimo</groupId>
>          <artifactId>geronimo-common</artifactId>
>          <version>1.0.1-SNAPSHOT</version>
>        </dependency>
>        <include>
>          <groupId>geronimo</groupId>
>          <artifactId>geronimo-deployment</artifactId>
>          <version>1.0.1-SNAPSHOT</version>
>        </include>
>      </classloader>
> <!--reference is a new element, the meaning is that the configuration
> must be loaded and started before this one, but the classloader of
> the config is not a parent -->
>      <reference>
>        <groupId>geronimo</groupId>
>        <type>car</type>
>        <artifactId>geronimo-j2ee</artifactId>
>        <version>1.0.1-SNAPSHOT</version>
>      </reference>
>    </environment>
>    <!--Deployer used to process modules and plans-->
>    <gbean name="Deployer"
> class="org.apache.geronimo.deployment.Deployer">
>
>
> An alternate layout is more similar to m2 with the idea of different
> functions for a dependency shown by a "scope" element.  Scope doesn't
> seem like the right element name for us. (sorry about the lousy
> indenting)
>
> <configuration xmlns="http://geronimo.apache.org/xml/ns/deployment-1.1">
>    <environment>
>      <configId>
>        <groupId>geronimo</groupId>
>        <type>car</type>
>        <artifactId>geronimo-gbean-deployer</artifactId>
>        <version>1.0.1-SNAPSHOT</version>
>      </configId>
> <!-- name-key elements are very unlikely to be used by anything
> except "root" system plans
> such as j2ee-system.  Included here only to show what they look like -->
>      <name-key>
>        <key>domain</key>
>        <value>geronimo.maven</value>
>      </name-key>
>      <name-key>
>        <key>J2EEServer</key>
>        <value>geronimo</value>
>      </name-key>
>        < dependency>
>          <groupId>geronimo</groupId>
>          <type>car</type>
>          <artifactId>geronimo-system</artifactId>
>          <version>1.0.1-SNAPSHOT</version>
>          <scope>full</scope>
>        </dependency>
>        <dependency>
>          <groupId>geronimo</groupId>
>          <artifactId>geronimo-common</artifactId>
>          <version>1.0.1-SNAPSHOT</version>
>          <scope>class</scope>
>        </dependency>
>        < dependency>
>          <groupId>geronimo</groupId>
>          <artifactId>geronimo-deployment</artifactId>
>          <version>1.0.1-SNAPSHOT</version>
>          <scope>include</scope>
>        </dependency>
>      < dependency>
>        <groupId>geronimo</groupId>
>        <type>car</type>
>        <artifactId>geronimo-j2ee</artifactId>
>        <version>1.0.1-SNAPSHOT</version>
>        <scope>service</scope>
>     </dependency>
>    </environment>
>    <!--Deployer used to process modules and plans-->
>    <gbean name="Deployer"
> class="org.apache.geronimo.deployment.Deployer">
>
> Here, the scopes have meaning as follows:
>
> both -- both classes and services (gbeans), like import
> classes -- only classes, if a car don't start the gbeans for us, like
> dependency
> services -- only gbeans, don't add classes to our classpath, like
> reference (new element shown in first example)
> include -- copy the artifact into the current configuration.  This
> seems like a separate dimension not related to the previous scopes.
>
> Again, please study these and comment.

Here are my thoughts so far.

I definitely prefer the second example better because it requires
specifying the scope on a per dependency basis. In fact, I think that
specifying everything for a given dependency with that dependency is
far easier to understand. I also think that this is less confusing and
much more like Maven which many people already understand.

Speaking of dependencies, I'm thinking that an element named
dependencies should be used as a container element for each dependency
element. Again, similar to Maven which many people already understand.

I also have some additional suggestions:

1) It seems like the name-key elements should be wrapped in another
element. Perhaps an element named name-pattern or something similar.

2) How is order specified on the name-key elements? It's important to
assemble these elements in the proper order.

3) In fact, just allowing a single string pattern would also be a nice
alternative too.

Here is one example:

<name-pattern>
  <name-key index="0">
    <key>domain</key>
      <value>geronimo.maven</value>
  </name-key>
  <name-key index="1">
    <key>J2EEServer</key>
      <value>geronimo</value>
  </name-key>
</name-pattern>

Here is another example:

<name-pattern>
domain=geronimo.maven,J2EEServer=geronmo
</name-pattern>

I know that this second example needs a bit more parsing, but it
should be minimal.

Just my $0.02.

Bruce
--
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

Apache Geronimo (http://geronimo.apache.org/)

Castor (http://castor.org/)

Mime
View raw message