Calling business factory methods server side

Calling business factory methods server side

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


rfcdejong posted on Friday, September 11, 2009

A factory method (almost?) always contains code calling the dataportal, this way the business object deserialize to the server side, that is standard behaviour. But i noticed that developers in my company are calling other business factory methods when they are at the server side (easy to know because we use the objectfactory's, in other words they call the factory methods from within a objectfactory)

Since we only use the local dataportal proxy this works fine, but i'm wondering if this will work with remoting, enterprise services, wcf, etc..

Even if this will work, is it correct to call other business factory methods?

RockfordLhotka replied on Friday, September 11, 2009

Yes, it is fine to call the static factory methods while on the server - that's within the design parameters of the data portal and is an intended usage scenario.

rfcdejong replied on Saturday, September 12, 2009

Thanks for the good news.

rsbaker0 replied on Friday, September 11, 2009

rfcdejong:
...Since we only use the local dataportal proxy this works fine, but i'm wondering if this will work with remoting, enterprise services, wct, etc..

Even if this will work, is it correct to call other business factory methods?


I'll just wade in to offer that in every situation that we have used a remote or non-local data portal (mainly the web service portal, since it's especially debugger friendly), only the client side has used the remote portal.

The "server side" is configured to use the local data portal anyway. (I suppose it might be possible to have an advanced configuration that might chain from one remote portal to another, but that makes my head hurt to think about)

You incur a little more overhead going through the local portal server-side versus directly access to the object methods, but in general we've found all the CSLA calls that you would typically make client-side (e.g. Save(), __Fetch(), etc.) also work just fine server side.

Copyright (c) Marimer LLC