"Helper class" is just a term to refer to a class that provides methods that
"help" do something. A well - know example is the Data Access Application
Blocks v2 "SqlHelper" class, which helps perform common data access functions.
It collects them together. Often you can't add methods to a class
itself, because you don't have the code - I can't add the Reverse
method to string, for example.
If you're going to frequently do the same things with an instance of a
class, it's worth putting that somewhere rather than repeating the
code.
Another example is in my miscellaneous utility library
(http://pobox.com/~skeet/csharp/miscutil) - I've got a helper class for
working with streams. It has a set of methods to copy the contents of
one stream to another, and another set to read the complete contents of
a stream as a byte array.
It collects them together. Often you can't add methods to a class
itself, because you don't have the code - I can't add the Reverse
method to string, for example.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.