Wednesday, March 28, 2007 10:09 AM
We are going to write an enterprise application that will support multi tier/layers (physical and logical) meaning that our business and data layers may reside either on the client computer or on application server.
- Use Mobile objects.
- Use Remote objects (server activated objects-singleton and client activated objects)
- Fast connection between the client and the server.
- The ability to use fast TCP/binary and HTTP/SOAP for crossing firewalls.
- The ability for the presentation layer and the business layer to interact in object orientation (using mobile objects, remote objects - server activated objects and client activated objects).
- The ability for our business layer to interact with external system in message orientation.
- As far as I know WCF does not support client activated objects because WCF is message oriented and not object oriented.
- WCF always use SOAP header no matter if I use TCP/binary or HTTP/SOAP binding, which can lead to performance issues meaning that WCF will be slower than remoting.
Considering our design issues, what is the best option between remoting and WCF?
Can we overcome the WCF limitations I noted?
What is the motivation for using WCF over Remoting?
Thanks in advance.
Wednesday, March 28, 2007 3:25 PMModerator
Let me address the two issues you are pointing out
1. Your observation is correct that WCF doesn't support client-activated objects that you can instantiate with "new" from the client side. The equivalent for this feature are sessions. In WCF we draw a very clear line between client and server. You first build a proxy and then you explicitly use it to connect to the server. On the service contract you define [ServiceContract(SessionMode = SessionMode.Required)] to require sessions and on the service implementation you specify [ServiceBehavior(InstanceContextMode=InstanceContextMode.PerSession)] to scope the service instance to the session. For further info on sessions please review: http://msdn2.microsoft.com/en-us/library/ms733040.aspx
2. WCF will almost always use headers. So does Remoting. So does DCOM. So does CORBA. So does RMI. So does HTTP. Any distributed systems technology uses some form of headers to communicate out-of-band information between the infrastructure bridgeheads. You are making an assumption about the comparative behavior of Remoting and WCF that isn't accurate. WCF uses a more efficient wire-encoding than Remoting in Binary mode (the formats are different) and the WCF transport infrastructure is substantially more efficient and faster than that of Remoting.
The best choice for you is very clearly WCF.
(If it helps your decision: Our team owns both the .NET Remoting technology and WCF )
Thursday, March 29, 2007 10:03 AM
First I would like to thank you for your response.
1. So as I understand WCF support all three types of activations
The only different is the implementation.
Server activated object - Singleton
- Server activated object – SingleCall
- Client activated object – via WCF session.
2. I understand that WCF is no exception about message header, I was just concerned about the use of SOAP header (which is large in size) even in TDP/Binary binding. So if so I make a lot of calls to large mobile objects the header is not an issue but if the objects are small in size the header become the main data that transfer between the client and the server.
As I understand WCF is more efficient than Remoting which is one of my motivations for using WCF than Remoting.
What I don’t understand why Microsoft bind the implementation and the remoting properties (Remoting use MarsellByRefObject and [Serializable] and WCF use attributes) which means that the object should be aware to the Technology the system going to use, so if I’ll want to change from remoting to WCF I’ll need to change all objects to support the new technology.