For some setters you can test against null to know if the value was previously 
set, otherwise you’d need flags.  Then ignore or throw an error.


On 7/24/10 8:04 AM, "Richard Rodseth" <rrods...@gmail.com> wrote:






Not sure it's worth the trouble, but did you have some particular technique in 
mind?

I think I might have asked about this before, but if MXML had a way to do 
constructor injection it could also help frameworks like Mate so they don't 
need tags with attributes called "arguments".

On Fri, Jul 23, 2010 at 3:46 PM, Alex Harui <aha...@adobe.com> wrote:





You could write your set functions to be write-once.



On 7/23/10 11:35 AM, "Richard Rodseth" <rrods...@gmail.com 
<http://rrods...@gmail.com> > wrote:






Getting a little off-topic, but in case anyone's interested:

http://www.developer.com/lang/other/article.php/3874551/Clojure-Immutability-at-the-Language-Level.htm

One Flex-specific wrinkle is that if you define a class with a >1 argument 
constructor and getters only, you can't instantiate it in MXML. And in AS3, you 
can't have mutliple constructors. I'm not sure, but I imagine some of the 
serialization libraries for JSON etc might have issues too if you don't have 
the zero-argument constructor.

On Fri, Jul 23, 2010 at 11:25 AM, Richard Rodseth <rrods...@gmail.com 
<http://rrods...@gmail.com> > wrote:
Yes, obviously. But not the same thing.


If you write your VO’s to have only get functions, they are effectively 
immutable.






On 7/23/10 8:56 AM, "Richard Rodseth" <rrods...@gmail.com 
<http://rrods...@gmail.com>  <http://rrods...@gmail.com> > wrote:






Interesting. I haven't used that one either.

The docs emphasize the addEventListener capability, which I guess distinguishes 
this from plain old Object, which can also hold arbitrary properties.

http://livedocs.adobe.com/flex/3/langref/mx/utils/ObjectProxy.html

As an aside, I would love to have language support for designating VOs as 
immutable.

On Thu, Jul 22, 2010 at 6:11 PM, Alex Harui <aha...@adobe.com 
<http://aha...@adobe.com>  <http://aha...@adobe.com> > wrote:





ObjectProxy is a generic VO.  It is dynamic and can hold any properties and 
values.  And it is slow.  Best to create custom Vos that are strongly typed.



On 7/22/10 2:52 PM, "mark.embrey" <mark.c.emb...@gmail.com 
<http://mark.c.emb...@gmail.com>  <http://mark.c.emb...@gmail.com>  
<http://mark.c.emb...@gmail.com> > wrote:






I'm trying to wrap my feeble brain around these concepts.

Are they the same? -similar? -completely different?

Your feedback will be appreciated by this greenhorn.

Mark






--
Alex Harui
Flex SDK Team
Adobe System, Inc.
http://blogs.adobe.com/aharui

Reply via email to