Actually... i think i'd misread Anthony's email.

His last suggested API is something i could get behind – taking the notion
of repositories as scopes, and pushing that down into the model as well.
 The only thing i'd want to see is the ability to inject or alter the
repositories on the fly somehow.

I will give it more thought.

Incidentally dkubb has talked some about abstracting away knowledge of
repositories from models, which is something i could get behind.  Something
like an inverted mapping pattern would be interesting to see.  (i.e. you ask
a model to save, it looks up how to route itself to stores somewhere, which
has defaults which you could override)

On Sat, Mar 6, 2010 at 7:01 PM, Xavier Shay <notr...@rhnh.net> wrote:

>
>
> On Mar 7, 12:39 pm, Ted Han <t...@knowtheory.net> wrote:
> > The ability to arbitrarily map models and properties over data sources is
> a
> > vital tool when pulling data out of legacy stores.
>
> You disagree with the inheritance/mixin approach? Could you give an
> example of what you are doing? I imagine something like this:
>
> old_model = repository(:old) { Model.get(1) }
> repository(:new) { Model.create(old_model) }
>
> I find the scoping clunky, much prefer:
> old_model = Old::Model.get(1)
> New::Model.create(old_model)
>
> Or is this not the case you're talking about?
>
> --
> You received this message because you are subscribed to the Google Groups
> "DataMapper" group.
> To post to this group, send email to datamap...@googlegroups.com.
> To unsubscribe from this group, send email to
> datamapper+unsubscr...@googlegroups.com<datamapper%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/datamapper?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"DataMapper" group.
To post to this group, send email to datamap...@googlegroups.com.
To unsubscribe from this group, send email to 
datamapper+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/datamapper?hl=en.

Reply via email to