Monday 16 March 2015

Best Practice for Development


Best Practices for Developers:

1.     Variable or constant or parameter declarations should be as local as possible to utilize memory resources in an efficient way.

2.     Unused variables, methods, and classes should be removed from the code.

3.     The re-usability should be maximized. E.g. rather than repeating lines of code at different places, a single method can be written so that changes in the method can be reflected at all the places where this method is used.

4.     A method should perform a single well-defined task and be named according to the task performed.

5.     All the text used in Dynamics AX is supposed to be in a label 

6.     A try or catch deadlock or retry loop should always be created around database transactions that can cause deadlocks.

7.     Prefer switch statement rather than multiple if-else statements.

8.     Remove commented code before shipping code.

9.     Follow indentation rules.

10. Follow case rules for naming classes, methods, tables, etc.

11. Methods should perform a single well defined task and from their name the task performed should be clear.

12. To ensure trustworthiness, appropriate access levels (public, private, or protected) should be assigned.

13. Parameter's names must start with an underscore (_) character besides following other generalized naming conventions.

14. Date conversion should be avoided as it will loose date properties and hence sometimes conversion may result in wrong information. 

Table:
1.     The table name may consist of the following valuable information
2.     Prefix: Module name such as Cust for Account Payable, Sales for Account Receivables
3.     Infix: Logical description of the content
4.     Post fix: Type of data e.g. Trans (for transactions), Jour (Journals), Line (table containing detailed information about a particular record in header table), Table (primary main tables), Group, Parameters, Setup, or module name to which the table belongs
5.     Label is a mandatory property and tables must be labelled using Label ID only. The text value of Label ID must be unique in all languages supported.
6.     If a table belongs to one of the four types Parameter, Group, Main, or WorksheetHeader, then it must have an associated form to maintain the table records. This form should have a name identical to its display menu item (used to start this form) and like the table name. formRef is the property of a table for the name of the associated form.
7.     Title Field 1 and Title Field 2 should be mentioned
8.     TitleField1: The key field for the records in the table. This should be a descriptive title, if the key is information for the user.
9.     TitleField2: The description for the records in the table.




https://msdn.microsoft.com/en-us/library/aa658028.aspx

No comments:

Post a Comment