D
Dan Bass
while working in a probject, you realise that some string handling stuff
you're implementing has occurred before in the same project. So being a good
developer, you factorise the commonalities out and into some "StringMethods"
type class...
Would you:
- create this object and use that instance each time to access the methods
you need
- use a singleton structure, so that only one instance is ever created
- use public statics, so that you never need to create a host instance in
the first place
Would the same principle apply to global constants?
I've been using public statics since the move to c# and wondered if this was
the best approach.
Thanks for your time.
Daniel.
you're implementing has occurred before in the same project. So being a good
developer, you factorise the commonalities out and into some "StringMethods"
type class...
Would you:
- create this object and use that instance each time to access the methods
you need
- use a singleton structure, so that only one instance is ever created
- use public statics, so that you never need to create a host instance in
the first place
Would the same principle apply to global constants?
I've been using public statics since the move to c# and wondered if this was
the best approach.
Thanks for your time.
Daniel.