[英]Visual Studio solution/projects organization
Let's say that you re creating a complex back-end system. 假设您正在创建一个复杂的后端系统。 Somewhere in the system, you have an IQueue interface.
在系统的某个地方,您有一个IQueue接口。 You are planning to have several implementations for the queue:
您计划为队列实现多个实现:
Obviously, each implementation will require it's own class and implementation. 显然,每个实现都需要它自己的类和实现。 Each implementation will probably need different references (Database will require the DLLs to communicate with the relevant database, Amazon SQS will require the Amazon AWS DLLs, etc.)
每个实现可能需要不同的引用(数据库将要求DLL与相关数据库通信,Amazon SQS将需要Amazon AWS DLL等)
How would you organize the solution for such a scenario? 您将如何组织此类方案的解决方案?
Assuming the interface and the naive implementation are places in the project where the queue is used, I see the following possible options: 假设接口和朴素实现是项目中使用队列的位置,我看到以下可能的选项:
In my opinion, going the first route you listed with a separate Visual Studio project for each implementation is the better one, for the reasons you have listed. 在我看来,出于你列出的原因,为每个实现进行单独的Visual Studio项目列出的第一条路线是更好的路线。 It also has the added benefit of being able to add implementations as you go along without have to replace binaries, which is kinda nice.
它还有一个额外的好处,即能够随时添加实现而无需替换二进制文件,这有点好。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.