Managing Big Module Projects

BlitzMax Forums/BlitzMax Programming/Managing Big Module Projects

rdodson41(Posted 2005) [#1]
I am working on a module, and I have a bunch of different parts to it, and to keep it organized, I wanted to have a main file, and then all the different parts in sepperate files for organization. This seems that it would work, but these parts include types and functions from the main file and/or other parts. How would I manage a big project like this short of putting everything in one file?


Bot Builder(Posted 2005) [#2]
Checkout Include. This works like the old include of b3d/b+ - direct source inclusion. Bmax's import command require's tree-like dependancy (no loops).

Include "cool file.bmx"


ImaginaryHuman(Posted 2005) [#3]
Yeah, use Include instead of Import. It's simpler. You just include all the files from within the main file and then when you build the main file everything gets joined together as one big sourcecode and compiled. Then all your data and variables and functions etc are accessible to the whole sourcecode like they would be in a single program file.


rdodson41(Posted 2005) [#4]
This seems to work fine, but it doesn't document the commands and keywords I have. Each part has its own documented functions, and then there is a keyword file just for keywords. How can I get it to document all of this?


AntonyWells(Posted 2005) [#5]
create another mod folder, and have each section a module within it.

i.e, apple.mod\core.mod\core.bmx apple.mod\helper.mod\helper.bmx

and wheneever(Only when.) a module requires a type/global from another part of the overall framework, import it.

Import Apple.Core for example.


rdodson41(Posted 2005) [#6]
But see, its like this: My main type in my main file has variables of types that are defined in other sections. These other types are extensions of the main type, and im organizing it so that each extension has any corresponding functions in the same file.
'***MAIN***'
Type maintype
   Field thing:atype
   Field thang:btype
EndType

'***PART1***'
Type atype Extends maintype
   Field a,b,c
EndType

Function NewAType()
   'blah blah
EndFunction

'***PART2***'
Type btype Extends maintype
   Field x,y,z
EndType

Function NewBType()
   'blah blah
EndFunction


maintype is in the main source file with Module/ModuleInfo etc. And parts A and B are in two other files. But the main needs types from parts a and b, and types a and b extend maintype. Include works, but it doesn't document the commands and keywords. It's not a huge problem and I can deal without it, but I would like to have my commands documented.


AntonyWells(Posted 2005) [#7]
I take it the above is just an example of your situration and nothing specific? It's hard I know, I went through similar problems as you did. Started off as includes, went to mods, went back to includes agin then finally settled on mods.

Generally, you'd just include a header file in C++ when this situration arises. It is strangely missing from Bmax however.
So my advice is to try to redesign the code in question(What I had to do.) or stay as you are. Can't think of a better alternative anyway.