So to summarize your idea it would be like this
class SingleSortState
IChangeRecorder recorder;
SortState(IChangeRecorder) {...}
setPropertyState(...) {
recorder.addChange( new Change() {...} )
}
OrderByLink { onclick () { getState().setProperty(...); } }
this has the same net affect as
OrderByLink { onclick() { addstatechange(new Change() { ... clone(getState()); }); getState().setProperty(...); } }
Your way shifts a lot more responsibility into the model because it needs to know how to version itself, and most models in wicket need to do that to support the back button. That means you can no longer user your pojo models as wicket models. for example i can no longer reuse my Person pojo from the domain layer because it has no concept of versioning. am i totally off here? Thats the advantage of doing it on component side - your models can stay dumb pojos and the component takes care of versioning them by using the only fool-proof way it can - cloning.
-Igor
- Re: [Wicket-user] Anonymous subclasses of Model: bad or no... Igor Vaynberg
- Re: [Wicket-user] Anonymous subclasses of Model: bad ... Christian Essl
- Re: [Wicket-user] Anonymous subclasses of Model: ... Igor Vaynberg
- Re: [Wicket-user] Anonymous subclasses of Mod... Christian Essl
- Re: [Wicket-user] Anonymous subclasses of... Igor Vaynberg
- Re: [Wicket-user] Anonymous subclass... Christian Essl
- Re: [Wicket-user] Anonymous subc... Igor Vaynberg
- Re: [Wicket-user] Anonymous ... Christian Essl
- Re: [Wicket-user] Anonymous ... Johan Compagner
- Re: [Wicket-user] Anonymous ... Igor Vaynberg
- Re: [Wicket-user] Anonymous ... Johan Compagner