I've been thinking about another possible extension to indexed properties.
Irrespective of the final grammar for indexed properties (with $ or []'s)
the idea would work I think.
How about having the ability to have "named" indexes?
In order to avoid 2 situations:
1) web designers having to know that "name.address[2].city" (index = 2) is
the shipping city instead of the billing city (index = 1?)
2) developers having to assign specific types of information to a specific
index
So access to the city could look like this: (old style)
name.address[2].city
name.address[billing].city
- or - (new style)
name_address$1_city
name_address$shipping_city
The method signature would look like the standard indexed signature, except
that the int would be replaced with a String.
I know I could write this so that I had both a getBillingAddress() and a
getShippingAddress(), but for lists of information I can't anticipate at
design time, this would provide another tool for making those lists easily
accessible and friendlier.
I'm sure support for this could be added at any time in the future as well.
It would only amount to providing another level of method signature
matching...
Any thoughts?
Brian Johnson
--------------------------------------------------------------
RealCommunities 408 342 5900 x153 Voice
20823 Stevens Creek Blvd, Suite 275 408 314 6088 Mobile
Cupertino, CA 95014 408 342 5919 Fax
|