What do we mean by 'patterns'?
Wherever you look in life, you see patterns. Even life itself follows a pattern. Patterns help us in being organized by giving us structure, which makes things easier for us to understand. Without structure, we start being stressed and disorganized.
As this is true for many things in our lives, this is also true in computer programming. Applying structure in our computer programs make them easier to understand and maintain. Each profession has patterns that have proven to be successful in certain conditions, and unsuccessful in other conditions.
Software design patterns
Good old Wikipedia defines software design patterns succinctly as "A general reusable solution to a commonly occurring problem within a given context in software design." By nature, people look for ways to get organized and structured. It is not a surprise that during the 1970s and 1980s people started to look for structures in computer programming, which was a new, fast growing business.
You can read more about the software Design Patterns on Wikipedia at https://en.wikipedia.org/wiki/Software_design_pattern. Software design patterns, especially in object-oriented programming (OOP), gained popularity in the 1990s when after Design Patterns: Elements of Reusable Object-Oriented Software was published by the Gang of Four, Erich Gamma, Chard Helm, Ralph Johnson, and John Vlissides. They published 23 classic software design patterns. Since then, many other patterns have been documented. Many of these were based on object-oriented programming, but people also started to document patterns outside this context.
The Procedural software design patterns
The product that we work with, Microsoft Dynamics NAV, has a programming language that people refer to as Procedural. It was invented in the 1980s and is based on Pascal, which is a very popular programming language that is still loved by many.
In this article, Paul Ford explains the history of code, procedural languages, and object oriented programming at http://www.bloomberg.com/graphics/2015-paul-ford-what-is-code/#b06g24t20w15.
As with everything in life, we seek structure, hence we can apply software design patterns to Procedural languages. We just need to look carefully at all the object-oriented content that is available, and cherry-pick what applies. We can then complete this content with specifics of our language.
Procedural languages preceded the more modern object-oriented languages. One of the challenges that object-oriented programming is trying to solve is grouping things together that belong together. For this, classes are used. In this book, we will attempt to do this as well by treating tables and codeunits as a class, and then grouping functions together accordingly.