Reusable Bugs

1. April 2015 12:33

Hallo,

ich habe heute einen sehr interessanten und informativen Beitrag auf dem Microsoft Dynamics Team Blog entdeckt:

Microsoft gibt hier wertvolle Tipps, wie man die Applikation verbessern kann.

First example
One example of a reusable bug is to find a heavily used table, like table 36 Sales Header, and observe one of the more important fields of type Option, for example Document Type. The OptionString property has the following value: Quote,Order,Invoice,Credit Memo,Blanket Order,Return Order, which you should update to add one option, for example Transport Order in the beginning.

The main benefit of this reusable bug is that code changed in one place, has impact in multiple sides on the application: document creation and handling, posting etc.

Second Example
Codeunit 1, ApplicationManagement is a good place for creating reusable bugs. A simple INSERT on the RecRef on the first line of OnDatabaseInsert will create a sure and versatile bug that is reusable all over the application. Redundancy on database insertion ensures that data is surely conveyed to the data storage layer, twice.

[...]


Inbesondere die Guidelines für den C/AL Code finde ich sehr wichtig!
Code structure
  • Put everything in one function and only use comments to explain the structure of your code. And don't use functions - because this only complicates things... having to navigate from function to function, and completely lose track of where you are in the business logic.
  • On top of that .. put everything in one codeunit. Because also that will simplify and make your structure more readable.
  • Use Hungarian Notation on your variables, because at any time, you need to know what type, and what context your variable is on.
  • Declare all your functions and variables global, so they are available at any time.


Komplette Liste: http://blogs.msdn.com/b/nav/archive/2015/04/01/reusable-bugs.aspx


VG
dannyt

Re: Reusable Bugs

1. April 2015 12:48

LOL, ist wohl schon wieder 1. April ;)

Re: Reusable Bugs

1. April 2015 13:05

Einen Aprilscherz habe ich 2008 hier auch mal gestartet, und zumindest Marije Brummel ist darauf reingefallen :-) .