Code cloning
One of the most well-known anti-patterns is code cloning. Code cloning means copying code or a part of the code in order to reuse it. When learning object-oriented programming (OOP), it is good to try to avoid this at almost any cost, whereas in Microsoft Dynamics NAV, we have sales people telling customers how easy it is to copy something in NAV and customize it. Dynamics NAV itself is full of code cloning. How can this add up to being good?
Well, some of it does not add up, but some of it also needs to be put into perspective.
In order to put it into perspective, we will divide code cloning into four subtypes. This will enable us to justify some instances of code cloning in Dynamics NAV, and allow us to focus on what parts should be addressed first.
Forking
When forking is applied, we create a new application by creating a copy of an existing application, and let it grow organically from there.
Templating
If we reuse objects because they behave just as we need...