Hello all,
This is my very first post on this list. Glad to being able to
exchange ideas with you.
On 10/27/05, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
> Why not keep wicket simple? I really like the simplicity of the dot notation
> johan created. I think we should use [] only as a hint.
> By default wicket tries to find a getter and then checks if the object is a
> list/set/map and
> contains the key.
Does Wicket also check for direct public property of the same name ?
I mean, this way, we can keep things simple as long as no extra logic
is done in the getter/setter ( almost 95 to 99% of the time with GUI
Models ? ), but also later on add getters/setters at will, without
breaking anything ...
Same remark concerning maps vs beans.
If find it great if we don't know if the property is contained in the
Map or is a property of the Model.
Thus, a simple Map at the beginning of the project, whose properties
are accessed like
myObjectThatMayBeAMapOrBean.myPropertyName
can later on evolve to a plain JavaBean without breaking all the
String references to the properties :
myObjectThatMayBeAMapOrBean.myPropertyName
I can see that distinguishing maps/beans properties can be a performance hint:
obj[prop]
obj.prop
but for me it's a shame to sacrifice such power.
I can also see that adding [ ] can help identify a map.
In my opinion, obj[prop] and obj.prop should be the same operation
under the covers :
if the object is an instance of a Map:
first try to interpret prop as a Map key
second try to access prop via getter/setter
third try to access prop as a public property of the object
if the object is not an instance of a Map:
first try to access prop via getter/setter
secon try to access prop as a public property of the object
My apologizes if such ideas have already been thrown by somebody.
My 0.02 EUROS :-)
--
Laurent Petit
-------------------------------------------------------
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