You should be able to do this without modifying CSLA itself.
The data portal is interface-based, and so it should be possible to create a "relay" application that includes a custom host class. Probably start with a copy of Csla.Hosts.RemotingPortal, perhaps called RemotingRelayPortal.
You'd then change RemotingRelayPortal to not delegate the call to Csla.Server.DataPortal, but instead to delegate the call to an instance of RemotingProxy. For example, the Create() method would look something like this:
Public Function Create( _
ByVal objectType As System.Type, _
ByVal criteria As Object, _
ByVal context As Server.DataPortalContext) As Server.DataPortalResult _
Implements Server.IDataPortalServer.Create
Dim proxy As DataPortalClient.IDataPortalProxy = New RemotingProxy
Return proxy.Create(objectType, criteria, context)
End Function
On your relay server, your web.config would route inbound remoting calls to this RemotingRelayPortal class, which would simply re-route them to the real server.
There will be a performance hit though, because Remoting will deserialize the inbound message before invoking your relay method, and then the parameters are serialized again as they are sent to the real app server. The same with data going the other way.
But if the perf hit isn't troublesome to you, then it doesn't really matter
The only way I know of to avoid this perf hit is to use WCF and implement the relay at the transport or maybe at the message layers - before deserialization/serialization occurs.
Maybe I didn't understand the architecture of the original post, but it was my understanding that the following would work out of the box with CSLA:
DMZ - (Contains web pages ) -> App Server (contains the business objects) -> Database (contains the database server)
I am guessing the original poster couldn't do this since the object weblink server was really just a proxy to the dmz server? Am I missing something?
Thanks,
Mike
DMZ - (Contains web pages ) -> App Server (contains the business objects) -> Database (contains the database server)"
You are correct and CSLA would work right out of the box for this. But this is not my scenario, there is another machine between the App Server, it would in a sense look like this:
That was my understanding. That for external clients he has:
client->relay->app server->database
While for internal clients he has
client->app server->database
So the trick is to write a data portal host/proxy combo to act as a relay.
RockfordLhotka:That was my understanding. That for external clients he has:
client->relay->app server->database
While for internal clients he has
client->app server->database
So the trick is to write a data portal host/proxy combo to act as a relay.
I use the architecture Mike describes "out of the box". So there must be something different about the poster's app.
Joe
Copyright (c) Marimer LLC