Click to Rate and Give Feedback
MSDN
MSDN Library
Microsoft Dynamics
Best Practices
Classes
Classes
Constructors
Collapse All/Expand All Collapse All
Microsoft Dynamics AX 2012
Best Practices for Constructors [AX 2012]

Updated: December 2, 2011

Applies To: Microsoft Dynamics AX 2012 Feature Pack, Microsoft Dynamics AX 2012

Following is information about how to create a clean inheritance model and minimize problems when code is upgraded:

  • Each class must have a single public construction method unless the class is abstract. If no initialization is required, use a static construct method. Otherwise, use a static new… method (the default constructor (new method) for the class should be protected).

  • Each class should have at least one static construct method method. Warning icon

  • Each class should have at least one static new… method.

  • Each class should have a new method (the default constructor). This method should be protected. Warning icon

  • Create accessor methods to get and set class variables.

  • Create init methods to carry out any specialized initialization tasks that should be carried out after instantiation.

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2012 Microsoft. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker