Visual Studio 解決方案/項目組織 (Visual Studio solution/projects organization)


問題描述

Visual Studio 解決方案/項目組織 (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. You are planning to have several implementations for the queue:

  • Naive "in‑memory"
  • Database (where the queue is managed in a database)
  • Amazon SQS (using Amazon SQS service in the cloud)
  • MS/Google/Other Queuing service

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.)

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:

  • Separate Visual Studio (and therefore assembly) for each implementation:
    • Pro: Cleaner projects, "single responsibility" at the project level, easier to update specific implementation
    • Con: Many projects, many assemblies to manage/deploy, slower Visual Studio
  • Single project for all "non‑naive" implementations:
    • Pro/Con: exact opposite of first option.

‑‑‑‑‑

參考解法

方法 1:

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. 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.

(by SaguiItayRaptor563)

參考文件

  1. Visual Studio solution/projects organization (CC BY‑SA 3.0/4.0)

#projects #visual-studio #projects-and-solutions #visual-studio-2010






相關問題

Netbeans 運行我所有的項目 (Netbeans runs all my projects)

Cara berbagi konfigurasi antara Dua atau lebih lingkungan TRAC (How To share configurations between Two or more TRAC environments)

Visual Studio 2005安裝程序項目安裝在終端服務器上崩潰 (Visual Studio 2005 Setup project install crashes over Terminal Server)

XCode 項目詳情? (XCode Project Details?)

Visual Studio 2005項目選項 (Visual Studio 2005 Project options)

布朗菲爾德VS格林菲爾德的發展? (Brownfield vs Greenfield development?)

NodeJS 中復雜系統的架構方法 (Architectural approach to complex system in NodeJS)

使用Wiki作為中央開發項目存儲庫 (Using a wiki as a central development project repository)

開發 Web 服務器的技巧 (Tips for developing a web server)

Visual Studio 解決方案/項目組織 (Visual Studio solution/projects organization)

為什麼我的項目在沒有變化的情況下構建? (Why do my projects build when there are no changes?)

如何使用開源項目改進我的 C++ (How to improve my C++ with open source projects)







留言討論