yes i think having a switch globally is not a good use case.
I think you just have to choose it at model level. The only problem is that i have changed
AbstractPropertyModel. And that one is the base class for X numbmer of classes (like compound)

So the only real solution (besides always have at least 4 classes copied) is that the
Ognl.getValue or Objects.getValue() is abstracted a way. And by default we use our own.
and you can if you want give in the constructor of the AbstractPropertyModel which one you want to use.

so:

new CompoundModel(user, new OgnlResolver());

that would mean that all AbstractPropertyModel implementations must have an extra field (default null)
And we need an interface that that can handle all types so we have to give them a method like:
getValue(_expression_, component) or something
and
setValue(_expression_,value,component)

Then we can move Ognl to extentions or to another project and only give that Resolver that can be used by any sub class
of AbstractPropertyModel.

johan


On 10/27/05, Laurent PETIT <[EMAIL PROTECTED]> wrote:
Hello,

On 10/27/05, Eelco Hillenius <[EMAIL PROTECTED]> wrote:
> AbstractPropertyModel could work with something like a
> propertyresolver/ delegate (one more indirection :)) for getting and
> setting values based on a _expression_, and it might even be a good idea
> to have the option of having the default delegate as a application
> setting or something. Would be real easy to implement too.

I like the idea of one more indirection :-) to allow more than a
single implementation.

But I can see a problem arise if you do so: having many
implementations that eventually will not share the same syntax for
accessing properties.

This could presumably be a risk for Components Reusability, if some
packaged components embark their own models and rely on a certain
syntax for specifying access to model properties ?


-------------------------------------------------------
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
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to