Net where is utility




















Great organization! However I forgot to add that I use these classes in my DataRepository or DAL , since the person who created the database that provides data for the application, stored all the dates as string.

Does your organization apply in this case as well? Call it Common put everything in there. Then use namespaces like these examples Common.

Formatters Common. Functions Common. Foo Common. Doug Chamberlain Doug Chamberlain I thought also about that but since we are more people working on the same project, I would like to have a strong and clear naming structure, in order to have a clear separation of concerns between folders, beside namespaces — CiccioMiami.

M4N M4N Thanks, it was also my first thought but since I think many developers found themselves in my same situation I wanted to have more opinions about any standard or best practice that applies to this — CiccioMiami. Community Bot 1 1 1 silver badge. Chris Goodman Chris Goodman 2 2 silver badges 10 10 bronze badges. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password.

Post as a guest Name. Email Required, but never shown. The Overflow Blog. Does ES6 make JavaScript frameworks obsolete? Podcast Do polyglots have an edge when it comes to mastering programming Featured on Meta.

Now live: A fully responsive profile. Become an Energy Marketer. This is a private network of Energy Marketers. A different opportunity for municipalities, cooperatives and entrepreneurs to create a new profitable venture in your local community.

Become a Marketing Associate. A commitment to social and environmental change. Dedicated to supporting communities across the province. The continued support from our customers makes this possible. Together we can make a difference. Investing in PV Solar. It is time to help "Light-up-Alberta" with a green energy solution. Contact your local Energy Marketer to learn more. Message to Alberta Industrials. Buying electricity directly off of the grid at a wholesale cost will help you lower your operating costs.

Think differently and become your own retailer for your own business. Learn more. NET Ask Question. Asked 8 years, 2 months ago. Active 2 years, 1 month ago. Viewed 24k times. Improve this question. Why would create utility classes in any type of project? Why is MVC singled out in your question? Well I was wondering about MVC because it in a way forces structure. And as far as utility, I was under the impression everyone used them : If I have an email sender code, and I split it into it's separate class to work with various parts of the system, isn't that a utility class or am I confused?

I thought utility classes were once reusable in any program that aren't tied into the code — user I would personally consider email sending a service, abstracted by say the interface IUserNotificationSender or so..

Max so what would be considered a utility function? I'm trying to understand, as it seems to me I'm very confused — user Well, a proper utility function in my mind is a very small function with a very defined scope and no external dependencies Such as a function to remove whitespace, or trim a string, or get the nth element of a collection Add a comment.

Active Oldest Votes. You don't. And your own example is a perfect one to show why not. Improve this answer. Arseni Mourzenko Arseni Mourzenko k 31 31 gold badges silver badges bronze badges. Hi MainMa, so if I understand correctly it's proper to still make a say background class with all the piping, and then abstract it with an interface, and pass the interface to the function instead of straight calling from the class as in your first snippet.

It would be difficult to explain the whole subject in a simple comment. What about a truly generic utility function, like a string truncator?

MainMa - sorry, I don't follow. That's along the lines of what I want, yes. But Truncate isn't built into c , so I was wondering if it would make sense to stick that kind of generic utility function in some sort of utilities class.

This answer defines away the problem by noting that in this particular case no util class is necessary.



0コメント

  • 1000 / 1000