Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 342842

Summary: Wire objects from application scope directly instead of using RWTFactory
Product: [RT] RAP Reporter: RĂ¼diger Herrmann <ruediger.herrmann>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3    
Version: unspecified   
Target Milestone: 2.0   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on:    
Bug Blocks: 342846    

Description RĂ¼diger Herrmann CLA 2011-04-14 10:26:15 EDT
With the ApplicationContext in place, it should be possible to set up objects in the application scope that reference each other.

For example:
Some methods from ImageFactory require an IResourceManager and the InternalImageFactory to work. Currently these are obtained by calls to RWTFactory.

Alternatively the ImageFactory could have fields 'resourceManager' and 'internalImageFactoy' that reference the respective instances.
What is missing then is some way to set/wire these fields before the ImageFactory is made available for access from the outside. 
One approach would be @Inject annotations (depends on bug 340310), though I am not sure if the amount of objects to be wired is enough to justify such a general approach.
Another way could be to extend the ApplicationScope to call a set of distinct 'Runnables' that do the wiring in a object-specific way after all objects have been instantiated.
Comment 1 Ralf Sternberg CLA 2013-05-23 06:16:56 EDT
The RWTFactory had been eliminated in 2.0 with commit bc1423de [1].

[1] http://git.eclipse.org/c/rap/org.eclipse.rap.git/commit/?id=bc1423de3f6b016e1811e3c95b194d5a95c840d2