-2

I have the following code files in my solution:

  1. The configuration is stored in a json file.
  2. The shape of the data (model) is defined as a sealed class.
  3. The configuration has to be read and parsed from the json file and stored into a public static class, so that it is available for use at run time.
  4. A few helper libraries needing access to configuration data.
  5. A few console programs making use of these libraries.

How should I organize the code into individual projects. Currently the console programs and rest of the files combined are stored as separate projects. Specifically, should the model of the configuration data and public static class holding runtime configuration, and parsing of json be an independent DLL?

jujiro
  • 190
  • 1
  • 1
  • 11
  • Why in different dll. Have different classes. – ilansch May 03 '17 at 19:23
  • I think this is too opinion-based. How you should do something doesn't have a clear answer. –  May 03 '17 at 19:25
  • maybe ask on the programmer stackexchange site? – Fredou May 03 '17 at 19:27
  • @Fredou i was thinking either that or software engineering SE. But I'm not active on either community, and don't know which would fit better. –  May 03 '17 at 19:28
  • @Amy hmm i can't find programmer one to read the "about" so yeah it should be asked on https://softwareengineering.stackexchange.com/tour one – Fredou May 03 '17 at 19:32
  • Why do you want to “organize the code into individual projects”? [What problem does that solve](https://meta.stackexchange.com/questions/66377/)? – Dour High Arch May 03 '17 at 19:33
  • @Fredou The Software Engineering site *is* the Programmers site. "Programmers" was the original name, and it was renamed. – Tanner Swett May 04 '17 at 04:31
  • @TannerSwett ahhh, that clears things up, thanks. –  May 04 '17 at 13:58

1 Answers1

2

There are very few reasons to separate code into multiple dll's, and odds are good you don't meet any of these reasons. Separation of concerns refers specifically to logical separation, and in the .Net world this is achieved via classes and namespaces. You can use the folders in your project to automatically assign the namespaces of the classes in them.

You are better off having only 1 project per executable and 1 project for all your business logic.

Here are a few reasons why you'd want to create multiple dlls':

  • Redistribution and copyright issues: You wouldn't want your customers to own server code. Create separate dll for client and server code.
  • Performance: if your dll starts bordering the dozens of megs, you may get some performance gains by splitting it up. (as with all performance concerns, you must first test and analyze performance bottlenecks before you implement any performance code).
  • Versioning and deployment: If you have a very large code base, and you know some of the code is more likely to change than other, you can split dll's in order to not have to deploy more "sluggish" dll's every time.
Guillaume CR
  • 3,006
  • 1
  • 19
  • 31