[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.remoting

How to return and interface from a remote object?

Julia

9/12/2004 12:49:00 PM


Hi,I have the following classes

public interface IComponentProperties
{
object this[string propertyName]
{
get;
set;
}
}

//Hold a list of properties
class Properties:IComponentProperties
{
private Hashtable propsHolder = new Hashtable();
public object this[string propertyName]
{
get
{
return propsHolder[propertyName];
}
set
{

}
}
}


Class Service
{
private Properties props;

public IComponentProperties Properties
{
get{return props;}
}
}


The service class is a server activated singleton remote object which
accessed by ASP.NET application,
I wonder if I need to do anything special in order to use the
IComponentProperties interface from ASP.NET application
Should the Properties class be a remote as well?

Thanks in advance.


1 Answer

Sam Santiago

9/12/2004 8:58:00 PM

0

It depends if you want your properties to be marshaled-by-value or
marshaled-by-reference. Most likely, for properties you probably want to
use marshal-by-value (unless you wanted changes by the client reflected on
the server) so you have to ensure the objects you put in your Hashtable are
Serializable. If you want to remote your properties class then it must
inherit from MarshalByRefObject.

Thanks,

Sam

--
_______________________________
Sam Santiago
ssantiago@n0spam-SoftiTechture.com
http://www.SoftiTe...
_______________________________
"Julia" <codewizard@012.net.il> wrote in message
news:%23IE8qbMmEHA.3760@TK2MSFTNGP12.phx.gbl...
>
> Hi,I have the following classes
>
> public interface IComponentProperties
> {
> object this[string propertyName]
> {
> get;
> set;
> }
> }
>
> //Hold a list of properties
> class Properties:IComponentProperties
> {
> private Hashtable propsHolder = new Hashtable();
> public object this[string propertyName]
> {
> get
> {
> return propsHolder[propertyName];
> }
> set
> {
>
> }
> }
> }
>
>
> Class Service
> {
> private Properties props;
>
> public IComponentProperties Properties
> {
> get{return props;}
> }
> }
>
>
> The service class is a server activated singleton remote object which
> accessed by ASP.NET application,
> I wonder if I need to do anything special in order to use the
> IComponentProperties interface from ASP.NET application
> Should the Properties class be a remote as well?
>
> Thanks in advance.
>
>