Presentation is loading. Please wait.

Presentation is loading. Please wait.

CIS 330 -.NET Applications1 Chapter 10 – Remoting.

Similar presentations


Presentation on theme: "CIS 330 -.NET Applications1 Chapter 10 – Remoting."— Presentation transcript:

1 CIS 330 -.NET Applications1 Chapter 10 – Remoting

2 CIS 330 -.NET Applications2 Objectives Application Domains Remote Object Types Marshaling-by-Reference Modes The.NET Remoting Architecture

3 CIS 330 -.NET Applications3 Application Domains All.NET components require a managed environment to run in OS’s provide processes only Application Domain: bridge between managed code and unmanged code (OS processes) Process A App Domain A Assembly 1 Assembly 2 Assembly 3 Process B App Domain B Assembly 1 Assembly 4 Assembly 5 App Domain C Assembly 1 Assembly 4 Assembly 6

4 CIS 330 -.NET Applications4 Application Domains (cont) App domain – logical processes Why App Domains? –Fault Isolation –Security Benefits –Lower overhead –Can start and shut down independent of hosting processes –Cross-app domain calls in same process are faster then cross-process calls

5 CIS 330 -.NET Applications5 Application Domains (cont) All cross-app domains use remoting Process C App Domain 4 Client Proxy Process A App Domain 1App Domain 3 Machine 2Machine 1 Process B App Domain 2 Object Client Proxy Client Proxy Client Marshalling: forwarding a call to an object

6 CIS 330 -.NET Applications6 Application Domains (cont).NET has AppDomain class –CurrentDomain static property Default App Domain: created when exe is launched Can create objects in app domain –CreateInstanceAndUnwrap(…) Can create new App Domain –CreateDomain(string friendlyName) Can create proxy on client side –CreateInstance() & Unwrap()

7 CIS 330 -.NET Applications7 Remote Object Types Marshaling by Value –Copy of object is transferred to calling app domain –Objects must be serializable –Used when client makes frequent short calls Marshaling by Reference –Remote object accessed via proxy –Class must be derived from MarshalByRefObject –Two kinds: client-activated and server-activated

8 CIS 330 -.NET Applications8.NET Remoting Architecture Formatter: SOAP or binary Channel: TCP, HTTP, or IPC Both client and host must do channel registration Client App Domain Client ProxyFormatterChannel MethodCall()Message Host App Domain Object Stack Builder FormatterChannel MethodCall()Message

9 CIS 330 -.NET Applications9 Summary Application Domains Remote Object Types Marshaling-by-Reference Modes The.NET Remoting Architecture


Download ppt "CIS 330 -.NET Applications1 Chapter 10 – Remoting."

Similar presentations


Ads by Google