Sorry my idea was nonesense. Please disregard it. I don't
believe undo() belongs in the model.
The way I see it, you have a Page, some event occurs and it
modifies the model somehow and causing a rendering to occur. The event
handling code (say onLinkClicked()) modifies the model and at the same
time registers an UndoableEdit.
Now, by default, we will undo the component model automatically
like you said, but the user is able to add his own (additional)
UndoableEdit for any changes to the user model. Does that make sense?
Gili
On Wed, 02 Mar 2005 15:09:51 -0800, Jonathan Locke wrote:
>
>if we really want a little more flexibliity in how models are referenced
>in the undo
>information (which should all be automatic) why not just implement
>IModel.isValue()
>as i suggested and then put this in Component?
>
>IModel undoModel()
>{
> final IModel model = getModel();
> return getModel().isValue() ? Objects.clone(model) : model;
>}
>
>just brainstorming...
>
>Gili wrote:
>
>> Instead of having IModel.isValue(), why not have IModel.undo()
>>and allow the user to implement it? Whether it's a value or reference
>>or whatever, he'll know how to best handle it.
>>
>> BTW: With undo capability, we need redo capability as well. The
>>two go hand in hand. My original post to the java.net forum discusses
>>it.
>>
>>Gili
>>
>>On Wed, 02 Mar 2005 14:54:38 -0800, Jonathan Locke wrote:
>>
>>
>>
>>>one thing that immediately strikes me is that it might be that the model
>>>is really the thing which is either a value model or a reference model
>>>(although you could imagine an app where the same model was used both
>>>ways, you could trivially extend the model to provide both usages).
>>>
>>>if we had
>>>
>>>public boolean IModel.isValue()
>>>
>>>then the model itself could give us information about whether it should
>>>be cloned via Objects.clone() (serialization) or just referenced. for
>>>someone working with hibernate, your base class for your detachable
>>>models could implement this by returning false. this would mean that
>>>undo information for any components referencing the model would be
>>>references and not copies. but then someone who is trying to edit a
>>>non-persistent model by value could return true.
>>>
>>>not sure what the picture is yet for how all this interacts with
>>>staleness...
>>>
>>>Jonathan Locke wrote:
>>>
>>>
>>>
>>>>i don't think you understood. read the post i just posted.
>>>>
>>>>you would never want to get back to a bunch of components that don't
>>>>match the rendering. there's no need for that "flexibility" because
>>>>all you could do is botch it.
>>>>
>>>>what /is/ needed is a way for users to guide the way that models are
>>>>copied or referenced. that's a much more controlled kind of
>>>>flexibility that targets the real problem.
>>>>
>>>>Gili wrote:
>>>>
>>>>
>>>>
>>>>> Based on the feedback I just got I would recommend having the
>>>>>automatic behavior on by default and allowing developments to override
>>>>>it and provide their own UndoableEdit. I think everyone will be happy
>>>>>with that.
>>>>>
>>>>>Gili
>>>>>
>>>>>On Wed, 02 Mar 2005 14:08:59 -0800, Jonathan Locke wrote:
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>>i think this is all completely automatic.
>>>>>>
>>>>>>each page has a bunch of versioning information in Page that gets
>>>>>>modified as components call replace/add/remove (after the first
>>>>>>rendering).
>>>>>>
>>>>>>then we can essentially setVersion(int renderingCount) to get the
>>>>>>earlier page back. the user would have no control over any of
>>>>>>this. it just happens.
>>>>>>
>>>>>>Gili wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>> I'm looking for a good anti-pattern to my suggestion. Is there
>>>>>>>a reasonable use-case where using UndoableEdits would not yield the
>>>>>>>correct/expected behavior?
>>>>>>>
>>>>>>> My hope is that there is none and we can all agree to move
>>>>>>>forward on this issue. Remember, if no UndoableEdit is registered
>>>>>>>for a
>>>>>>>rendering operation then hitting Back yields a "page is stale"
>>>>>>>message.
>>>>>>>It seems quite intuitive to me. :|
>>>>>>>
>>>>>>>Gili
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>-------------------------------------------------------
>>>>>>>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
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>-------------------------------------------------------
>>>>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
>>
>>
>>
>
>
>-------------------------------------------------------
>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