Ingo Rammer Technology Consulting
» IngoRammer.com
» My Books
» Conferences
» Consulting & Services
» Newsletter
 
 
 
» Contact
 

Advanced .NET Remoting in VB.NET

"Advanced .NET Remoting in VB.NET" is the Visual Basic edition of "Advanced .NET Remoting". It has been published by Apress in July 2002.

As the book shows a lot of sample code, I decided to offer it in VB.NET as well so that you, as a Visual Basic developer, can read the book in your native language without having to translate every example on your own.

If you are a VB.NET developer and already own "Advanced .NET Remoting", please let me simply point you towards the VB.NET samples which can be downloaded here.

 

Advanced .NET Remoting (C# Edition)

"Advanced .NET Remoting" is the first book that really offers in-depth coverage of the .NET Remoting Framework. The first part of the book covers everything a developer needs to know to use the framework and its capabilities in real-world applications, including the basics of server-activated objects versus client-activated objects, formatters, channels, lifetime issues, security, configuration files, and more.


Source code available in C# and VB.NET
Sample chapter available here

Let me give you a short intro to what is covered in my book which has been published by Apress in April 2002:

First of all, it's split into two parts: the first chapters (which I tend call the "use-it"-part) show you all the basics you need to know to use Remoting in your real-world projects. I might have a different definition of "basics", so this also covers how to work with MetaData (SoapSuds, Interfaces or abstract base classes), and goes into details of the configuration and deployment of .NET Remoting applications. It further proceeds with some in-depth stuff like working with Leases and Sponsors and how to deal with versioning issues right from the start of your application's design.

The second part (the "understand-and-extend-it" one) shows you the black-magic internals of .NET Remoting. I present how Channels, Formatters, Sinks, Providers & co. really work and why & how you should implement them when you want to extend the framework. This is information you wouldn't get from the documentation, because I literally digged my way right through the IL to provide the "real bits" you need to know when you are going to work with the framework. 

Of course there are loads of (downloadable) "real code" in the book. Nearly every feature I present during both parts of the book is accompanied by an example. Especially in the second part, all remoting interfaces (like IMessageSink, IClientChannelSink, IServerChannelSink, etc.) are implemented (and of course explained on a per-method basis) in real world examples. There even is a fully new transport channel implemented from scratch.

To give you a detailed overview of what will be covered, I decided to bring a part of its introduction online. If you have more questions which are not answered here, please don't hesitate to ask me

- Ingo Rammer
rammer@sycom.at 

Introduction

(This is taken directly from the book)

What Is Covered in This Book

This book covers the means of cross-process and cross-machine interaction of applications developed with the .NET Framework. It will provide you with an in-depth understanding of the remoting capabilities that are built into the .NET Framework.

.NET Remoting is different from most other means of remote object access because it can be as easy as writing COM components in Visual Basic 6, yet also gives you the option to extend remoting to include virtually any protocol on any transportation layer you will come across.

The first part of the book gives you a thorough introduction to .NET Remoting basics and how you can use .NET Remoting out of the box. This gives you a whole range of possibilities, from fast binary transfer protocol to a cross-platform SOAP protocol, with the potential to switch between both without changing a single line in your code. At the end of this part, you will be able to design and develop remoteable components and know just what you have to do achieve your goals. This part also deals with objects lifetimes, security, versioning, marshalling, and deployment.

The second part covers the advanced features of .NET Remoting and its extensibility model. At the end of the second part you will have an in-depth understanding of the inner workings of remoting and will know how to extend the framework to meet your requirements.

What This Book Doesnt Cover

This book is in no way a rehash of the supplied documentation but is meant to be used together with it. You will only find a small percentage of the information that is covered in the online documentation in this book and vice versa, so it is very important for you to use the .NET Framework SDK documentation as well.

You should not be afraid, especially as you go through the samplecode in the second part of the book, to either hit F1 or to insert a breakpoint and examine the Locals window in your custom channel sink to see the exact contents of the objects that get passed as parameters to your methods.

I chose this approach to writing a book for one simple reason: I assume that as an advanced developer, you dont have too much time to waste going through a 1,000-page book of which 600 pages are a reproduction of the online documentation. Instead you want to read the information which has not been covered before. If you think so as well, this book is right for you.

Who This Book Is For

This book is for the intermediate-to-advanced programmer who wants a hands-on guide to .NET Remoting. Although this book is not an introduction to .NET, the CLR, or any .NET language, nevertheless you will be able to use the knowledge and insight youll get from this book with any of these programming languages. All examples in this book are written in C#. But if youre a VB .NET developer you're very welcome - you can download the source code for all examples in VB.NET as well.

For you are a use-it developer, Chapters 1 through 6 of this book will serve you well by providing a general introduction to the possibilities of remoting and giving you in-depth information on how to use the capabilities that come with .NET Remoting out of the box.

If you are more of an understand-it-and-extend-it developer, the second part of this book is for you. Chapters 7 through 11 were written for those who want to understand whats going on behind the scenes of .NET Remoting and how the framework can be customized using proxies, messages, channel sinks, and providers. It also demonstrates how a complete transport channel is implemented from scratch.

How This Book Is Structured

Advanced .NET Remoting is divided into two parts. The first part (Chapters 1 through 6) covers everything you need to know for developing distributed applications within the .NET Framework. The second part (Chapters 7 through 11) gives you a thorough technical insight that will allow you to really understand whats happening behind the scenes and how you can tap into customizing the framework to suit your exact needs. Following is a brief chapter-by-chapter summary of the topics covered in this book.

Chapter 1: Introduction to Remoting

This chapter gives you a short introduction to the world of distributed application development and the respective technologies. It presents some scenarios in which .NET Remoting can be employed and includes historical background on the progress and development of various remoting frameworks during the last ten years.

Chapter 2: .NET Remoting Basics

This chapter gets you started with your first remoting application. Before going directly to the code, I present the distinctions between .NET Remoting and other distributed application frameworks. I then introduce you to the basic types of remote objects, which are server-activated objects and client-activated objects, and show you how to pass data by value. I also give you some basic information about lifetime management issues and the generation of metadata, which is needed for the client to know about the interfaces of the server-side objects.

Chapter 3: Remoting in Action

In this chapter, I demonstrate the key techniques youll need to know to use .NET Remoting in your real-world applications. I show you the differences between Singleton and SingleCall objects and untangle the mysteries of client-activated objects. I also introduce you to SoapSuds, which can be used to generate proxy objects containing only methods stubs.

Chapter 4: Configuration and Deployment

This chapter introduces you to the aspects of configuration and deployment of .NET Remoting applications. It shows you how to use configuration files to avoid the hard coding of URLs or channel information for your remote object. You also learn about hosting your server-side components in Windows Services or Internet Information Server (IIS).

Chapter 5: Securing .NET Remoting

This chapter shows you how to leverage IIS features when it comes to hosting your components in a secured environment. In this chapter you learn how to enable basic HTTP sign-on and the more secure Windows-integrated authentication scheme, which is based on a challenge/response protocol. You also see how to enable encrypted access by using standard SSL certificates at the server side.

Chapter 6: In-Depth .NET Remoting

As a developer of distributed applications using .NET Remoting, you have to consider several fundamental differences from other remoting techniques and, of course, from the development of local applications. These differences, including lifetime management, versioning, and the handling of asynchronous calls and events, are covered in this chapter.

Chapter 7: Inside the Framework

.NET provides an unprecedented extensibility for the remoting framework. The layered architecture of the .NET Remoting Framework can be customized by either completely replacing the existing functionality of a given tier or chaining new implementation with the baseline .NET features.

Before working on the framework and its extensibility, I really encourage you to get a thorough understanding of the existing layers and their inner workings in this architecture. This chapter will give you that information.

Chapter 8: Creation of Sinks

This chapter covers the instantiation of message and channel sinks and sink chains. It shows you the foundation on which to build your own sinkssomething you need to know before tackling the implementation of custom sink.

Chapter 9: Extending .NET Remoting

This chapter builds on the information from Chapters 7 and 8 and shows you how to implement custom remoting sinks. This includes channel sinks that compress or encrypt the transported information, message sinks to pass additional runtime information from a client to the server or to change the .NET Remoting programming model. This chapter concludes with showing you how to implement custom remoting proxies that forward method calls to remote objects.

Chapter 10: Developing a Transport Channel

This chapter builds on the information you gained in Chapters 7, 8 and 9 and presents the development of a custom .NET Remoting channel which transfers messages via standard Internet e-mail by using SMTP and POP3. It not only shows the implementation of this channel but also the necessary phase of analyzing the underlying protocol to combine it with the features and requirements of .NET Remoting.

Chapter 11: Context Matters

This last chapter is about message-based processing in local applications. Here you learn how you can intercept calls to objects to route them through IMessageSinks. This routing allows you to create and maintain parts of your applications business logic at the metadata level by using custom attributes. You also discover why it might be a good idea to do so.






© 2002, 2003 by Ingo Rammer (ingo@ingorammer.com). Information is provided as-is and is subject to heavy changes due to its pre-release character.