i think its important to keep wicket general, even if it is a little less efficient. these model decisions were quite conscious. although what you suggest /would/ require fewer wrappers, it would also tie wicket to a particular way of accessing models. the existing IModel interface is completely general and it should stay that way.
if you really dislike the wrappers, you can implement IModel directly with an anonymous class (this is the whole point of AbstractDetachableModel in fact!). just access your field directly in the get/setObject implementation. if you're looking for efficiency, this is going to be even more efficient than your suggestion because it requires just the anonymous subclass, no additional wrappers and it doesn't involve reflection.
jon
Jan Blok wrote:
Hi,
What made you decide to do things like this?
Eh, Ease of use (as mostly all things are name-value pairs), less objects created, over 4 years databinding experience ;-)
Efficiency?
Also, less objects to create is more efficient, be able to support more end-user, notice also vastly less call to make to attach/detach for all current PropertyModel's (since the PropertyModel could handle multiple name-value pairs, becoming a real properties-model)
And how would a component know how to get its data?
As indicated our components have get/setDataProvider, but keeping using expression in the component constructor would be no problem I guess
I guess it needs some kind of registry to get the model from first,
right? No, no change there, only other method signatures on IModel, that's all...
Regards Jan
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Eelco Hillenius
Sent: Thursday, March 03, 2005 10:30 PM
To: [email protected]
Subject: Re: [Wicket-develop] Wicket IModel questions
Interesting. What made you decide to do things like this? Efficiency? And how would a component know how to get its data? I guess it needs some kind of registry to get the model from first, right?
Eelco
Jan Blok wrote:
(Servoy.com is aHi,
I'm investigating Wicket for possible use in Servoy
database development/deployment tool alaM$-access/filemaker/4d/etc)
while going trough the JavaAPI to investigate how thedatabinding is
high-level?done and how wicket is working internally I have some questions.
As we are doing some serious databinding between models and components in Servoy I really wonder why your IModel is so
expression), it seems to me you need many models which are not very useful.
I noted some is already done to overcome this like:
-defined:Component(String name,Serializable object,String
-used:new MyComponent(name, new PropertyModel(new Model(model), expression));primitive
But to give you an idea how we handle databinding inside Servoy we give all Components a "dataProviderID" so all components have get/setDataProviderID(...) methods and our model have getValue(dataProviderID) and setValue(dataProviderID,newValue), by doing so a model is always something like a row/record/non
object/map, instead of just a value wrapper.
Would it be an idea to do something similar? to overcome model in model constructs...just a thought
So far it seems to me wicket is a very cool framework!
Regards Jan Blok Servoy
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop
------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Wicket-develop mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wicket-develop
------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Wicket-develop mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wicket-develop
