I hardly "own" the Record  :) ... as I stated with other occasions I'm
not a fan of ORM either :) ( I'm also not a fan of annotated POJO crap
which claim purity but they are polluted with annotations. )

I didn't follow too closely the couch DB implementation so I don't
have a formed opinion on it. I guess we can debate all day if active
records are right or not ... it's in many respects a matter of taste.
If one switched from a RDBMS to Couch DB or viceversa they'll probably
have bigger problems then changing CouchRecord to DBRecord or
viceversa. Personally I don't see a too big impediment in active
record's approach and I don't see it as an invation of the domain
model.


class Person extends CouchRecord[Person] {
  //..
}

class Animal extends CouchRecord[Animal] {

}

could be replaced (at least in theory) with a "proxy" trait
(pseudocode cause I'm lazy now ...)

trait MyDomainRecord[A} extends CouchRecord[A]

class Person extends MyDomainRecord[Person] {
  //..
}

class Animal extends MyDomainRecord[Animal] {

}


... thus have the CouchDB "invasion" in a single place.

The author says something like "The moment you define a domain
abstraction as being statically dependent on a persistence
implementation, you lose the ability to reuse it in other contexts.".
I disagree completly. I can think of a couple of options:

Option 1
class Person extends CouchRecord[Person] with PersonView {
  //..
}

in my UI layer I can have:

def render (person: PersonView): NodeSeq = ...

Option 2

def render (person: Person): NodeSeq = ...

Option 3 ... there has to be one or more

so I'm able to pass a CouchDB record to other layers without
explicitly passing the persistence store information. So I don't see
much loss ...


Br's,
Marius

On 15 feb., 17:28, Timothy Perrett <[email protected]> wrote:
> Sounds like a good plan Ross - have you any specific suggestions about how 
> best to untangle things?
>
> Marius - your thoughts as the own of Record?
>
> Cheers, Tim
>
> On 15 Feb 2010, at 15:03, Ross Mellgren wrote:
>
>
>
> > FWIW, I agree mostly completely, and when I was writing the integration I 
> > didn't like the fact that I couldn't make one model object usable for both 
> > Couch and an RDBMS (for example). I guess it could be made to support more 
> > than one if the persistence-specific stuff was untangled from 
> > MetaRecord/Record subclasses and made into mixable traits?
>
> > -Ross
>
> > On Feb 15, 2010, at 4:34 AM, Timothy Perrett wrote:
>
> >> Debasish just posted this:
>
> >>http://debasishg.blogspot.com/2010/02/why-i-dont-like-activerecord-fo...
>
> >> Interesting feedback especially regarding the current design of
> >> Record...
>
> >> Cheers, Tim
>
> >> --
> >> You received this message because you are subscribed to the Google Groups 
> >> "Lift" 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 
> >> athttp://groups.google.com/group/liftweb?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "Lift" 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 
> > athttp://groups.google.com/group/liftweb?hl=en.

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

Reply via email to