[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

microsoft.public.dotnet.framework.remoting

remoting newbie design question --> remote classes with properties and overloaded constructors with parameters

bfung25

10/13/2004 8:39:00 PM

Hello All,

I've been given the task to redesign a .NET application. The idea is
to have all the the business objects on a remote server, which can be
access by .net remoting by several websites.

My question is a design question (and basic understanding :):)). I
designed my classes to be a container of information. What that means
is the class will have properties and several overloaded constructors
with parameters. The constructors contain methods that populate the
properties depending on the values of the parameters. So what I want
is the ASPX pages from my website to use .net remoting and create a
new instance of a remote object and access the instance's properties
and methods. In other words, use it like a regular instance of a
class.

After reading several sources and scanning the newsgroup, I decided
that CAO will be the way to go since I need to pass parameters to the
constructors. But the impression I get from all the .net remoting
examples (whether CAO or SAO) is that they only call methods from a
remote class. So in other words, you don't really use the remote class
as a container of data, but as a vehicle to call a method remotely.

In other words, am I using .net remoting the wrong way?

Thanks in advance,

Brian

P.S. If you require more detail, please let me know.
2 Answers

Sam Santiago

10/13/2004 9:01:00 PM

0

An SAO is a stateless programming model. That is that each invocation does
not remember anything about the previous call. CAO are more of a stateful
programming model. Each client has its own instance to interact with so it
can contain data in between invocations; it can be "a container of data" as
you state below. Therefore, in your application you might have some objects
that are SAOs and others that are CAOs depending on if you want to maintain
state or not. SAO's lifetime is controlled by the server, CAOs lifetime is
controlled by the client. Be sure to read this article:

Managing the Lifetime of Remote .NET Objects with Leasing and Sponsorship by
Juval Lowy
http://msdn.microsoft.com/msdnmag/issues/03/12/LeaseManager/de...

and another one of my favorites for this type of scenario:

Errant Architectures by Martin Fowler
http://www.sdmagazine.com/documents/s=7897/sdm0304a/sdm0304a.htm?temp=...

Good luck.

Thanks,

Sam

--
_______________________________
Sam Santiago
ssantiago@n0spam-SoftiTechture.com
http://www.SoftiTe...
_______________________________
"Brian Fung" <bfung25@hotmail.com> wrote in message
news:e0d644.0410131239.21503508@posting.google.com...
> Hello All,
>
> I've been given the task to redesign a .NET application. The idea is
> to have all the the business objects on a remote server, which can be
> access by .net remoting by several websites.
>
> My question is a design question (and basic understanding :):)). I
> designed my classes to be a container of information. What that means
> is the class will have properties and several overloaded constructors
> with parameters. The constructors contain methods that populate the
> properties depending on the values of the parameters. So what I want
> is the ASPX pages from my website to use .net remoting and create a
> new instance of a remote object and access the instance's properties
> and methods. In other words, use it like a regular instance of a
> class.
>
> After reading several sources and scanning the newsgroup, I decided
> that CAO will be the way to go since I need to pass parameters to the
> constructors. But the impression I get from all the .net remoting
> examples (whether CAO or SAO) is that they only call methods from a
> remote class. So in other words, you don't really use the remote class
> as a container of data, but as a vehicle to call a method remotely.
>
> In other words, am I using .net remoting the wrong way?
>
> Thanks in advance,
>
> Brian
>
> P.S. If you require more detail, please let me know.


Ariel Popovsky

10/27/2004 7:58:00 PM

0

Hello Brian,

Perhaps you don´t need to use CAO, if your business objects are just data containers you can call a method on a SAO object (the data access layer) that creates the instance of a serializable BO and returns it to the caller.

-----
Ariel Popovsky


> Hello All,
>
> I've been given the task to redesign a .NET application. The idea is
> to have all the the business objects on a remote server, which can be
> access by .net remoting by several websites.
>
> My question is a design question (and basic understanding :):)). I
> designed my classes to be a container of information. What that means
> is the class will have properties and several overloaded constructors
> with parameters. The constructors contain methods that populate the
> properties depending on the values of the parameters. So what I want
> is the ASPX pages from my website to use .net remoting and create a
> new instance of a remote object and access the instance's properties
> and methods. In other words, use it like a regular instance of a
> class.
>
> After reading several sources and scanning the newsgroup, I decided
> that CAO will be the way to go since I need to pass parameters to the
> constructors. But the impression I get from all the .net remoting
> examples (whether CAO or SAO) is that they only call methods from a
> remote class. So in other words, you don't really use the remote class
> as a container of data, but as a vehicle to call a method remotely.
>
> In other words, am I using .net remoting the wrong way?
>
> Thanks in advance,
>
> Brian
>
> P.S. If you require more detail, please let me know.
>