开发者

Where do you put classes that are neither Controllers, Models, Helpers or ViewModels?

开发者 https://www.devze.com 2022-12-09 14:41 出处:网络
In an ASP.NET MV开发者_JAVA百科C application, what do you do when you have unique classes that aren\'t controllers, helpers or view-models?

In an ASP.NET MV开发者_JAVA百科C application, what do you do when you have unique classes that aren't controllers, helpers or view-models?

For example, say you have a class of utilities that are useful for processing map/location data.

These utilities may be used by more than one controller.

Would you create a top-level folder/namespace for them and call it 'Maps' or something?


Maybe a new top-level folder and namespace called Utilities, and add your utility classes here: ProjectName.Utilities.MapUtility

If you have a lot of utility type classes, consider moving them into their own separate project.


I think a namespace named util will work here.

project.name.space.util project.name.space.domain.util

things like that.

I've seen this util domain usage a lot in the apache projects and in other areas as well so it's not a java or .net specific nomenclature.

0

精彩评论

暂无评论...
验证码 换一张
取 消