开发者

What is the proper location for libraries in an ASP.NET MVC project?

If I create a custom routing class, what's the typical convention for where it's located in an ASP.NE开发者_JS百科T MVC project?

(Note that these are not domain-specific libraries as they are implementations of ASP.NET MVC's interfaces to hook the lifecycle.)


For me, best place for those kind of classes is kind of separate Infrastructure-named project. Those Infrastructure-projects contain general helper libraries. Web knows about Infrastructure, but not vice-versa. Even Microsoft has that kind of naming convention. Namespace for custom route class may be *.Web.Infrastructure.Routing


I preder to keep them in a separate project with folder for every kind. For example for an MVC projects I usually do:

 MyCompany.MyApp.Web.MVC

and then the helpers

MyCompany.MyApp.Web.MVC.Helpers
          AttributeHelpers
          RoutingHelpers
          HtmlHelpers
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜