Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 317558 - [Core] Outsource cache mechanism of the core
Summary: [Core] Outsource cache mechanism of the core
Status: RESOLVED FIXED
Alias: None
Product: Papyrus
Classification: Modeling
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: 0.7.0   Edit
Assignee: Emilien Perico CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-22 05:54 EDT by Emilien Perico CLA
Modified: 2010-06-25 06:31 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 Emilien Perico CLA 2010-06-22 05:54:24 EDT
Cache mechanism was part of the core plugin and has been moved in resource loading plugin.
It would be better the have a single plugin for that, to avoid inconsistent dependencies with resource loading
Comment 1 Emilien Perico CLA 2010-06-22 06:07:23 EDT
-> create plugin org.eclipse.papyrus.cache
-> update references to the cache
-> update releng and feature
Comment 2 Cedric Dumoulin CLA 2010-06-22 08:29:44 EDT
What exactly is the purpose of this cache ? What kind of Object does it cache ? Who are the clients needing to require such object and when ?

Normally, a cache mechanism should be transparent to its clients: a client should not be aware that the objects it require are cached. This doesn't seem to be the case in this implementation.
If a client need to retrieve some kind of Objects, it should do it through a well defined API dedicated to this particular service, which should be domain oriented. The API should reflect the purpose of its service, not the fact that objects are cached. Later, the API implementation can decide to use a cache, but this should be transparent to the client.
I propose to use such approach (a domain oriented API) rather than let the cache mechanism appear to client.
Comment 3 Sébastien Gérard CLA 2010-06-22 08:43:18 EDT
+1. Editors of Papyrus do not have to be dependant on any of these transversal services.
Comment 4 Emilien Perico CLA 2010-06-22 10:29:09 EDT
We talked about this point with Cedric at the phone

I just added a service to get objects of specified type, using the cache in a transparent way:
ModelSetQuery.getObjectsOfType

If you agree with this name, I will move it in the core, in a package query to hide cache mechanism
Comment 5 Sébastien Gérard CLA 2010-06-23 06:00:52 EDT
+1
Comment 6 Emilien Perico CLA 2010-06-25 05:44:14 EDT
Cédric: Do you agree too with the names ? Then I will move it in the core.
Comment 7 Cedric Dumoulin CLA 2010-06-25 05:55:19 EDT
I agree with the class name, but not the package name and impl.* names :-).

Proposed names:
- package: org.eclipse.papyrus.core.modelsetquery
- impl.name: replace TypeCache by ModelSetQuery

Also, the impl package should not be visible from outside of the plugin.
Comment 8 Emilien Perico CLA 2010-06-25 06:31:01 EDT
I agree with the names. About the package visibility, I hid it but you sometimes need it to manage the cache (add some objects into).
For example we use it in org.eclipse.papyrus.resourceloading.umlprofile plugin.

We could think about visible helpers/services to manage the cache with an interface next. Then, we will hide the impl package.