Resources - Creating and Maintaining Master and Dependent Projects
A new feature in Doc-O-Matic 6 Professional is the ability to inherit all settings from another project by defining a master project. When a master project is used, a project only saves settings that that are different to the master project's setup. This article explains how to setup a master-dependent project hierarchy successfully.
Step 1: Creating a Master Project
The first step is to create the master project. The project defines all properties of a project that should be the same in all dependent projects. Lets call this project Master.dox.
You can make changes to the master project later as well, those changes will affect all dependent projects automatically. You only need to be careful with the order in which you load and save projects.
Step 2: Creating a Dependent Project
Now we go ahead an create a dependent project. We can do that using this procedure:
- Load Master.dox into Doc-O-Matic and make sure it's the only Doc-O-Matic instance with that project open.
- Go to general settings page [General Settings]->General->Master Project and set the Master Project File to the Master.dox we just saved in step 1.
- Save the project as Dependent.dox.
When you look at the file size of Dependent.dox you will see that it's a few bytes only. That is because it does not store any settings because Master.dox and Dependent.dox have exactly the same settings.
How does it work?
When saving a dependent project, Doc-O-Matic saves only those settings that are different to the master project. Every last setting of a project can be inherited from master to dependent project. From options in the Settings View to source files and output configuration, just everything.
When loading a dependent project, Doc-O-Matic merges the settings in the master projects with those in the dependent project. The end result of that merging process is loaded.
Avoiding Trouble
The number one rule when working with master and dependent projects is not to have both Master.dox and Dependent.dox open at the same time.
The reason for this is simple. The differential building process happens when saving and loading the dependent project. If you have unsaved changes in Master.dox at the time when Dependent.dox is saved, the differential is not what you may think it is. Dependent.dox will be a differential saved relative to the current Master.dox file, not the project that is currently open and probably changed.
You can easily avoid trouble like that by never having both projects open at the same time. You can have multiple dependent projects open without problems, but never work on master and dependent simultaneously.
Which Project do I use When Changing Settings?
It's dead easy really:
Whenever you make changes to the project setup that should affect all dependent projects, make them in Master.dox.
When you make changes that should not affect all projects, make them in Dependent.dox. And remember, don't have Master.dox open when you make those changes.