Managing DLL
Before Microsoft introduced dot net, we had automation control of the DLL files. These DLL files needed to be registered on each machine. This is what people refer to as DLL Hell.
In the case of Microsoft Dynamics NAV, we refer to DLL Hell in a different way.
The challenge of using DLL in Dynamics NAV, whether it is an automation control DLL or a custom made .NET DLL, is that the compiler checks the references. This screenshot shows the error message in the case of a missing DLL reference:
Since it cannot be expected that every developer has every customer's DLLs installed, it is considered best practice to wrap DLL in a one-to-one Codeunit. Each function in DLL gets a function in the wrapper Codeunit.
Instead of calling DLL directly as a variable, we will use the wrapper Codeunit. This enables developers to change the code without having the DLL installed.
This can potentially also be interpreted as an adaptor or a Façade.
The following screenshot illustrates creating...