Bug 50373 - [RCP] IMemento usage too tightly bound to XMLMemento
Summary: [RCP] IMemento usage too tightly bound to XMLMemento
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.0   Edit
Hardware: All All
: P3 enhancement with 2 votes (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2004-01-22 00:58 EST by paul moore CLA
Modified: 2019-09-06 16:15 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description paul moore CLA 2004-01-22 00:58:43 EST
In theory it should be possible to persist the state of an RCP app to any store 
that can implement IMemento. Unfortunately there is no Memento factory or 
something like it, in fact the creation of IMemento objects is hard coded to 
XMLMemento in many places. 
Ideally there should be an IWOrkBench.setMementoFactory call that an Advisor 
calls at startup - and this factory should then be used throughout to create 
and  IMemento objects
Comment 1 Rafael Chaves CLA 2004-01-22 10:59:24 EST
Reassigning...
Comment 2 Nick Edgar CLA 2006-03-15 11:24:12 EST
Reassigning bugs in component areas that are changing ownership.
Comment 3 Ed Kohlwey CLA 2008-11-14 11:02:18 EST
I agree. I think the only thing that really needs to happen to the interface itself is to add a getElementTypes() method (or something similar); as it stands right now it is impossible to implement all the interface methods simply because this is information can not be retrieved without casting to a XMLMemento (see javadoc for IMemento.putMemento(IMemento memento)). Of course, XMLMemento itself should also be cleaned up so that it won't generate ClassCastExceptions when trying to perform operations on non-XMLMemento mementos.

> In theory it should be possible to persist the state of an RCP app to any store 
> that can implement IMemento. Unfortunately there is no Memento factory or 
> something like it, in fact the creation of IMemento objects is hard coded to 
> XMLMemento in many places. 
> Ideally there should be an IWOrkBench.setMementoFactory call that an Advisor 
> calls at startup - and this factory should then be used throughout to create 
> and  IMemento objects
> 

Comment 4 Boris Bokowski CLA 2008-11-14 15:47:38 EST
A patch would be welcome... http://wiki.eclipse.org/Platform_UI/How_to_Contribute
Comment 5 David Henderson CLA 2009-02-05 10:58:46 EST
Just wanted to add a note, one big problem with always using XMLMemento is that RCP clients will have to know that that is what is being used because XMLMemento requires you use keys and values that represent valid XML otherwise an exception is thrown.  This behavior isn't obvious until it happens at runtime either.  I'm trying to see if a bug report exists for this already- if not I'll submit one.
Comment 6 Boris Bokowski CLA 2009-11-26 16:15:37 EST
Prakash is now responsible for watching bugs in the [RCP] component area.
Comment 7 Eclipse Webmaster CLA 2019-09-06 16:15:42 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.