Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 342842 - Wire objects from application scope directly instead of using RWTFactory
Summary: Wire objects from application scope directly instead of using RWTFactory
Status: RESOLVED FIXED
Alias: None
Product: RAP
Classification: RT
Component: RWT (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 2.0   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 342846
  Show dependency tree
 
Reported: 2011-04-14 10:26 EDT by Rüdiger Herrmann CLA
Modified: 2013-05-23 06:16 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 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