So here is a very simple example, with a very clear and "intuitively
expected" result, and yet with a side-effect which may or may not be
mentioned / documented-- and yet is a perfectly reasonable construct...

  MyObj.MyProp

When read it returns the value of MyProp, but what you DON'T see, and don't
even need to know, is that INTERNALLY, whenever MyProp is read, it ALSO
increments a hit counter (a "number of reads") counter so you could know how
often it's been read.

You could even express it this way:

  MyObj.MyProp
  MyObj.MyPropReadCount

If you wanted to document it. And of course, MyPropReadCount would probably
be implemented as a "Read-Only" property.


I'm enjoying the discussion with you Fritz, thanks!


John




fritz wrote
> 
> What I am trying to say is that it can easily become unexpected when a
> getXXX() call changes XXX (or has other side-effects).
> 
> While
> 
>    x = stack.pop()
> 
> is self-documenting (at least of one knows what pop means)
> 
>    x = getStack()
> 
> (when actually popping the top value) would be rather unexpected, don't
> you
> think?
> 
> At least my simple mind could be easily confused, if getProperty() does
> funny things in addition to returning properties value.
> 
> 
> Not that I don't understand your arguments or use cases, I would probably
> still try to avoid such usage of properties.
> 




--
View this message in context: 
http://qooxdoo.678.n2.nabble.com/READ-aspect-of-Custom-Properties-HELP-Please-tp7581097p7581109.html
Sent from the qooxdoo mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to