Answered by:
exe vs dll

Question
-
I am working on a Solution with 10 Projects (so far).For 2 of the Projects I took the 'heavy' code and moved
it to dll's once it was stable. The Screen and minimal
code remained as Projects.My goal was to speed-up the Builds (and it did).
Now I'm about to repeat the process with 2 more Projects,
But, I'm wondering if that's the best way, or:Should I place the entire Project in a dll
Or should I move each Project to it's own Solution
and refer to the exe
Or, leave everything in the Project?(Can, you tell ... I'm a newbie to VS and just hacking my
way around to learn)Friday, August 18, 2006 3:01 PM
Answers
-
Typically you build exe's for the capability to be a standalone program....DLL's on the other hand are typically compiled to share code across applications and projects or to further organize and isolate common code
HTH
Friday, August 18, 2006 4:59 PM -
DLL's are a useful way to breakout common code that you want to re-use in other applications or other parts of you application.
So an example may be you have some specific string handling functions which you have written which you want to use in all your applications - rather than cut/paste the code into you appliction you would create a class library, put the code into this class library and then create a dll. In all your applications you can then simply reference the dll and use the functionality.
This may contains methods, classes, Constants, but basically it is stuff you want to reuse in different project.
So the idea is that if the code is something you want to reuse in more than one project - it may be a candidate for putting into a class library. If it is something that is specific to that one application and will never be reused anywhere else then leave it contained within the Exe project. You basically decide when its applicable.
The builds will be sped up because you dont have to recompile the dll's each time you build the project - but you loose the flexibility to modify these items contained in the dll's during you development as you only have the executable dll and not the source code available at deelopment time. Again if the are well tried and tested routines which work and you arent going to make many changes to them then compiling them to class libraries and using the dll reference is fine.
So I cant tell you if you should do this for you current circumstances, it may or may not be appropriate depending upon what you are putting into them and at what stage of the development process you are at with them.
Friday, August 18, 2006 5:08 PM
All replies
-
Typically you build exe's for the capability to be a standalone program....DLL's on the other hand are typically compiled to share code across applications and projects or to further organize and isolate common code
HTH
Friday, August 18, 2006 4:59 PM -
DLL's are a useful way to breakout common code that you want to re-use in other applications or other parts of you application.
So an example may be you have some specific string handling functions which you have written which you want to use in all your applications - rather than cut/paste the code into you appliction you would create a class library, put the code into this class library and then create a dll. In all your applications you can then simply reference the dll and use the functionality.
This may contains methods, classes, Constants, but basically it is stuff you want to reuse in different project.
So the idea is that if the code is something you want to reuse in more than one project - it may be a candidate for putting into a class library. If it is something that is specific to that one application and will never be reused anywhere else then leave it contained within the Exe project. You basically decide when its applicable.
The builds will be sped up because you dont have to recompile the dll's each time you build the project - but you loose the flexibility to modify these items contained in the dll's during you development as you only have the executable dll and not the source code available at deelopment time. Again if the are well tried and tested routines which work and you arent going to make many changes to them then compiling them to class libraries and using the dll reference is fine.
So I cant tell you if you should do this for you current circumstances, it may or may not be appropriate depending upon what you are putting into them and at what stage of the development process you are at with them.
Friday, August 18, 2006 5:08 PM