On Wed, May 6, 2009 at 7:03 AM, Fábio Rehm <[email protected]> wrote:
> Right now, the only thing that I think would "hurt" DDD in Ruby
> applications is that I couldn't find an ORM that doesn't implement
> Fowler's Active Record pattern.

DataMapper does not. DataMapper implements... well, Data Mapper pattern.

> So my questions are:
>  * Would it be hard to decouple CRUD operations from entities and
> have something like (N)Hibernate session that holds identity map, does
> CRUD and so on...?

Can you give a specific example (with DM/Ruby code?)

>  * Have you ever thought about these things and are there any plans
> to do implement something like it?
>  * If not, do you guys think that would be possible to maybe create a
> plugin for that?
>
> I hope you guys got my point but to make things even clear, I'd like
> to decouple CRUD operations from entities and make those a repository
> (http://martinfowler.com/eaaCatalog/repository.html) responsibility.

In DM, when you do Person.create(...) it ends up being handled by
Adapter#create,
so in many ways, both DM and AR do it already, and it is a matter of
taste to me.

What is missing (and would really make a difference in some
situations) is Unit of Work, and it is on the road map.
>From my experience, Unit of Work with validations would simplify a lot
of cases when you have to create multiple
interdependent objects transactionally, but also have validations but
with one nice list of errors.

If someone could step up and implement that (it probably won't even
require changes to existing code), it would really make a difference.

Welcome to DM, and I want to be honest with you: DM 0.9.x is buggy and
some ideas did not work out so well.
That's why all focus now is on 0.10 with completely rewritten tests
and certain pieces of implementation.
So if you are going to follow DM development, follow next branch and not master.
-- 
MK

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"DataMapper" 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/datamapper?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to