alguidelines/content/docs/NAVPatterns/3-cal-coding-guidelines/design/class-coupling/index.md
2022-02-24 14:45:35 +01:00

20 lines
574 B
Markdown

+++
title = "Class Coupling"
weight = 320
tags = ["C/AL"]
categories = ["Best Practice"]
+++
Do not write functions that have high class coupling. This makes the code hard to maintain.
Bad code
Any procedure / trigger that has class coupling of > 30
Good code
Any procedure / trigger that has class coupling of <= 30\.
Class coupling is computed by summing the unique instances of the following in a code block:
- every unique usage of a complex C/AL data type (table, codeunit, etc) as 1\.
- every unique usage of a DotNet type as 1\.