Project organization

Every Delphi application is represented by a project file. Here some elementary conventions for project files are laid out.

Only necessary units in project file

A project file can be regarded as any other unit in the sense that it only needs to use units that are needed within the project file. However, the IDE of Delphi somewhat evokes that other units are placed within the project file whenever a new unit is created. Adding unnecessary units to a project should be avoided.


AllUnits.dpr is the only special project within the code base that allows unit references that are not needed by the project. In fact, this project is created and kept up-to-date with references to all units in the code base in order to allow the Delphi IDE to support its refactor tools. Unfortunately the Delphi IDE seems to need a unit to be present in the project file in order for the refactor tools to work properly with that unit.

When adding a unit to the code base using the Delphi IDE one can add it to AllUnits.dpr.