Reputation: 63126
With more and more projects under my belt I find that I am often repeating many common tasks from project to project, client to client. So I have started to assemble a "utility" library, a collection of these common elements that are often repeated from project to project.
So far I have utilities to resize images, export data grids to excel, send e-mails, and replace tokenized messages.
If you were building/using a .NET utility class library, what types of processes would you see as helpful? What namespaces/groups would you envision?
Update
I am talking about an actual class library, separated into namespaces to group common elements.
Upvotes: 4
Views: 3038
Reputation: 91825
Upvotes: 5
Reputation: 1290
I'd suggest that instead of a "utility" library just make domain specific (graphics, authentication, validation, etc) libraries and only include them where they are needed. The key of course is decided how specific to be. More specificity is generally better.
Irregardless if it has no domain then you probably don't understand it fully meaning that you should re-evaluate what you are doing and trying to accomplish first.
Also, remember that what is useful in one or two projects may end up only being useful in one or two projects. Adding more classes than necessary only causes maintenance issues down the road.
Upvotes: 1
Reputation: 391336
I have plenty of things in my class library which I share between projects:
Tuple<..>
etc.Set<T>
, Heap<T>
, as well as plenty of utility methods for dealing with various types of collectionsThe class library is added to when I need more stuff.
Upvotes: 1
Reputation: 12216
Though I am just a fledgling developer myself I have found RegEx functions and SQL filters to be quite useful. I also have Merge Replication functionality for MSSQL that has been quite handy for me so far.
Upvotes: 0
Reputation: 74530
Personally, I would put some of this functionality into separate libraries, as "utility" is a rather subjective term, what one person finds helpful is not so helpful to another.
If within the library it was broken up into descriptive namespaces, then I would say that's better (e.g. resize images would be in some sort of .Drawing namespace, or in a .Drawing.dll).
Upvotes: 1