OpenStack-SDK-PHP/Design/Service-Models
< OpenStack-SDK-PHP
Revision as of 10:40, 8 April 2014 by Jamiehannaford (talk | contribs)
Jamie's comments (Tuesday 8th):
To achieve dynamic properties with models, we can use two methods:
- Have all models implement \ArrayAccess, allowing them to be treated as arrays. Users are already comfortable with the dynamic nature of arrays.
- Use magic methods. This is more unpredictable and often asks users to make a leap of faith (guessing methods) because the API isn't defined
My personal opinion is to use \ArrayAccess, since it's a standard and well-supported approach.