'NET Remoting - PowerPoint PPT Presentation

1 / 34
About This Presentation
Title:

'NET Remoting

Description:

Comparable to CORBA, RMI, DCOM, ... Objects that can be remoted must either be: ... (D)COM: reference counting ( pinging) CORBA: nothing at all .NET Remoting: Leasing ... – PowerPoint PPT presentation

Number of Views:59
Avg rating:3.0/5.0
Slides: 35
Provided by: andreas120
Category:
Tags: net | dcom | remoting

less

Transcript and Presenter's Notes

Title: 'NET Remoting


1
.NET Remoting
  • iVS Kolloquium
  • Andreas Ulbrich

2
Topics
  • What is Remoting?
  • How is it used?
  • How does it work?
  • Is it of any use at all?

3
Microsoft .NET
  • Runtime environment (CLR)
  • Execution model, Common Type System (CTS),
    Intermediate Language (IL), assembly format,
  • Class libraries (BCL)
  • Compilers (C, C, VB.NET)
  • Cunning strategy and a lot of hype
  • Besides commercial version shared source version
    .NET
  • Windows and FreeBSD port provided by MSR
  • Linux port

4
Basic Concepts of .NET Applications
  • Applications
  • Application Domains
  • Object Contexts
  • Context-bound objects
  • Context-agile objects
  • Marshalling
  • By value
  • By reference

Application
Application Domain
stack call
proxy
marshall by reference
marshall by value
Application Domain
Context
Context
marshalling
copy
bound
agile
5
What is Remoting?
  • Marshalling across application/machine boundaries
  • Distributed object infrastructure (middleware)
  • Comparable to CORBA, RMI, DCOM,
  • Objects that can be remoted must either be
  • Derived from System.Runtime.Remoting.MarshalByRefO
    bject
  • Marked with the Serializable attribute

6
Example
  • See it working ...

7
Object Activation
  • Who creates server-side remoting objects?
  • Server activated objects (SAO)
  • Singleton (shared instance)
  • Single Call (one instance per invocation)
  • Published (like Singleton but created manually)
  • Client activated objects (CAO)

8
Example
  • Have fun

9
Other features
  • Asysnchronous invocations
  • Same as for local invocations
  • Oneway (fire and forget) invocations
  • Methods decorated with the OneWay attribute
  • Events
  • Not as intuitive as in the local case

10
Object Lifetime
  • How to garbage-collect distributed objects?
  • (D)COM reference counting ( pinging)
  • CORBA nothing at all
  • .NET Remoting Leasing
  • Leases (time to live) associated with each
    remoted object
  • Increases with every invocation
  • Lease sponsors
  • Can be configured or even switched off

11
Wheres the IDL?
  • No IDL? No stubs? No skeletons?
  • We actually dont need an IDL
  • Use of reflection to extract metadata
  • Build stubs (transparent proxy) from metadata at
    runtime
  • Generic skeletons (again using reflection)
  • But may need interface definition
  • Dont want to ship implementation with client
  • Client does not run on .NET (Dont tell
    Microsoft!)
  • Tools for extracting metadata (soapsuds)
  • WSDL or metadata assembly

12
So, how does it work?
  • Just as you might expect
  • Turn invocation into message
  • Put message on the wire
  • Unpack message
  • Locate object
  • Invoke method
  • Put result in a message
  • Wire the message
  • Unpack the message
  • Return result to caller
  • But whats so special about this?

13
Take Control
  • Have access to almost everything along the
    message path
  • Remoting is a framework of pluggable components
  • Can customize the behaviour of the system
  • Messages
  • Channels
  • Any object through any channel
  • Identified by host and port
  • Message Sinks

14
The full picture
TransparentProxy
Stack Builder Sink
Lease Sink
RealProxy
Dynamic Sinks
Context Terminator Sink
Cross Context Sink
Dispatch Sink
Dynamic Sinks
Channel Sinks
Message Sinks
Formatter
Formatter
Channel Sinks
SDL Sink
Channel Sinks
Sockets, Operating System, Internet,
Transfer Channel
Transfer Channel
Socket Handler
Server
Client
15
Walk through
TransparentProxy
Stack Builder Sink
Lease Sink
RealProxy
Dynamic Sinks
Context Terminator Sink
Cross Context Sink
Dispatch Sink
Dynamic Sinks
Channel Sinks
Message Sinks
Formatter
Formatter
Channel Sinks
SDL Sink
Channel Sinks
Sockets, Operating System, Internet,
Transfer Channel
Transfer Channel
Socket Handler
Server
Client
16
Walk through
TransparentProxy
Stack Builder Sink
Lease Sink
RealProxy
Dynamic Sinks
Context Terminator Sink
Cross Context Sink
Dispatch Sink
Dynamic Sinks
Channel Sinks
Message Sinks
Formatter
Formatter
Channel Sinks
SDL Sink
Channel Sinks
Sockets, Operating System, Internet,
Transfer Channel
Transfer Channel
Socket Handler
Server
Client
17
Walk through
TransparentProxy
Stack Builder Sink
Lease Sink
RealProxy
Dynamic Sinks
Context Terminator Sink
Cross Context Sink
Dispatch Sink
Dynamic Sinks
Channel Sinks
Message Sinks
Formatter
Formatter
Channel Sinks
SDL Sink
Channel Sinks
Sockets, Operating System, Internet,
Transfer Channel
Transfer Channel
Socket Handler
Server
Client
18
Walk through
TransparentProxy
Stack Builder Sink
Lease Sink
RealProxy
Dynamic Sinks
Context Terminator Sink
Cross Context Sink
Dispatch Sink
Dynamic Sinks
Channel Sinks
Message Sinks
Formatter
Formatter
Channel Sinks
SDL Sink
Channel Sinks
Sockets, Operating System, Internet,
Transfer Channel
Transfer Channel
Socket Handler
Server
Client
19
Walk through
TransparentProxy
Stack Builder Sink
Lease Sink
RealProxy
Dynamic Sinks
Context Terminator Sink
Cross Context Sink
Dispatch Sink
Dynamic Sinks
Channel Sinks
Message Sinks
Formatter
Formatter
Channel Sinks
SDL Sink
Channel Sinks
Sockets, Operating System, Internet,
Transfer Channel
Transfer Channel
Socket Handler
Server
Client
20
Walk through
TransparentProxy
Stack Builder Sink
Lease Sink
RealProxy
Dynamic Sinks
Context Terminator Sink
Cross Context Sink
Dispatch Sink
Dynamic Sinks
Channel Sinks
Message Sinks
Formatter
Formatter
Channel Sinks
SDL Sink
Channel Sinks
Sockets, Operating System, Internet,
Transfer Channel
Transfer Channel
Socket Handler
Server
Client
21
Walk through
TransparentProxy
Stack Builder Sink
Lease Sink
RealProxy
Dynamic Sinks
Context Terminator Sink
Cross Context Sink
Dispatch Sink
Dynamic Sinks
Channel Sinks
Message Sinks
Formatter
Formatter
Channel Sinks
SDL Sink
Channel Sinks
Sockets, Operating System, Internet,
Transfer Channel
Transfer Channel
Socket Handler
Server
Client
22
Walk through
TransparentProxy
Stack Builder Sink
Lease Sink
RealProxy
Dynamic Sinks
Context Terminator Sink
Cross Context Sink
Dispatch Sink
Dynamic Sinks
Channel Sinks
Message Sinks
Formatter
Formatter
Channel Sinks
SDL Sink
Channel Sinks
Sockets, Operating System, Internet,
Transfer Channel
Transfer Channel
Socket Handler
Server
Client
23
Walk through
TransparentProxy
Stack Builder Sink
Lease Sink
RealProxy
Dynamic Sinks
Context Terminator Sink
Cross Context Sink
Dispatch Sink
Dynamic Sinks
Channel Sinks
Message Sinks
Formatter
Formatter
Channel Sinks
SDL Sink
Channel Sinks
Sockets, Operating System, Internet,
Transfer Channel
Transfer Channel
Socket Handler
Server
Client
24
Walk through
TransparentProxy
Stack Builder Sink
Lease Sink
RealProxy
Dynamic Sinks
Context Terminator Sink
Cross Context Sink
Dispatch Sink
Dynamic Sinks
Channel Sinks
Message Sinks
Formatter
Formatter
Channel Sinks
SDL Sink
Channel Sinks
Sockets, Operating System, Internet,
Transfer Channel
Transfer Channel
Socket Handler
Server
Client
25
Walk through
TransparentProxy
Stack Builder Sink
Lease Sink
RealProxy
Dynamic Sinks
Context Terminator Sink
Cross Context Sink
Dispatch Sink
Dynamic Sinks
Channel Sinks
Message Sinks
Formatter
Formatter
Channel Sinks
SDL Sink
Channel Sinks
Sockets, Operating System, Internet,
Transfer Channel
Transfer Channel
Socket Handler
Server
Client
26
Walk through
TransparentProxy
Stack Builder Sink
Lease Sink
RealProxy
Dynamic Sinks
Context Terminator Sink
Cross Context Sink
Dispatch Sink
Dynamic Sinks
Channel Sinks
Message Sinks
Formatter
Formatter
Channel Sinks
SDL Sink
Channel Sinks
Sockets, Operating System, Internet,
Transfer Channel
Transfer Channel
Socket Handler
Server
Client
27
Messages
  • Represented by objects implementing IMessage
  • Dictionary (key, value) holds message content
  • __Uri
  • __MethodName
  • __MethodSignature
  • __TypeName
  • __Args
  • __CallContext
  • More spezialized interfaces for easier handling
  • IMethodMessage, IMethodCallMessage,
    IConstructionCallMessage

28
Yet another silly example
  • Server side channel sink
  • Rewrite target URI to transparently invoke
    different object
  • ...

29
Is it of any use?
  • Certainly!
  • Excellent basis for implementing QoS mechanisms
  • Costumizable middleware
  • Reflection
  • Metadata features of C
  • Currently working on
  • Contract passing, examination, ressource
    allocation
  • Pluggable IIOP connector (DA Thomas Schneider)
  • Planned multicast channel for talking to
    multiple objects, channels with bandwidth
    reservation, ...

30
What I dont like
  • VS doesnt run with less than 256 Megs
  • Doesnt enforce separation of interfaces and
    implementation
  • Dispatch Sink cant be exchanged or customized
  • One connection per invocation on default channels
  • Unidirectional channels
  • Somewhat confusing docs
  • Lot of internal stuff that should be accessible

31
Summary
  • Nothing really new
  • But definitely cool stuff
  • Fun to work with
  • Use it!!!
  • Part of the .NET compact framework running on CE
    (Pocket PC) and Palm (No excuse here -)

32
References
  • Advanced .NET Remoting, Ingo RammerApress,
    Berkely, 2002
  • Programming C, Jesse LibertyOReilly,
    Sebastopol, 2nd ed., 2002
  • Rotor source codeMicrosoft, 2002
  • .NET SDK Documentation

33
(No Transcript)
34
Logo
Auszeichnung
35
Logofarbe
100
80
70
60
50
40
30
20
Sekundärfarben (Blautöne)
Sekundärfarben (Brauntöne)
Farben für Grafiken (Grautöne)
70
50
30
10
Auszeichnungsfarben für Grafiken
Auszeichnungsfarben für TextPantone
151CPantone Process Cyan C
Write a Comment
User Comments (0)
About PowerShow.com