EntityTranslators in service agents?

Topics: CAB & Smart Client Software Factory
Sep 13, 2006 at 11:01 AM
originally posted by: bil_simser

Maybe I'm a little confused about something. In the Bank Brank app, the entity translators are in the service proxies projects (there's two of them). The only use of them is in modules (like the BasicAccounts.Module).

I have my own ServiceAgent project that contains smart web references. It seemed logical to me to put the translators in here as they'll be converting from the web service types to the business types.

However the ServiceAgent has to perform it's own translations. Meaning that my service agent contains a class (let's call it CustomerService) that returns a List<Customer>. The modules use this list and map to the UI.

So how do I get my ServiceAgent project (which is a service, not a module so there's no Module.cs file) register the translators? Should I turn the ServiceAgent project into a module so it could do it itself?
Sep 26, 2006 at 2:40 AM
originally posted by: bil_simser


Still looking for ideas here.
Sep 27, 2006 at 1:28 AM
originally posted by: lambertm

I had this same problem, in the end I roled my own mapper class in my SA .. kinda like in the apraiser workbench example.

Sep 27, 2006 at 1:58 AM
originally posted by: bil_simser

Thanks. That's what I've done in the interim and it's fine, however I figured I would try to make use of the entity translation framework that was there. I'm fine leaving it with a class that maps the entities (after all, that's all the translator is) but was just wondering it the SA should be turned into a real module or not? Not sure what the harm in it would be and that way it can register it's translators.
Sep 28, 2006 at 1:26 AM
originally posted by: Pol_parga

I don´t know if it should be usefull but I´d use the entity translators by defining them in a Service Proxy proyect and adding them like services in the module.cs of the modules that should use those services.