getting and setting  scott evans :: flex builder :: omgwtffb4

accessor methods, actionscript, and you

What better way to kick off this blog than with its namesake? And some tasty minutia?

One of the first Flex Builder 4 feature specs I’m working on is Generate Getters/Setters. I considered this feature a nice, but small, enhancement. But Tim’s $100 Feature Test shows that in fact this is a feature lots of people are waiting for. Nice!

To help validate our spec, I’d like to hear how and when accessors are used in the wild:

  • Do you typically create accessors when you create member variables, or later as you need them?
  • Would you want to batch-create accessors for more than one variable at once, or do you usually only do it for one variable at a time?
  • How do you name your variables that don’t have accessors? Do you prefix them? (i.e. m_color, m_flavor)

(The typical Java pattern is to put every member variable behind accessor methods, but that’s not appropriate in AS. Still, I have a feeling that some developers do it out of habit.)

Your feedback will help me be sure we’re getting this right. Comment away!

(Disclaimer: Like the disclaimer page says, this post — and all future posts — should not to be taken as a promise of any feature’s inclusion in any Adobe product. But you knew that, right?)

20 comments