CSLA & MEF Server side options

CSLA & MEF Server side options

Old forum URL: forums.lhotka.net/forums/t/10666.aspx


csmith1 posted on Tuesday, September 06, 2011

I working on a design that uses MEF for server side options. I would like the plug-ins dll to be able to have separate CSLA configuration then host service. The plan is that the CSLA Factory will have Pluging. The factory call to CSLA client side object that may a need different configuration. What would be nice if I could pass the binding configuration through an interface.

Basically I like a CLSA Server be able to call a CSLA client and set that clients configuration.

Another way I could see this working is have DLL contains it own binding independent of the host application.

Hopefully this all covered in the using CSLA eBook and I am missing it somewhere.

 

RockfordLhotka replied on Wednesday, September 07, 2011

As a general rule, the server can never call the client.

There are all sorts of network reasons for this - but generally speaking, the client won't have an IP address that is routable from the server, and the client certainly won't have a reusable domain name that can be resolved (even if you assume the client's IP address is routable).

Nothing in the data portal assumes (or even supports) the idea of the server calling the client.

csmith1 replied on Wednesday, September 07, 2011

I think did not state what I am trying to do clearly. I do not want to call back the client "end user". I want the service to be able to access a another database.

I'd like to point the code generator at another database. Have it build out CSLA objects. Then I want put those object behind a MEF facade. So the user can initiate a command like "Import". The service receives the command. The service is able to call functions in the facade that do a fetch the other database using its CSLA objects. The results are processed and return to end user in the command object. I have successful done this with CSLA  using other backends to external databases. My concern is isolating the MEF plugins from looking at service app.config for their CSLA configuration.  An example if an application is using CSLA configuration of HTTP WCF bindings but wants the plugins to use local.

I understand I will have one dll plugin for local and another plugin for 3 tier. Can I create a dll that has its own CSLA configuration?

 

Thanks

 

 

 

RockfordLhotka replied on Wednesday, September 07, 2011

The .NET configuration subsystem works at the AppDomain level, not the assembly level. CSLA uses the .NET configuration model, and so there's one configuration per AppDomain.

csmith1 replied on Wednesday, September 07, 2011

So what you are saying if I need different CSLA configurations then if I need two application or two services.

My plan then is to implement my MEF interface into my own WCF contract. The facade is going to look a lot like object factory.

Thanks for the info. You saved me a lot of time trying to get Custom Proxy to work.

 

Copyright (c) Marimer LLC