Remoting

M

Mark Broadbent

Could someone clear this up for me a bit. I am a little bit uncertain about
this but this is my understanding. Please correct where wrong or bits
missing.

There are two types of remoting :-

Marshal-by-reference
Server Activated objects (SAO). Object instanciated on the
server. Default constructor. Creation delayed till first method call.
Lifetime controlled by server
has :-
SingleCall activation mode. Object created and destroyed
with each client request
Singleton activation mode. Object created and shared
between clients
Client Activated objects (CAO). Object instanciated on the
server. Multiple constructors. Creation is not delayed. Lifetime controlled
by client

Marshal-by-value
Can be Client Activated Objects only, and instanciated on the client
itself


One thing I really dont understand (no real code examples) is how to remote
using marshal-by-value. I have read that you need to apply the
[Serializable()] attribute to the class in question but is this all you need
to do?


--


Br,
Mark Broadbent
mcdba , mcse+i
=============
 
S

Sunny

Hi,

no-spam-please@no- said:
Could someone clear this up for me a bit. I am a little bit uncertain about
this but this is my understanding. Please correct where wrong or bits
missing.

There are two types of remoting :-

Marshal-by-reference
Server Activated objects (SAO). Object instanciated on the
server. Default constructor. Creation delayed till first method call.
Lifetime controlled by server
has :-
SingleCall activation mode. Object created and destroyed
with each client request
Singleton activation mode. Object created and shared
between clients
Client Activated objects (CAO). Object instanciated on the
server. Multiple constructors. Creation is not delayed. Lifetime controlled
by client

Marshal-by-value
Can be Client Activated Objects only, and instanciated on the client
itself


One thing I really dont understand (no real code examples) is how to remote
using marshal-by-value. I have read that you need to apply the
[Serializable()] attribute to the class in question but is this all you need
to do?

Yes, thats all you need to do. You can not have MBR and Serializable at
the same time, as the system would not know what to do, to pass by ref
or by val.

Also, you can make your class implement ISerializable, and create your
own serialization of your class, so it can be MBV as well.

Sunny
 
K

Ken Kolda

Hey Sunny --

I believe it actually is allowed to have an MBR object marked as
Serializable. The MBR takes precedence for the purposes of remoting.

Ken


Sunny said:
Hi,

no-spam-please@no- said:
Could someone clear this up for me a bit. I am a little bit uncertain about
this but this is my understanding. Please correct where wrong or bits
missing.

There are two types of remoting :-

Marshal-by-reference
Server Activated objects (SAO). Object instanciated on the
server. Default constructor. Creation delayed till first method call.
Lifetime controlled by server
has :-
SingleCall activation mode. Object created and destroyed
with each client request
Singleton activation mode. Object created and shared
between clients
Client Activated objects (CAO). Object instanciated on the
server. Multiple constructors. Creation is not delayed. Lifetime controlled
by client

Marshal-by-value
Can be Client Activated Objects only, and instanciated on the client
itself


One thing I really dont understand (no real code examples) is how to remote
using marshal-by-value. I have read that you need to apply the
[Serializable()] attribute to the class in question but is this all you need
to do?

Yes, thats all you need to do. You can not have MBR and Serializable at
the same time, as the system would not know what to do, to pass by ref
or by val.

Also, you can make your class implement ISerializable, and create your
own serialization of your class, so it can be MBV as well.

Sunny
 
M

Mark Broadbent

from what I've seen so far it does certainly appear that you can mark MBR's
as serializable.

I really need to get my hands on a comparison though to make it clear to me
a. How to define a MBR (which I know -inherit from MarshalByRefObject)
b. How to define a MBV (which I thought you just needed to set Serializable
attribute..... but then if that was the case how come you can mark MBR's
with this attribute too. Something dont add up?


--


Br,
Mark Broadbent
mcdba , mcse+i
=============
Ken Kolda said:
Hey Sunny --

I believe it actually is allowed to have an MBR object marked as
Serializable. The MBR takes precedence for the purposes of remoting.

Ken


Sunny said:
Hi,

no-spam-please@no- said:
Could someone clear this up for me a bit. I am a little bit uncertain about
this but this is my understanding. Please correct where wrong or bits
missing.

There are two types of remoting :-

Marshal-by-reference
Server Activated objects (SAO). Object instanciated on the
server. Default constructor. Creation delayed till first method call.
Lifetime controlled by server
has :-
SingleCall activation mode. Object created and destroyed
with each client request
Singleton activation mode. Object created and shared
between clients
Client Activated objects (CAO). Object instanciated on the
server. Multiple constructors. Creation is not delayed. Lifetime controlled
by client

Marshal-by-value
Can be Client Activated Objects only, and instanciated on the client
itself


One thing I really dont understand (no real code examples) is how to remote
using marshal-by-value. I have read that you need to apply the
[Serializable()] attribute to the class in question but is this all
you
need

Yes, thats all you need to do. You can not have MBR and Serializable at
the same time, as the system would not know what to do, to pass by ref
or by val.

Also, you can make your class implement ISerializable, and create your
own serialization of your class, so it can be MBV as well.

Sunny
 
K

Ken Kolda

Marking a class as Serializable has many more uses than just for remoting
(e.g. serialization to disk or to a database). Imagine a class which
represents a large dataobject that's pulled from a database. You might use
serialization to generate a binary representation that could be stored in
and retrieved from a db easily, but when you remote this object you may want
MBR behavior to prevent the massive amounts of data from crossing the wire
when only a small piece of it is needed.

Ken



Mark Broadbent said:
from what I've seen so far it does certainly appear that you can mark MBR's
as serializable.

I really need to get my hands on a comparison though to make it clear to me
a. How to define a MBR (which I know -inherit from MarshalByRefObject)
b. How to define a MBV (which I thought you just needed to set Serializable
attribute..... but then if that was the case how come you can mark MBR's
with this attribute too. Something dont add up?


--


Br,
Mark Broadbent
mcdba , mcse+i
=============
Ken Kolda said:
Hey Sunny --

I believe it actually is allowed to have an MBR object marked as
Serializable. The MBR takes precedence for the purposes of remoting.

Ken


Sunny said:
Hi,

Could someone clear this up for me a bit. I am a little bit
uncertain
about
this but this is my understanding. Please correct where wrong or bits
missing.

There are two types of remoting :-

Marshal-by-reference
Server Activated objects (SAO). Object instanciated on the
server. Default constructor. Creation delayed till first method call.
Lifetime controlled by server
has :-
SingleCall activation mode. Object created and destroyed
with each client request
Singleton activation mode. Object created and shared
between clients
Client Activated objects (CAO). Object instanciated on the
server. Multiple constructors. Creation is not delayed. Lifetime controlled
by client

Marshal-by-value
Can be Client Activated Objects only, and instanciated on
the
client
itself


One thing I really dont understand (no real code examples) is how to remote
using marshal-by-value. I have read that you need to apply the
[Serializable()] attribute to the class in question but is this all
you
need
to do?

Yes, thats all you need to do. You can not have MBR and Serializable at
the same time, as the system would not know what to do, to pass by ref
or by val.

Also, you can make your class implement ISerializable, and create your
own serialization of your class, so it can be MBV as well.

Sunny
 
S

Sunny

Thanks Ken,

Sunny

ken.kolda@elliemae- said:
Hey Sunny --

I believe it actually is allowed to have an MBR object marked as
Serializable. The MBR takes precedence for the purposes of remoting.

Ken


Sunny said:
Hi,

no-spam-please@no- said:
Could someone clear this up for me a bit. I am a little bit uncertain about
this but this is my understanding. Please correct where wrong or bits
missing.

There are two types of remoting :-

Marshal-by-reference
Server Activated objects (SAO). Object instanciated on the
server. Default constructor. Creation delayed till first method call.
Lifetime controlled by server
has :-
SingleCall activation mode. Object created and destroyed
with each client request
Singleton activation mode. Object created and shared
between clients
Client Activated objects (CAO). Object instanciated on the
server. Multiple constructors. Creation is not delayed. Lifetime controlled
by client

Marshal-by-value
Can be Client Activated Objects only, and instanciated on the client
itself


One thing I really dont understand (no real code examples) is how to remote
using marshal-by-value. I have read that you need to apply the
[Serializable()] attribute to the class in question but is this all you need
to do?

Yes, thats all you need to do. You can not have MBR and Serializable at
the same time, as the system would not know what to do, to pass by ref
or by val.

Also, you can make your class implement ISerializable, and create your
own serialization of your class, so it can be MBV as well.

Sunny
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top