I do see my image attached to my previous post - or is it just me ?
If you really can't see it, I uploaded it here :
http://olivier.croisier.free.fr/wicket/models.png


About the models, for example :
- ComponentPropertyModel is not in the same hierarchy as
AbstractPropertyModel.
- StringResourceModel is not a ResourceModel
And so on.

I know there are many justification to this, but I think the whole Model
hierarchy should be refactored and simplified.

If I may do some suggestions, they could be improved as follow :
- the lifecycle management should be integrated at the IModel level - the
"LoadableDetachableModel" should not be an exception with a special case in
the Wicket core code, it should be the norm. After all, if the components
have a lifecycle, so should their models. Of course, most of the Model
classes would not do much (if anything) in the lifecycle management methods,
but this functionnality would be present at the Model core.
- I think there should be some kind of interface that Models could implement
to get a reference to the Component they are assigned to - something like
the BeanFactoryAware interface in Spring. I have a least one use-case for
this : the Model could use the Component to perform I18N by calling
getString() on it (see my blog post on Enums I18N on WicketByExample.com). I
thought IComponentAssignedModel could do that, but it wasn't very clear to
me what this interface was really used for, even after looking at the code.
- AbstractReadOnlyModel should not be a class but a decorator, like
Collections.unmodifiableList for example.

Please let me know what do you think about this ?
Again, those are just some personal ideas, I do not intend to spit on Wicket
- I just love it :)

Olivier


On Fri, Oct 16, 2009 at 10:37 AM, Michael Mosmann <[email protected]>wrote:

> Hi,
>
> > I did the same with the Models a few weeks ago - see the attached
> > image.
>
> hmm.. no image attached..
>
> > BTW, don't you think their hierarchy is a bit weird ?
>
> what's the weird part?
>
> mm:)
>
>
>

Reply via email to