I *think* you're referring to a thread I started some time ago:


It turned out to be a lively discussion. On a related note, Jonas Boner 
  gisted this in August:


It's not full code, but it gives you an idea how an immutable data model 
might be composed and backed with JPA. There are pain points (java 
collections) and unanswered questions here (how will the JPA provider 
initialize such a class), but there's what I feel is a language-level 
issue. In Scala, if you want methods to immutably evolve an objects' 
state, then you must, as Jonas did, write your own "setters" that yield 
a new instance with the modification. Sounds like boilerplate to me, 
that's another topic.

For the record, I'm not yet fully convinced of the gains in using 
immutability in a domain model. Domain entities represent the state of 
an application, and in many cases that changes frequently and naturally. 
Period. How and why those changes occur are often the result of human 
behavior (twitter, facebook). These behaviors are not functional in the 
mathematical sense (at least, not that we've discovered), and so I'm not 
clear on what we stand to gain in a typical domain model.

Naftoli Gugenheim wrote:
> How hard can automatic save be?
> But how would immutable DAOs work? There was a thread, I think on scala-user, 
> a long time ago discussing it, that pretty much concluded it would be very 
> problematic. David weighed in and said after a long time he concluded that 
> databases represent state.
> -------------------------------------
> Timothy Perrett<timo...@getintheloop.eu> wrote:
> Right, no one likes mutable anything :-)
> I kinda wondered why you haven't pushed forward any more with the  
> current record implementation... can one assume that is why - because  
> it didn't feel right?
> Some of this stuff is going to be fundamental to how we move forward -  
> id love to perhaps discuss something that would be better than what we  
> have already. Even if its just pie in the sky talk...
> Cheers, Tim
> On 22 Oct 2009, at 17:22, David Pollak wrote:
>> I don't like mutable fields.  I don't like manual saving.  Dunno...  
>> it's hard to articulate... it just feels wrong in my tummy.  Also, I  
>> want to be clear that I think Marius did a great job of cleaning up  
>> some of the problems with Mapper when he did Record... my comments  
>> are not a negative to him... there's just something unsatisfying  
>> about the whole approach.
>> Bet that was less than helpful.
> > 

You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to