Book Image

Learning Dynamics NAV Patterns

By : Marije Brummel
Book Image

Learning Dynamics NAV Patterns

By: Marije Brummel

Overview of this book

Microsoft Dynamics NAV is a complete ERP system, which also contains a robust set of development tools to support customization and enhancement. These include an object designer for each of the seven application object types, a business application-oriented programming language with .NET interface capability, a compiler, a debugger, and programming testing language support. Learning Dynamics NAV Patterns will guide you through the NAV way of solving problems. This book will first introduce you to patterns and the software architecture of the NAV and then help you to build an example application. Then, it walks you through the details of architectural patterns, design patterns, and implementation patterns. This book will also talk about anti-patterns and handling legacy code. Finally, it teaches you to build solutions using patterns. Proven patterns and best practices will help you create better solutions that are easy to maintain in larger teams across several locations. It will guide you through combining abstract patterns using easy-to-understand examples and will help you decide which patterns to use in which scenarios.
Table of Contents (9 chapters)
8
Thank you for buying Learning Dynamics NAV Patterns

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.