Re: What is the best way to handle standard functions used everywhere
From: Bruno Jouhier [MVP] (bjouhier_at_club-internet.fr)
Date: 02/05/04
- Next message: Vasil Buraliev: "Re: huge memory useage"
- Previous message: Don Dumitru [MSFT]: "Re: "object" or "Object" whats the difference"
- In reply to: Gee: "What is the best way to handle standard functions used everywhere"
- Next in thread: Michael Culley: "Re: What is the best way to handle standard functions used everywhere"
- Reply: Michael Culley: "Re: What is the best way to handle standard functions used everywhere"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 5 Feb 2004 08:22:07 +0100
You should create a "helper" class with static methods. Good practice is to
name all these classes XxxHelper, for example MyStringHelper ... Helper
classes should only contain static methods and should never be instanciated,
so it is a good idea to add a private constructor (and no other
constructor), so that you get a compile error if you try to instanciate it
by mistake.
Bruno.
"Gee" <someone@microsoft.com> a écrit dans le message de
news:eLqeef46DHA.2952@TK2MSFTNGP09.phx.gbl...
> I'm new to csharp and in other languages I used I have had a standard set
of
> useful function like QuoteString DeQuoteString which are used all over the
> place. Creating a class everything I want to use it seems like lots of
extra
> typing.
>
> The options I see are (Some may not be possible)
> 1. Create a class inherited from string and use that for my strings,
> 2. Use Static methods
> 3. Create a class every time
>
>
- Next message: Vasil Buraliev: "Re: huge memory useage"
- Previous message: Don Dumitru [MSFT]: "Re: "object" or "Object" whats the difference"
- In reply to: Gee: "What is the best way to handle standard functions used everywhere"
- Next in thread: Michael Culley: "Re: What is the best way to handle standard functions used everywhere"
- Reply: Michael Culley: "Re: What is the best way to handle standard functions used everywhere"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|