I really like the new models.
But IMHO there are some quirks in the new model hierarchy, probably due
to the latest model backports:
- PropertyModel#propertyType(Component)
Is never called, has a @see to non existent method
AbstractPropertyModel#propertyType(Component)
- BoundCompoundPropertyModel#propertyType(Component)
Ditto, makes BoundCompoundPropertyModel.Binding#type worthless
- CompoundPropertyModel
Since we don't have a ICompoundModel any longer, shouldn't this class be
better named InheritablePropertyModel?
- AttachedCompoundPropertyModel
This inner class implements IInheritableModel, which is superfluous
because in Component#initModel() it is tested on IWrapModel before ever
being able to be used as an IInheritableModel.
- IWrapModel and IWrapModel#getNestedModel()
The name of this class and method are misguiding:
Wrapping models inside other models is quite common in Wicket (see
PropertyModel() javadoc).
But this interface is mainly used as a marker for cases, where models
are inherited "from components higher in the hierarchy" - see
Component#initModel() and MarkupContainer#setModel().
Why not call it IInheritedModel and #getInheritableModel() then?
I know that the same interface is used for
IAssingmentAwareModel#wrapOnAssignment(Component), but this method could
equally well just return an IModel or be a #setComponent(Component).
I dare to say that the javadoc for models are in a wretched condition,
considering that this concept is an integral part of Wicket.
Sven