简体   繁体   中英

How to organize web service in ASP .NET Web API

This is a theoric question about how to organize web service.

Building a web service using ASP.NET Web API you can create a lot of controllers and web methods inside them. However, maintaining many controllers and methods in the same solution can be hard. What are the criteria that shuold be used in order to choose to split a solution in two or more? What advantages and disadvantages derives from using a single solution with many methods and controllers and the advantages and disadvantages of using many solutions ?

I guess first question will be: what is the number are you talking about with "a lot of controllers"? The main disadvantage I see when dealing with huge solution is load (CPU? RAM, Resharper caching). I do remember I had a solution of 54 project and it building takes over 3 minute. So we had to extract one small solution for development and full solution was loading only on integration of our part. (Well SSD probably helps here)

But also it is semantics. The best way on my opinion is making separation based on complete blocks for example you extract interface and then it implementation goes to another solution or project.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM