I got ya. So you would rather do something like user = new User(); user.name = "dan"
UserService.save(user) Thank You Dan Vega [email protected] http://www.danvega.org On Mon, Feb 9, 2009 at 2:38 PM, Barney Boisvert <[email protected]> wrote: > > I love Hibernate, I just don't like the ActiveRecord pattern, where > your entities have the persistence operations on them directly, > instead of separated into DAOs. For example, with ActiveRecord you > have this: > > u = new User() > u.name = 'barney' > u.save() > > The User type shouldn't know about persistence operations, in my > opinion. Hibernate doesn't care where the persistence code lives, > just that it's configured correctly. Grails (following Rails' model) > puts it on the entities (the ActiveRecord pattern). Like I said, I > works just dandy, but it feels wrong, and can lead you into some weird > issues with transaction demarcation (among other things), because it > encourages you to NOT think about separation of concerns. > > cheers, > barneyb > > On Mon, Feb 9, 2009 at 11:16 AM, Dan Vega <[email protected]> wrote: > > Scaffolding is great for generating a base controller but in the end as > you > > said you most likely be rolling your own. I found that controllers in > Grails > > are extremely simple to write and in single line (via spring) you can > inject > > your services which is great. As far as active record goes you will have > to > > forgive my lack of knowledge but I don't know much about it. I do know > that > > Grails uses hibernate for the persistance layer, can you explain what you > > don't like about that? > > > > Thank You > > Dan Vega > > [email protected] > > http://www.danvega.org > > > > > > On Mon, Feb 9, 2009 at 2:11 PM, Barney Boisvert <[email protected]> > wrote: > >> > >> One gripe I had with Grails is that it's ActiveRecord style > >> persistence. That's as expected, of course, but I'm not a fan. It's > >> simple to wrap up with DAO-style persistence to hide the fact. I'm > >> also not much of a fan of scaffolding, because you invariably end up > >> having to customize, and then you can't regenerate without losing the > >> customizations. You can go crazy with your scaffolding templates to > >> mitigate some of the issue, but it's still hard to get it all right. > >> > >> All that said, for getting something out the door quickly it's awesome. > >> > >> cheers, > >> barneyb > >> > >> On Sun, Feb 8, 2009 at 11:19 PM, Henry <[email protected]> wrote: > >> > > >> > Has anyone used Rails? loved it? > >> > > >> > I just read a book on introductory of Groovy and Rails. I wish CF can > >> > be that easy. I didn't have high hope for CF9's hibernate > >> > integrations before, but now I really wish Adobe got it right. > >> > > >> > Is it possible to run CFGroovy (with Rails) for M&C, and run CF for > >> > V? Just a thought. > >> > > >> > > >> > Henry Ho > >> > > > >> > > >> > >> > >> > >> -- > >> Barney Boisvert > >> [email protected] > >> http://www.barneyb.com/ > >> > >> > > > > > > > > > > > > > -- > Barney Boisvert > [email protected] > http://www.barneyb.com/ > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CFCDev" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cfcdev?hl=en -~----------~----~----~----~------~----~------~--~---
