Re: Instance vs Static + Option

Peter Obiefuna <[email protected]> Fri, 9 May 2008 08:44:03 -0600
Newsgroups gmane.comp.windows.devel.dotnet.clr
Message-ID <[email protected]>
I would write one static helper class and pass the control/test value as a
parameter.


public static string SayHello(string message, Environment environment){
    if (environment == Environment.Control){
        return string.Format("Hello {0} from Control", message);
    }
    return string.Format("Hello {0} from Test", message);
}

--------------------------------------------------
From: "Brady Kelly" <[email protected]>
Sent: Wednesday, May 07, 2008 6:39 AM
To: <[email protected]>
Subject: [DOTNET-CLR] Instance vs Static + Option

> I am busy with a new ConfigHelper class, and can't seem to decide on which
> approach to take.  The class is responsible for adjusting the config table
> in two databases, control and test.  My dilemma is whether I make
> ConfigHelper a static class, and tell it which database to access for each
> task, or use instance methods and have one instance for each database.
>
>
> ===================================
> This list is hosted by DevelopMentorĀ®  http://www.develop.com
>
> View archives and manage your subscription(s) at
> http://discuss.develop.com
>

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com