Distributed Information Systems Lecture 7 - Practical Lecture4 NET Remoting, Lecture notes of Database Management Systems (DBMS)

Detail Summery about Introducing .NET Remoting, Introduction, Distributed Systems in .NET, .NET Remoting Architecture, Marshalling, Marshal by Value.

Typology: Lecture notes

2010/2011

Uploaded on 09/09/2011

rossi46
rossi46 🇬🇧

4.5

(10)

313 documents

1 / 25

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Distributed Information
Distributed Information
Systems
Systems
Markus A. Wolf & Elena I. Teodorescu
Markus A. Wolf & Elena I. Teodorescu
Practical Lecture 4
Introducing .NET Remoting
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19

Partial preview of the text

Download Distributed Information Systems Lecture 7 - Practical Lecture4 NET Remoting and more Lecture notes Database Management Systems (DBMS) in PDF only on Docsity!

Distributed InformationDistributed Information

Systems Systems

Markus A. Wolf & Elena I. Teodorescu^ Markus A. Wolf & Elena I. Teodorescu

Practical Lecture 4

Introducing .NET Remoting

Practical Session Structure^ Practical Session Structure

Introduction

Building a business component

Building an admin GUI

Introducing .NET remoting

Creating a web service and clientwebsite

Developing a Java client

Learning Objectives^ Learning Objectives

• Understand the concepts involved in .NET

remoting

• Write code that implements .NET remoting

Introduction^ Introduction

• In this practical session we will:

  • Implement a remote server application– Use the remote server application to distribute

the admin tool and the PTSLibrary component

.NET Remoting Architecture

Client

Server

Client Object

Server Object

Proxy

Remoting System

Remoting System

Channel

Marshalling

• Marshalling determines how an object is

exposed to the client application

• Objects can be marshalled

  • By value: a copy of the server object is sent

and kept in the client domain

  • By reference: the client only holds a reference

to the object

Marshalling by Value /

-^

Add [Serializable] to the following classes inthe PTSLibrary project:^ – Customer– Project– Task– Team– TeamLeader– User

Marshalling by Reference

•^

We will marshal the

PTSAdminFacade

class by

reference

-^

The object will reside in the server domain andenvironment and all calls are made via the proxy

-^

To do this, just make the class inheriting from MarshalByRefObject

(as

PTSAdminFacade

already

inherits from

PTSSuperFacade

, we can put the

inheritance on the super class)

  • Creating the Project /

Remote Server Code

-^

By default, a

Program.cs

file is created

-^

Open this file and add the following code:

Adding References

•^

As the remote server application provides access toclasses from PTSLibrary, this project needs to be addedas a reference

-^

Further, it is necessary to add a reference to the System.Runtime.Remoting

namespace, as we need to

access its classes for the .NET Remoting

Adding References /

-^

Select

System.Runtime.Remoting

from the .NET

tab

Run the Application

-^

Run the application and fix any problems theremight be

-^

It should look somewhat like this:

Windows Firewall

-^

If Windows Firewall is running, it is possible thatthe server application is blocked when you try torun it^ – Make sure you unblock it