I would like to use one of my services I have defined in AppModule in one of
my data classes. Is this frowned upon?

If not, how do I go about doing it?

Currently my AppModule has:
public static IListService buildListService( ... ) {  ... return
listService; } // listService is an instantation of an implementation of
IListService

and I tried in my data class to add the following:

private Registry registry = IOCUtilities.buildDefaultRegistry();
private IListService _listService = registry.getService(IListService.class);

but it didn't work

I also tried

private Registry registry = IOCUtilities.buildDefaultRegistry();
private IListService _listService = registry.getService("
my.package.ListService",IListService.class);

which gave me java.lang.RuntimeException: Module 'com.beshai.list.jdo' does
not exist. Please ensure that the JAR file for the module is on the
classpath. (the package and class is in a different JAR file, but it is a
maven dependency)

Thanks
--
Peter Beshai

Pure Mathematics/Computer Science Student
University of Waterloo

Reply via email to