Probably the second one. If you do go the remoting route, best practice is
to make a façade class over your real class. The façade class would look
like the first class, so you could alter the first class (the façade) to
make calls to the second class (the nice OO implementation).


Richard

> -----Original Message-----
> From: The DOTNET list will be retired 7/1/02
> [mailto:[EMAIL PROTECTED]]On Behalf Of Jade Martin
> Sent: 22 June 2002 20:35
> To: [EMAIL PROTECTED]
> Subject: [DOTNET] Class Design Question
>
>
> I am wondering the best way to code a class. This class may be used in
> remoting. Should I use property procedures for the setup parameters or
> should I use function overloading? The first example would be faster and
> less code but the second example would be easier to read in the client.
> Are property procedures every a good idea when a class may be used for
> remoting?
>
> example:
>
>      public class Test
>      {
>           private bool param1=false;
>    private bool param2=false;
>    private bool param3=false;
>
>    public Test(bool Param1,
>                       bool Param2)
>    {
>         param1 = Param1;
>         param2 = Param2;
>         DoIt();
>    }
>
>    public Test(bool Param1,
>                       bool Param2,
>                       bool Param3)
>    {
>         param1 = Param1;
>         param2 = Param2;
>         param3 = Param3;
>         DoIt();
>    }
>
>    private void DoIt()
>    {
>                // write code based on params
>    }
>
>      }
>
> or
>
>      public class Test
>      {
>           private bool param1;
>    private bool param2;
>    private bool param3;
>
>    public bool Param1
>    {
>                get
>                {
>              return param1;
>         }
>         set
>         {
>              param1 = value;
>         }
>    }
>    public bool Param2
>    {
>         get
>                {
>              return param2;
>         }
>         set
>         {
>              param2 = value;
>         }
>    }
>    public bool Param3
>    {
>         get
>         {
>              return param3;
>         }
>         set
>         {
>              param3 = value;
>                }
>           }
>
>    public Test()
>    {
>                // write code based on params
>    }
>
>      }
>
> You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
> subscribe to other DevelopMentor lists at http://discuss.develop.com.

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to