For our current usage of IMemento the FVB example is as good as any; it's used to persist -some- state from an existing Java class (in this case FastViewBar). I think that where we want to get to is a point where folks with persistent state model it and then leave the persistence part of the life-cycle to the model implementation rather than 'hand-rolling' it on a case by case basis.
For Views there's two 'types' of persistent data; the structure the view is showing (which can be quite complex like the Resource model) and the state of the View (scroll pos, selection, sub-tree open state...) which is usually somewhat simpler. On Tue, Apr 29, 2008 at 3:44 PM, Michael Scharf < [EMAIL PROTECTED]> wrote: > Boris Bokowski wrote: > > > Michael Scharf wrote: > > > Ok, let's do a simple validity test. How would an EMF based YAMI > > solution > > > replace the following IMemento code: > > > > > > from org.eclipse.ui.internal.FastViewBar > > > > I am all for concrete questions - and concrete code - instead of an > > abstract discussion, but do you have a better example? The example code > > from FastViewBar.java is about extracting the persistent model from a > > particular class which we haven't split properly into a model part and a UI > > part yet. My hope would be that code like the one below would be obsolete > > once we have a proper split, in which case the model is exactly what you > > would persist, and there would be no need for extracting just the right > > properties in an ad-hoc way. > > > > Well, maybe I am missing something here! BUT the idea of IMemento (as > I understand it) is to be used to save and restore a hierarchical > data structures in a ad-hoc fashion. Forget about FastViewBar, but > if I'd have a view with some state I'd save it the way FastViewBar > does. Therefore it *is* a good example of using IMemento. > > You could require to model the datastructure that you want to save. > That is what my MagicInterfaces help: > > http://dev.eclipse.org/mhonarc/lists/eclipse-incubator-e4-dev/msg00283.html > > > This is not to say that YAMI is a bad idea, just that the example you are > > referring to is not very good. > > > > Please give me a better example for IMemento. > > Michael > > _______________________________________________ > eclipse-incubator-e4-dev mailing list > [email protected] > https://dev.eclipse.org/mailman/listinfo/eclipse-incubator-e4-dev >
_______________________________________________ eclipse-incubator-e4-dev mailing list [email protected] https://dev.eclipse.org/mailman/listinfo/eclipse-incubator-e4-dev
