Reputation: 132974
I am not an experienced .Net programmer, hence this question.
Is it a terribly bad idea to put each (major) class in a separate assembly, so that whichever class's implementation I choose to change the executable need not be recompiled? Or does my idea imply serious performance issues due to runtime loading etc.?
I know the question is vague, but maybe there are specific guidelines as to what should be put in a separate assembly and what genereally shouldn't
Thanks in advance
Upvotes: 3
Views: 1547
Reputation: 583
If all of these classes you are talking about are doing different jobs and also can be seperated by the business they are doing then, putting each of them to seperate assembly is acceptable I suppose. However you also should be careful about this issue, else your applications might turn into a DLL hell!
Upvotes: 0
Reputation: 1445
It is a very bad idea.
You need to put things in separate assemblies if you plan to redistribute them (install them to your end-users) as separate components. I'll bet that is not your scenario.
examples where you might split to assemblies:
clock.exe
and facebookAlbumViewer.exe
MyProgramDataModel.dll
, MyProgramBusinessLogic.dll
and MyProgramGui.exe
in the future you ship a new MyProgramDataModel.dll
(that now works with Oracle instead of MySql), so you deploy only that component. It will only make sense on big and complicated software.Upvotes: 4
Reputation: 41983
You talk about client software. A decent-sized project with a few hundred classes -> a few hundred DLLs is not acceptable for client software and this is not common practice.
Assemblies just aren't that big to worry about it. With a DLL per class you'll be exposing all of your code structure - MyApp.dll, MyApp.MainForm.dll, MyApp.DatabaseLogic.UserAuthentication.dll -
Upvotes: 4
Reputation: 174289
It's not a good idea. Put concerns together in one assembly. But not a single class per assembly. If you change two classes, you need to ship two assemblies instead of one. What have you won?
Upvotes: 5
Reputation: 17274
How much time will you save on compilation? How much time will you spend on adding a new project for each class?
Do not waste your time, let compiler do his job. Your time worth more than compiler's.
Upvotes: 2