Remoting?

Published Sat, Sep 25 2004 23:27 | William

Well, since I've started my new company , I've went from knowing squat about Remoting to being able to hold my own with it.  We have some extremely kick a33 people there and a lot of what I've worked with is part of existing framewors, but screw it, if I'm using it I'm going to understand what I'm doing and Remoting was pretty much the weak spot for me.  That was four weeks ago.  Now, while i won't profess to be the man by any means, I'm not the least bit intimidated of it and actually find myself increasingly starting to really like it.  It's really an amazing technology.  So I picked up Ingo Rammer's Advanced .NET Remoting in VB .NET  book and it's beyond words.  That dude is just one seriously impressive individual.  I was pretty comfortable w/ Remoting when I bought the book but figured it'd be a necessary reference.  BS!  If you are doing any sort of enterprise development - it's a must have.  I have more than a few enterprise books but since this is dedicated to Remoting, Advanced Remoting, well, I have yet to come across something that comes close to it.  Anyway, the one thing that I just don't get is Client Activated Objects.  Totally don't get them.  And no, it's not because I'm lazy and don't want to manage my leases - I just really don't get them. 

If you've done much with Remoting, please chime in on this because they have to be good for something, I just sure as hell don't see it.  Now, as far as Ingo's book goes, it had a really cool angle.  He didn't cater to just the 'hands on' guys or the 'theory' guys, he actually broke the book up into two parts, one for each.  I like this because if you don't understand why you're doing something, it's EXTREMELY Likely (see 'just about 100%') that you'll write crap that you'll rewrite later and wish you could destroy every trace of.  If you get only into theory you will be really obnoxious, people won't like you and you'll probably have a lot of really stupid ideas - why?  Well, because if you just sit around all day and preach about how your approach is the most object oriented thing on planet earth but don't code much, well the flaws of your designing skills probably won't become readily evident to you. (I guess this is a sore spot with me b/c not too long ago, I had someone get really haugty with me over a collection I wrote.  Before this point, this person used only non - strongly typed collections.  So I had one that implemented IEnumerable.  So now all of a sudden this person became collection superarchitect and implemented one with CollectionBase and pointed out how 'flawed' my collection was simply because it didn't use Inheritance ergo it was “Less Object Oriented”) - but I digress.

So anyway, I'm convinced that for performance and security, not to even touch keeping it real, Remoting is where it's at for a lot of places.  Actually, I can't really believe I lived without it for this long (although WS can do a buttload of stuff for you). 

Then there's my other new favorite thing, MSMQ.  Well, MSMQ has been one of my favorites for a while but I didn't really get to use it.  Currently, I'm working on a piece of the project w/ Biztalk, Remoting, MSMQ and WSE 2.0 - it's sooo kick ass I can hardly describe it.  I was at work until 7:00 on Friday just totally oblivious to the fact that it was 7:00 and I was supposed to be home already.  I'll be writing a hell of a lot more about each inthe next few days b/c I'm just totally digging them, and if you are interested in Remoting, I promise you, get Ingo's book.  The low level details that he provides, coupled with the examples will make the whole process A LOT Easier.

Filed under:

Comments

# William said on September 26, 2004 7:15 AM:

Have you ever done ActiveX EXE (out-of-proc COM)? If you are trying to replace that out-of-proc communication in the .NET world you would do remoting. In that scenario CAO is what you would probably use (every client object talks to a corresponding server object and their lifetimes are usually linked). Not sure if that helps you "get it" but I though I'd chime in.

# William said on September 26, 2004 9:33 AM:

I use CAO to have an easy way to maintain state in a remoted object, when the state must be maintained by the server.

# William said on September 26, 2004 12:41 PM:

Michael:

Thanks for the reply. I understand that state management is the primary reason for using CAO's but doesn't using them the same way you would a 'normal' object increase the overhead substantially. I guess what i'm asking is say I have a remoting layer and an object that has StartDoingSomething() and StopDoingSomething(). In that object, if something changes I write to an event log or something of the sort that effectively sends a notification that I or another process/object etc can respond to. So from my client I just treat this layer as essentially a service facade and just concern myself w/ it but not really its state at all. Let's say that StartDoingSomething does all kinds of stuff,creates a Foo(), a Bar() and they raise all sorts of events and everything else, just like I normally would. So basically all of this processing is happening on the app server and all the object managment is essentially happening there. This is pretty much the scenario that I've dealt with so far (again, I'm only a month into using Remoting so that's why I ask - this definitely isn't the voice of experience.) So now, how would I use CAO's to enhance or add a good twist to it? If I make Foo and Bar CAO's then I'm dealing with them directly which requires a lot more maintenance, at least as far as I understand it - doesn't it?

Actually, let me rephrase it (and from reading your blog [particularly the entry about Hiring/Interviewing] I know you are pretty well versed with this) - In comparison, what would you say the ratio of your SAO to CAO usage is? Is it pretty even or is it weighted one way or the other? Do you prefer to work with one over the other?

Thanks again, I definitely appreciate it/

# William said on September 26, 2004 12:42 PM:

Daniel:

Thanks man, and yes, I definitely see your point. I asked Michael this and figured I'd run it by you. In comparison, how much of each do you use, like the ratio of using SAO's to CAO's on the whole? Do you find yourself using one over the other a lot more, or is it pretty much evenly distributed?

Thanks again,

Bill

# William said on September 26, 2004 2:44 PM:

The default is *not* to use CAO. I use CAOs for IPC scenarios only. Even in that case you have to decide if you want your clients to see a server as a service or as an interactive object model. In the former case don't use CAO. In the latter case use CAOs and be aware of the perf hit of chatty calls.

An example implementation I have is where the client can be configured (via config file) to run the server in-proc or hosted out-of-proc. I believe choosing CAO is what enabled this scenario: the server is just another class library not any magic singleton or single-call service.

BTW, if you are getting into remoting, apart from Ingo's site, these two blogs might be useful if you haven't discovered them already (if you know of any others do share :-):
http://blogs.msdn.com/mattavis/
http://blogs.msdn.com/manishg/

# William said on September 26, 2004 3:36 PM:

Ok, that pretty much confirms what I thought - CAO's are useful but their usefulness is pretty specific. Thanks for the links!

# TrackBack said on September 26, 2004 4:49 PM:

# William said on September 28, 2004 4:04 PM:

I use CAO almost exclusively. I don't look at Remoting as a "way to execute a message on a server", ala Web Services. I see it as a way to have, well, remote objects. Of course, this is from writing things for a casino and a payment processing system, where I don't trust the clients to even give the time of day.

# William said on November 23, 2005 4:05 AM:

hi i'm new to remoting concepts . i have develop an appliction using vb.net remoting .. thats send a form from client to server and vice versa .. will u suggest me how to learn remoting concepts and start programming basically in short time

Search

This Blog

Tags

Community

Archives

News

My other sites

Cool Stuff

Book Stuff

Security

ORM

Data Access

Funny Stuff

Compact Framework Stuff

Web Casts

My KnowledgeBase Articles

My MVP Profile

Design Patterns

Performance

Debugging

Remoting

My Fellow Authors

My Books

LINQ

Misc

Speech

Syndication

Email Notifications