Johan Compagner wrote:
I can think of two reasons why an access operator [] could be useful:
- It might make the expression more readable, because you know that you
are operating on an array, List or Map by looking at the expression.
- The content of the access operator could be an expression itself.
Example:
person.children[person.selectedChildIndex].name
If i you want to this then use ognl.
I will not support this by the basic stuff.
No, I don't want to do this.
My point is: Brackets can be useful for the two reasons I mentioned. If
you do not intend to support these features, there is no reason to use
brackets in the syntax.
I though about this (List and Maps being beans)
For a list this is not that hard because if the next expresion can be
converted to an int then it is just an int for the index.
(get1() is then not supported)
And if it can't be converted then we could check if a method is there.
For maps this is different.
Currently i see List/Maps are not beans. If i always use them as a List or
Map.
First check if something is there (in the map) looks strange to me.
It gives better performance.
Because what happens if you do this:
mymap.value = x
and there is a setValue() but not a map entry?
Should i use setValue or do a map update. (or both?)
That's true, I didn't think of this situation. So it is necessary to
check for getters/setters before doing map stuff. This would be the
following accessor precedence:
1 getter/setter
2 List
3 Map
I don't know if the performance hit is too high to allow getter/setter
access on Maps and Lists, but I would certainly like this feature
because it is an requirement of a framework I am using.
Anyways, kudos for replacing OGNL with something more simple and efficient.
Timo
-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user