Reputation: 2951
I would like to split my big application in smaller pieces in the IDE. Corrently, I have one project (MainApp.exe) with a lot of files. With so many files, I get sometimes confused where to find the right file to modify.
It would be great, if I could split my application in different parts, e.g. InvoicePart, AnalysisPart, CustomerPart, ReportPart, etc. When compiling the parts should be generate one executable file. That means I don't want to split the running *.exe application in DLLs or runtiume Packages. It should just help me writing code easier.
Is there an elegant way in Delphi XE?
Upvotes: 9
Views: 2557
Reputation: 34949
Organize your source files in folders, like (Invoice, Analysis, etc.)
. Navigate the folders through your Project Manager
menu.
This is a straight forward uncomplicated and flexible approach.
Upvotes: 9
Reputation: 20330
It's easy, but it's far from elegant.
All you have to do is, split the files up into different directories. Say common, invoice analysis etc. Knock up a project for each one, and put the other directories in the search path in project options. However, this is the fastest way to get into a complete mess I've ever seen. You can easily end up with different results depending on what order you build the sub projects in.
First which project should each file be in?
How will you stop having one file in more than one project.
Are you going to have a common folder for dcu files, several or none?
How do you know said object file has been compiled in the project that "owned" it? Object file out of step with the code is classic head scratcher.
If you use integrated source control how do you know everything relevant is up to date?
You could use a program group to keep all of them in sync, but that doesn't solve many of the other problems.
Basically if your single project has got so big you have this problem, you've totally lost control of it. The above will not regain control it will simply make it less obvious that you are in a tip.
Use dlls, it's what they are for. I know it won't be easy and it will cost you, but there's the right way to do it, your current mess, and your proposed mess. Bite the bullet and do it properly or leave it alone would be the only options I would choose from.
We ended up where you are proposing to go, it's not a happy place to be.
Upvotes: 0