> > You can also have a common interface without modification methods, and two > implementations, an immutable one and a mutable one (I think this is how > Scala containers are designed). > > Luc > That is I suppose the cleanest approach, but within the solver's loop, I need the current solution to be modifiable, while I need the solution returned by getSolution() to be read-only. therefore, if I have those two implementations, I will need a deep copy somewhere, no? Or would the solver be creating a new (immutable) vector at each iteration? Maybe this is not so much of an overhead, after all. How about memory? On the other hand, referring to your previous message: I actually like the fact that the observer is responsible for making deep copies. By default, this minimizes the number of deep-copies. >> >> Sebastien >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org >> For additional commands, e-mail: dev-h...@commons.apache.org >> >> > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org > For additional commands, e-mail: dev-h...@commons.apache.org > >
--------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org