Am 12.04.2011 um 16:53 schrieb Alex: > I was having similar trouble sharing resources (mainly caches) among UIMA > annotators using Spring injection several months ago. The simplest solution I > came up with was to create my own UimaContext object that also holds a Spring > ApplicationContext and pull my shared resources (Spring beans) in the > Annotator > initialize method....
Your approach seems quite similar to using a modified ResourceManager. Using the SimpleNamedResourceManager [1] one could easily inject individual beans or the whole application context. From my point of view the basic difference in your approach is that you chose the UimaContext as a vehicle for the Spring application context instead of the ResourceManager. Do you see any advantage in using the UimaContext over using the ResourceManager to provide access to objects managed outside UIMA? Of several issues that have been raised so far, your approach seems to address only the first: 1) inject arbitrary Java objects managed outside UIMA into a UIMA component 2) dependency injection into the actual UIMA components and, thus, reducing the boilerplate 3) post-processing of UIMA components to take advantage e.g. of Spring-specific DI and Spring aspects (ignoring load-time-weaving, which always works) 4) assembling components using code or descriptors typical to the DI framework (e.g. Spring bean description files) instead of using UIMA XML descriptors With the SimpleNamedResourceManager approach, uimaFIT addresses 1 and 2, while uimaFIT-spring addresses 3. I understand Roberto is working on an approach addressing all four aspects. To me, it seems that the most common issue so far is how to nicely inject objects managed outside UIMA into a UIMA component (1). Reducing the boiler plate (2) seems to be second most popular issue. The other two issues (3 & 4) seem rather theoretical so far, more like side-effects of particular solutions to (1). Cheers, Richard [1] http://code.google.com/p/uimafit/source/browse/trunk/uimaFIT/src/main/java/org/uimafit/util/SimpleNamedResourceManager.java -- ------------------------------------------------------------------- Richard Eckart de Castilho Technical Lead Ubiquitous Knowledge Processing Lab FB 20 Computer Science Department Technische Universität Darmstadt Hochschulstr. 10, D-64289 Darmstadt, Germany phone [+49] (0)6151 16-7477, fax -5455, room S2/02/B117 [email protected] www.ukp.tu-darmstadt.de Web Research at TU Darmstadt (WeRC) www.werc.tu-darmstadt.de -------------------------------------------------------------------
