Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 459884 - Provide an API to be able to provide an EPackageProvider
Summary: Provide an API to be able to provide an EPackageProvider
Status: CLOSED WONTFIX
Alias: None
Product: Acceleo
Classification: Modeling
Component: Query Language (show other bugs)
Version: 3.6.0   Edit
Hardware: All All
: P3 enhancement
Target Milestone: ---   Edit
Assignee: Yvan Lussaud CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 458024
  Show dependency tree
 
Reported: 2015-02-13 08:00 EST by Cedric Brun CLA
Modified: 2015-04-10 05:25 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Cedric Brun CLA 2015-02-13 08:00:39 EST
Currently the QueryEnvironmen() constructor builds its own EPackageProvider in the constructor :

	/**
	 * Creates a new {@link QueryEvaluationEngine} instance.
	 * 
	 * @param crossReferencer
	 *            a new {@link CrossReferencer} that will be used to resolve eReference requests in services
	 *            needed it.
	 */
	public QueryEnvironment(CrossReferenceProvider crossReferencer) {
		ePackageProvider = new EPackageProvider();
		lookupEngine = new BasicLookupEngine(crossReferencer);
		this.initStandardServices();
		this.logger = Logger.getLogger(this.getClass().getName());
	}

having the hability to pass my own EPackageProvider would allow me to handle the lifecycle and the "where to find the EPackages", being in the current resourceSet or somewhere else. That's a reponsability for the implementer of the EPackageProvider.

Also the Method QueryEnvironment.registerEPackage(EPackage) is directly delegating to the EPackageProvider and should probably not belong to QueryEnvironment at all once the EPackageProvider can be created and handled by the calling code.
Comment 1 Yvan Lussaud CLA 2015-02-20 10:20:04 EST
It belong to the QueryEnvironment because all data from outside should be centralized in the QueryEnvironment. The look up of an EPackage/EClass must be the same at compilation/validation/evaluation time, so changes on EPacakges registration must be explicit.

At some point we would probably introduce a QueryEnvironment listener to react to service registration, EPackage registration, and probably variable type changes.

So EPackageProvider should not be API.
Comment 2 Cedric Brun CLA 2015-02-25 10:37:30 EST
I'm quite convinced. We should deal with this at the Sirius level, making sure we can provide AQL a list of Ecore models to consider (and maybe enforcing it in the .odesign as a first step) and we might fall back to "registering all the known metamodels" otherwise.
Comment 3 Yvan Lussaud CLA 2015-04-10 05:25:59 EDT
We all agree on this point. So I close it.