Thursday, June 24, 2004
« On the road with Roger Sessions and Jack... | Main | Distributed Object-Oriented systems, SOA... »

I got this question via email. I get variations on this question a lot, so I thought I’d blog my answer.

 

Hope you don't mind imposing on you for a second. I actually spoke to you very briefly after the one of the sessions and you seemed to concur with me that for my scenario - which is a typical 3-tier scenario, all residing on separate machines, both internal and external clients - hosting my business components on IIS using HTTP/binary was a sensible direction. I've recently had a conversation with someone suggesting that Enterprise Services was a far better platform to pursue. His main point in saying this is the increased productivity - leveraging all the services offered there (transactions, security, etc.). And not only that, but that ES is the best migration path for Indigo, which I am very interested in. This is contrary to what I have read in the past, which has always been that ES involves interop, meaning slower (which this person also disputes, by the way), and Don Box's explicit recommendation that Web Services were the best migration path. I just thought I'd ask your indulgence for a moment to get your impressions. Using DCOM is a little scary, we've had issues with it in the past with load-balancing etc. Just wondering if you think this is a crazy suggestion or not, and if not, do you know of any good best-practices examples or any good resources.

 

 

Here are some thoughts from a previous blog post.

 

The reason people are recommending against remoting is because the way you extend remoting (creating remoting sinks, custom formatters, etc) will change with Indigo in a couple years. If you aren't writing that low level type of code then remoting isn't a problem.

 

Indigo subsumes the functionality of both web services and remoting. Using either technology will get you to Indigo when it arrives. Again, assuming you aren't writing low-level plug-ins like custom sinks.

 

Enterprise Services (ES) provides a declarative, attribute-based programming model. And this is good. Microsoft continues to extend and enhance the attribute-based models, which is good. People should adopt them where appropriate.

 

That isn't to say, however, that all code should run in ES. That's extrapolating the concept beyond its breaking point. Just because ES is declarative, doesn’t make ES the be-all and end-all for all programming everywhere.

 

It is true that ES by itself causes a huge performance hit - in theory. In reality, that perf hit is lost in the noise of other things within a typical app (like network communication or the use of XML in any way). However, specific services of ES may have larger perf hits. Distributed transactions, for instance, have a very large perf hit - which is essentially independent of any interop issues lurking in ES. That perf hit is just due to the high cost of 2-phase transactions. Here's some performance info from MSDN supporting these statements.

 

The short answer is to use the right technology for the right thing.

 

  1. If you need to interact between tiers that are inside your application but across the network, then use remoting. Just avoid creating custom sinks or formatters (which most people don't do, so this is typically a non-issue).
  2. If you need to communicate between applications (even .NET apps) then use web services. Note this is not between tiers, but between applications – as in SOA.
  3. If you need ES, then use it. This article may help you decide if you need any ES features in your app. The thing is, if you do use ES, your client still needs to talk to the server-side objects. In most cases remoting is the simplest and fastest technology for this purpose. This article shows how to pull ES and remoting together.

Note that none of the above options use DCOM. The only case I can see for DCOM is where you want the channel-level security features it provides. However, WSE is providing those now for web services, so even there, I'm not sure DCOM is worth all the headaches. Then the only scenario is where you need stateful server-side objects and channel-level security, because DCOM is the only technology that really provides both features.

 


Friday, June 25, 2004 6:58:35 PM (Central Standard Time, UTC-06:00)
It seems that Michele Leroux Bustamante is one of the people advocating the use of ES. Check out her post here:
http://www.dasblonde.net/PermaLink.aspx?guid=e7a878ff-8ee3-4681-b0fe-3db28b7c6acb

Sunday, Sunday, Sunday. DasBlonde vs the Rock!

Ok, now I'm just being silly. :)

Sunday, June 27, 2004 9:07:54 AM (Central Standard Time, UTC-06:00)
She references a couple other articles, which are very good and are fundamentally consistent with my message.

The trick is that there are SERVICE boundaries, TIER boundaries and COMPONENT boundaries. Remoting should not be used to cross SERVICE boundaries - that's for WSE and/or ASMX technologies.

Then there are TIER boundaries, and then there are COMPONENT boundaries. Remoting is perfectly fine across TIER boundaries within an application. In fact it is often the only technology that fills the requirements within the .NET technology set. By tier, I mean between a rich client and its server, or between a web server and its application server.

Sure, web services can sort of work in those settings, but not if you need to pass complex .NET types across the wire. Well, technically you can create a web service that passes a byte array and manually employ the binary formatter - but even then your binary data gets exploded into ASCII text to be sent across the wire - and that's just plain silly.

Also ES (in the form of DCOM) can be used between physical tiers, but we've been there for years and it was not fun. But hey, if it worked for you in VB6, then be my guest...

Finally there's COMPONENT boundaries - specifically components running in your middle tier. Here's where ES makes all the sense in the world - ASSUMING you need an ES feature (like distributed transactions). If you don't need an ES feature, then I still fail to understand why you'd host stuff in ES. It complicates deployment and management and offers no benefit (again, assuming you aren't using one of its features), so why use it? .NET components (assemblies) talk to each other just fine within a single AppDomain, they don't need ES to do this. And a properly constructed middle tier (code on the app server) should be running in a single AppDomain by design to start with.

Rocky
Thursday, July 08, 2004 8:29:58 AM (Central Standard Time, UTC-06:00)
One of the best reasons I can think of to use ES is that the hosting model is a lot more reliable than ASP.NET (should you require reliability). To quote Rich Turner...

"[use ES if] ... you want a resilient remote component infrastructure"

I know Juval Lowy and Clemens Vasters advocate using ES as the host for middle tier components because it is a lot more reliable and resilient than ASP.NET, which is designed to serve ASPX and ASMX. So, if you need longer running operations, then ASP.NET can be a hindrance.

To paraphrase Juval (from TechEd 2004 Europe)...

"if you're not using ES, then you're building toys".

Wednesday, July 21, 2004 7:04:59 PM (Central Standard Time, UTC-06:00)
At the risk of igniting a firestorm on this subject, I just have to chip in. Rocky's latter clarification does a lot to remove a great deal of potential confusion since the original post made no indication of which boundary he was recommending the use of remoting for.

When it comes down to it though, one has to ask the question "why are you considering .NET Remoting for communications between two processes?". Since this is such a hot topic right now, I've post a detailed article on this subject on my blog at: http://blogs.msdn.com/richturner666/archive/2004/07/21/190742.aspx

Good to see the discussions taking place though ... that indicates that it's an issue that needs resolving and that there are lots of people thinking about it! :D
Thursday, July 29, 2004 5:12:23 AM (Central Standard Time, UTC-06:00)
Don't forget about ES using load balancing...
Schneider
Tuesday, December 06, 2005 3:06:07 AM (Central Standard Time, UTC-06:00)
This article shows how to pull ES and remoting together.

The link to the article is broken, could someone point me in the right direction?

Thx,

- Andy
Andrew Heys
Sunday, January 14, 2007 3:53:47 PM (Central Standard Time, UTC-06:00)
Richard Turner's post is now here: http://blogs.msdn.com/richardt/archive/2004/07/21/190742.aspx
Comments are closed.