Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Packaging Styles

Status
Not open for further replies.

MikeCopeland

Programmer
May 21, 2007
91
US
I'm wondering about the pros & cons of building applications (in VC++6.0) with many modules versus few modules. I've noticed that when I use many modules, the size of my executables increases; combining modules into a single source module produces much smaller executables.
I know that there is a (perceived) design benefit to building applications with a modular approach (and I don't deny the value of having common code/logic in separate source modules), but I find the maintenance of code in many sources tedious and cumbersome - particularly when none of the logic is shared with other applications. I also know that Visual Studio provides a search facility...but the global nature of its search (subfolder scanning) often produces a vast list of "hits" that's difficult to work with.
So, assuming that I'm willing to construct my applications in a "minimally modular" way, what am I sacrificing (in terms of program or data size, etc.) by merging some of my application-specific source code into my "main module"? Is there a limit of how much code can be in a specific module, or are there data declaration constraints to be experienced by putting all the data there, too? TIA
 
I've noticed that when I use many modules, the size of my executables increases; combining modules into a single source module produces much smaller executables.
I have never seen this effect (in any case for release modules). IMHO, it's impossible (if you don't have too many (for reasonable design) cross-links all-to-all;).

Of course, it's a matter of taste (and your corporate coding standards;), but a proper module structure depends on class relationship and a code reusing prospects. I think it never depends on minimal executable module size.

May be one class/one module approach is extreme but it is a stone's throw away (see also one use case/one module approach).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top