The different approaches actually have names: top-down, bottom-up,
middle-out, meet-in-the-middle
http://hibernate.sourceforge.net/brief.html

Middlegen is a bottom-up tool.

About adding Hibernate support to Middlegen, it would be very easy.
Middlegen's JDO plugin already produces java source code that can be used
with hibernate. It's just a matter of adding @hibernate tags to the Velocity
template and run Hibernate's XDoclet module on generated sources afterwards.
I don't know how good the hibernate module for XDoclet is. I think it could
need some QA.

Here is an example of a generated JDO class that could use some @hibernate
tags:
http://boss.bekk.no/boss/middlegen/samples/airline/jdo/PersonBean.java.html

Aslak

> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of Ara
> Abrahamian
> Sent: 25. november 2002 21:20
> To: 'Matt Raible'; 'XDoclet User List'; 'Gavin King'
> Cc: 'Dave Johnson'
> Subject: RE: [Xdoclet-user] Xdoclet, Middlegen and Hibernate
>
>
> There's no "the best way". Sometimes you have a db on hand, sometimes
> you're happier to create the source first and then a db schema for it,
> sometimes an uml model is a good starting point. It really depends on
> your taste, whether you're a db hacker guy, or a brave coder or maybe an
> engineer starting from an uml model! I prefer
> source+@tags->mapping-file->generate-db way. But in many big companies
> db schema is a holy thing, the db designer changes it with his sainted
> hands. Imho that's where middlegen shines.
>
> Ara.
>
> > -----Original Message-----
> > From: [EMAIL PROTECTED] [mailto:xdoclet-user-
> > [EMAIL PROTECTED]] On Behalf Of Matt Raible
> > Sent: Monday, November 25, 2002 8:40 PM
> > To: [EMAIL PROTECTED]; 'XDoclet User List'; 'Gavin King'
> > Cc: 'Dave Johnson'
> > Subject: RE: [Xdoclet-user] Xdoclet, Middlegen and Hibernate
> >
> > I hate to cross-post to everyone, so hopefull we can just continue
> this
> > on xdoclet-user.
> >
> > I am seriously interested in a middlegen-hibernate module, but I'm
> > wondering if it's the best way to create an application.  Should we be
> > generating a relational model all the way to the UI?  Is that how
> > middlegen works?  It might be better to use an object model, then map
> > that to a database.  For example, it might be better if I mark up a
> POJO
> > with Xdoclet tags for struts and castor/hibernate.  Of course, the
> > downside to this is that I have to code my Actions and JSP's by hand,
> > but it might be cleaner architecturally.
> >
> > I want to develop a best-practices Struts application using Xdoclet
> and
> > other tools to generate most of the code.  While Middlegen generates
> > Struts Actions and JSP's, it needs some work IMHO.  For instance, it
> > could generate classes that extend DispatchAction with CRUD methods,
> > rather than 4 different classes.  Also, it's forms extend ActionForm,
> > whereas I would like to extend ValidatorActionForm.  Of course, if
> there
> > is a template I can modify (I suspect there is), this is a non-issue.
> I
> > expect a lot of folks to jump on this "sample app" to use in starting
> > their own Struts projects, so I'd like to get as much right as I can
> out
> > of the gate.
> >
> > Thanks,
> >
> > Matt
> >
> >
> > > -----Original Message-----
> > > From: [EMAIL PROTECTED]
> > > [mailto:[EMAIL PROTECTED]] On Behalf
> > > Of Ara Abrahamian
> > > Sent: Monday, November 25, 2002 12:19 AM
> > > To: 'Matt Raible'; 'XDoclet User List'
> > > Cc: [EMAIL PROTECTED];
> > > [EMAIL PROTECTED]
> > > Subject: RE: [Xdoclet-user] Xdoclet, Middlegen and Hibernate
> > >
> > >
> > > I'm willing to participate in this effort. Matt are you
> > > seriously interested in a middlegen-hibernate module?
> > >
> > > Ara.
> > >
> > > -----Original Message-----
> > > From: [EMAIL PROTECTED]
> > > [mailto:[EMAIL PROTECTED]] On Behalf
> > > Of Aslak Hellesoy
> > > Sent: Monday, November 25, 2002 12:25 AM
> > > To: Matt Raible; 'XDoclet User List'
> > > Cc: [EMAIL PROTECTED];
> > > [EMAIL PROTECTED]
> > > Subject: RE: [Xdoclet-user] Xdoclet, Middlegen and Hibernate
> > >
> > > Hi!
> > >
> > > Sorry for cross-posting. Please continue hibernate related
> > > discussions over in [EMAIL PROTECTED] If
> > > it's Middlegen related, crosspost to
> > > [EMAIL PROTECTED]
> > >
> > > The best way to use Middlegen
> > > (http://boss.bekk.no/boss/middlegen/) with Hibernate would be
> > > to use a similar approach as CMP. Middlegen could generate
> > > the java beans with @hibernate tags.
> > >
> > > Then you let XDoclet generate the hibernate-mapping.xml with
> > > Hibernate's XDoclet module. Hibernate maintains their own
> > > XDoclet module in the CVS module named Tools.
> > >
> > > It doesn't look like the Hibernate folks are including their
> > > XDoclet module in their distro, but you'll find it here:
> > > http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/hibernate/
> > >
> > > The hibernate tags:
> > > http://tinyurl.com/2z2v
> > >
> > > Who wants to write a Hibernate plugin for Middlegen?
> > >
> > > Cheers,
> > > Aslak
> > >
> > > > -----Original Message-----
> > > > From: [EMAIL PROTECTED]
> > > > [mailto:[EMAIL PROTECTED]]On Behalf Of Matt
> > > > Raible
> > > > Sent: 24. november 2002 19:19
> > > > To: 'XDoclet User List'
> > > > Subject: [Xdoclet-user] Xdoclet, Middlegen and Hibernate
> > > >
> > > >
> > > > I'm looking to produce a Struts example app with a
> > > persistence layer
> > > > that is fully generated from an existing database.  I'd like to
> use
> > > > Castor, Hibernate, or possibly JDO (other suggestions
> > > welcome).  I've
> > > > seen Middlegen, which seems it might do everything, except
> > > I couldn't
> > > > use Castor or Hibernate - but possibly JDO.
> > > >
> > > > Does anyone on this list have any hints or tips for using
> > > > Ant/Xdoclet/Middlegen for fully creating this kind of app?
> > > >
> > > > Thanks,
> > > >
> > > > Matt
> > > >
> > > >
> > > >
> > > >
> > > > -------------------------------------------------------
> > > > This sf.net email is sponsored by:ThinkGeek
> > > > Welcome to geek heaven.
> > > > http://thinkgeek.com/sf
> > > > _______________________________________________
> > > > Xdoclet-user mailing list
> > > > [EMAIL PROTECTED]
> > > > https://lists.sourceforge.net/lists/listinfo/xdoclet-user
> > >
> > >
> > >
> > > -------------------------------------------------------
> > > This sf.net email is sponsored by:ThinkGeek
> > > Welcome to geek heaven.
> > > http://thinkgeek.com/sf
> > > _______________________________________________
> > > Xdoclet-user mailing list
> > > [EMAIL PROTECTED]
> > > https://lists.sourceforge.net/lists/listinfo/xdoclet-user
> > >
> > >
> > >
> > >
> > > -------------------------------------------------------
> > > This sf.net email is sponsored by:ThinkGeek
> > > Welcome to geek heaven.
> > > http://thinkgeek.com/sf
> > > _______________________________________________
> > > Xdoclet-user mailing list
> > > [EMAIL PROTECTED]
> > > https://lists.sourceforge.net/lists/listinfo/xdoclet-user
> > >
> >
> >
> >
> >
> > -------------------------------------------------------
> > This sf.net email is sponsored by:ThinkGeek
> > Welcome to geek heaven.
> > http://thinkgeek.com/sf
> > _______________________________________________
> > Xdoclet-user mailing list
> > [EMAIL PROTECTED]
> > https://lists.sourceforge.net/lists/listinfo/xdoclet-user
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Get the new Palm Tungsten T
> handheld. Power & Color in a compact size!
> http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0002en
> _______________________________________________
> Xdoclet-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/xdoclet-user



-------------------------------------------------------
This SF.net email is sponsored by: Get the new Palm Tungsten T 
handheld. Power & Color in a compact size! 
http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0002en
_______________________________________________
Xdoclet-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user

Reply via email to