[The Java Posse] Re: freeze() vs clone()

2009-03-11 Thread Joe Nuxoll (Java Posse)
Back in JBCL days (1996-7ish), we had: package com.borland.jbcl.model; public interface WritableVectorModel extends VectorModel... Same for SingletonModel, GraphModel (trees), MatrixModel (tables), etc. All the GUI components had an XxxModel property of the base type, thus expecting a r

[The Java Posse] Re: freeze() vs clone()

2009-03-04 Thread Peter Becker
John Nilsson wrote: > On Wed, Mar 4, 2009 at 4:40 PM, Reinier Zwitserloot > wrote: > >> List should have just had lookup and 'make a copy of self' methods. >> Then, MutableList, which extends it, should have had the add, addAll, >> remove, removeAll, clear, and other mutating methods on them.

[The Java Posse] Re: freeze() vs clone()

2009-03-04 Thread John Nilsson
On Wed, Mar 4, 2009 at 4:40 PM, Reinier Zwitserloot wrote: > List should have just had lookup and 'make a copy of self' methods. > Then, MutableList, which extends it, should have had the add, addAll, > remove, removeAll, clear, and other mutating methods on them. So a MutableList can be passed

[The Java Posse] Re: freeze() vs clone()

2009-03-04 Thread Reinier Zwitserloot
Well, there is a solution, to some extent. Type Hierarchy. List should have just had lookup and 'make a copy of self' methods. Then, MutableList, which extends it, should have had the add, addAll, remove, removeAll, clear, and other mutating methods on them. Iterator should have come in two vari

[The Java Posse] Re: freeze() vs clone()

2009-03-04 Thread Casper Bang
> Yes, the "freeze" concept seems more appropriate for dynamically typed > languages than for statically typed interface-based languages. One must then extrapolate that dynamic languages won't scale as well across many cores as a static language, runtime metadata seems paramount. As to the builde

[The Java Posse] Re: freeze() vs clone()

2009-03-04 Thread Jeff Grigg
To take the discussion in a more serious direction... --- Michael Neale wrote: > [...] I think freeze was more for dynamic languages like ruby and > groovy [...] Yes, the "freeze" concept seems more appropriate for dynamically typed languages than for statically typed interface-based languages.

[The Java Posse] Re: freeze() vs clone()

2009-03-03 Thread James Dumay
... then the caliber of the discussion is not as bad as I had thought :) On Wed, Mar 4, 2009 at 5:18 PM, Christian Catchpole wrote: > > It was supposed to be a joke. :)  re-mutable? :) > > On Mar 4, 4:17 pm, James Dumay wrote: >> IMO, If it allows you to make an immutable object mutable you mig

[The Java Posse] Re: freeze() vs clone()

2009-03-03 Thread Christian Catchpole
It was supposed to be a joke. :) re-mutable? :) On Mar 4, 4:17 pm, James Dumay wrote: > IMO, If it allows you to make an immutable object mutable you might as > well stick to normal objects. Kind of defeats the purpose... > > On Wed, Mar 4, 2009 at 12:20 PM, Christian Catchpole > > wrote: > >

[The Java Posse] Re: freeze() vs clone()

2009-03-03 Thread James Dumay
IMO, If it allows you to make an immutable object mutable you might as well stick to normal objects. Kind of defeats the purpose... On Wed, Mar 4, 2009 at 12:20 PM, Christian Catchpole wrote: > > Is there a thaw() method? > > On Mar 4, 8:11 am, Michael Neale wrote: >> *slowly claps* >> >> Altho

[The Java Posse] Re: freeze() vs clone()

2009-03-03 Thread Christian Catchpole
Is there a thaw() method? On Mar 4, 8:11 am, Michael Neale wrote: > *slowly claps* > > Although I think freeze was more for dynamic languages like ruby and > groovy that allow you to mess with the methods on a class, mess with > the actual structure - in that case (at least in ruby) that means y

[The Java Posse] Re: freeze() vs clone()

2009-03-03 Thread Michael Neale
*slowly claps* Although I think freeze was more for dynamic languages like ruby and groovy that allow you to mess with the methods on a class, mess with the actual structure - in that case (at least in ruby) that means you lock the object down structurally, but I don't think that makes it immutab