Thanks for your helpful answers.
I usually code against DAOs configured in Spring. GORMs main advantage IMO
is the uncluttered and quickly readable configuration of the domain classes
and relations. The dynamic finders are definitely helpful for smaller scale
admin type apps and for quick testing. For more complex apps there is
usually no way to avoid a dedicated business/service layer or at least
complex DAOs.
Using Hibernate sessions directly in the page-code is IMO also more a thing
of prototyping and proof of concept. Especially if you don't know in advance
if there will be a change of data-access technology in the future, e.g. to
TopLink, Ibatis or maybe even to an object database like db4o. In these
cases GORM is of course no help either as long as it's tightly tied to
Hibernate.
In short: I obviously did a quick shot at a distant dream of easy
data-access and failed :)
Regards,
Otho
2008/11/11 Alex Kotchnev <[EMAIL PROTECTED]>
> Otho,
> Indeed, as Alex mentioned my attempt at Tapestry & Grails integration
> never went much further than he pointed out. Also, it must be noted that at
> the time I was trying to use Tapestry 4.1, so most of what you'll see on
> that blog post doesn't apply to T5.
>
> The bottom line on that attempt was that there is way too much overlap
> between Tapestry and Grails in order for them to make a good marriage. My
> motivation was exactly as Otho mentioned : I very much preferred Tapestry
> as
> the front end and I was completely enchanted by GORM on the back end.
> However, especially w/ T5 both Grails and T5 provide :
> * a nice and integrated way of creating UIs
> * An IoC / DI container
> * Integration w/ Hibernate back end.
>
> Now, if you decide to replace the default Grails controllers w/ T5, you
> would lose all the nice integration that both Grails provide and you'll
> have
> to do a whole bunch of work to make T5+Grails work just as good as either
> just Grails or just T5. Additionally, if replace the Grails controllers w/
> T5, you'll lose ALL nice frontend integration (e.g. plugins, etc).
>
> A potentially better approach would be to plug the GORM back end into T5
> (which is partially reverse to what I did there). That approach could still
> be viable, if the Grails project does separate GORM (as they've mentioned
> that they have plans to do).
>
> On the flip side, after working on a couple of Grails projects for the
> last year, after you get beyond the basic UI that you can quickly set up w/
> Grails, as nice as GORM is it really doesn't help you all that much. The
> equivalent of Foo.findAllByBarAndBaz('bar','baz') is just marginally
> shorter
> than session.createQuery("from Foo f where f.bar=:bar and
> f.baz=:baz").setParameter('bar','bar').setParameter('baz','baz').list() ,
> and gives you pretty much the same deal (if you really dislike DAOs). For
> the simple queries the Grails approach is nice; however, I often found
> myself just going back to HQL quite often (which pretty much obliterates
> any
> advantage of dynamic methods) as in Foo.query("from Foo f where f.bar=:bar
> and f.baz=:baz", [bar:'bar',baz:'baz']).
>
> I do recall a while back Howard blogged about using Groovy classes as the
> page or component classes, which after compilation end up as Java classes.
> Now, if / when standalone GORM releases, that might be the best way to go
> (although, the last time I saw it, it still required Grails like directory
> layout, which would just be a bitch to integrate into T5).
>
> Cheers,
>
> Alex Kotchnev
>
> On Fri, Nov 7, 2008 at 8:51 AM, Alex Shneyderman <[EMAIL PROTECTED]
> >wrote:
>
> > On Fri, Nov 7, 2008 at 1:35 PM, Otho <[EMAIL PROTECTED]> wrote:
> > > Yes of course, but Tapestry and Groovy integrate quite well.
> >
> > yes I recall an attempt I do not know if anything beyond basic page
> > was ever implemented.
> >
> >
> >
> http://www.troymaxventures.com/2007/08/grails-tapestry-grapestry-part-1-of-n.html
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>