M
marian.edu
Guest
That will work if you define the class to be generic, aka ServiceManager … or ServiceManager to be more precise
When using generics methods then you need to pass somehow the type to the method, generics method in a non generics class is only possible in Java if there are some input parameter to infer the type from. If implemented the .net way it will be something like this: define it like method public getService ( ) and make the call ICustomService myService = getService (). The Java equivalent might look like this… method public getService (P.L.Class cls) and call it with ICustomService myService = getService(ICustomService.class). Only in 4GL is not easy to get the class ‘instance’ and somehow this doesn’t look appealing to me
ICustomService myService = getService(P.L.Class:getClass(‘ICustomService’)). Marian Edu Acorn IT www.acorn-it.com www.akera.io +40 740 036 212
Continue reading...
Continue reading...