1 / 9

Chapter 10 – Remoting

Chapter 10 – Remoting. Objectives. Application Domains Remote Object Types Marshaling-by-Reference Modes The .NET Remoting Architecture. Application Domains. All .NET components require a managed environment to run in OS’s provide processes only

dung
Download Presentation

Chapter 10 – Remoting

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 10 – Remoting CIS 330 - .NET Applications

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

  3. 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 Process B App Domain A App Domain B App Domain C Assembly 1 Assembly 1 Assembly 1 Assembly 2 Assembly 4 Assembly 4 Assembly 3 Assembly 5 Assembly 6 CIS 330 - .NET Applications

  4. 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 CIS 330 - .NET Applications

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

  6. 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() CIS 330 - .NET Applications

  7. 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 CIS 330 - .NET Applications

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

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

More Related