Nafees Hassan wrote
By user, I mean another Delphi programmer. […] And I'm only targeting Delphi, I don't need to support other languages.
Then, this is not a problem at all.
The solution is: develop and use runtime packages instead of DLLs:
http://docwiki.embarcadero.com/RADStudio/Seattle/en/Libraries_and_Packages_Index[
^],
http://docwiki.embarcadero.com/RADStudio/Seattle/en/Packages[
^],
http://docwiki.embarcadero.com/RADStudio/Seattle/en/Writing_Dynamically_Loaded_Libraries[
^],
http://edn.embarcadero.com/article/27178[
^].
You can consider this type of units as a specialized form of PE (DLL), "a DLL for Delphi". They allow to distribute code between those units freely, as it was in one executable file. In other words, all constructs, including classes can be "imported" or "exported". You use ordinary Delphi Pascal syntax. The boundaries between runtime packages are quite transparent.
Not that runtime packages as a are roughly equivalent to .NET
assemblies, but not really equivalent in terms of their roles and development technology. In .NET, an assembly is usually the only
compilation unit; even though each can have more than one
module, multiple-module assemblies are not popular at all, and Visual Studio does not support them directly. In Delphi, there are two levels of library units:
unit
is a separate compilation unit, a main encapsulation device, and several units can make a single executable module, which can be application, DLL, or the runtime package, so a package can be considered as a higher-level unit and can be re-used "at Delphi level".
—SA