On Thursday, July 26, 2001, at 12:02 AM, Michael Gerdau wrote:

>> this suggests to me that maybe everybody interested could work together 
>> to
>> come up with a project focused on source code generation from xml in the
>> commons and then a second project for the proposed data-access 
>> development
>> either within torque (if that's possible) or in the commons rather than
>> trying to re-invent the wheel independently.
>
> I'm sure we aren't that far apart.
>
> However the original proposal was named datamodel and not (data access)
> since the idea is that the datamodel does - to a certain extend - include
> business rules and not "merely" (no offence intended) data access.

my main worry about your proposal is that it's (stated) aim is (near 
enough) to duplicate torque.

> Without having had a closer look at what texen already can do I'm more
> in favor of trying to wrap a datamodel layer around it (and of course
> have all of it reside in commons ;)

texen is an ant task that generates text using velocity (as templating 
engine). you can use texen to replace xmlt.
the general way that generation based on texen works is that you create an 
object model
which is then accessed from the templates. this is a little more work to 
begin with but you then get to have much easier templates :)

why replace xslt with texen?
there are many reasons but one good reason is that velocity templates are 
*much* simpler.
for example, here's a template that does something similar to your entity 
example (i'll not include the entity.xsl since it's a little long ;-).

package $package;

import java.rmi.RemoteException;
import javax.ejb.EJBObject;
import java.util.Date;

public interface $Element extends EJBObject
{
#foreach ($attribute in $element.Attributes)
     #set ( $Attribute = $strings.firstLetterCaps($codehelper.convertToName(
  ${attribute.Name})))
     #set ($type=${attribute.Type})

     public void set$Attribute($type ${attribute.Name}) throws 
RemoteException;
     public $type get$Attribute() throws RemoteException;
#end
}

> So my point is I don't see two separate projects but two separate aspects
> of a single project.

if you're project was about generating neat and useful source code from 
xml then i'd agree.
the stated aim of your project seems (to me) something different.

- robert

Reply via email to