Цитата:
Сообщение от
ta_and
Выводы:
1. Для стороннего разработчика (не МС) эта технология создает исключительно дополнительные (и не спорьте) трудозатраты.
2. При разработке своих классов лучше продолжать использовать старый добрый свич для простоты поддержки, понятности и прозрачности.
От версии.
Если это AX7 или существуют планы портировать на AX7, то старый добрый свитч - не хорошо. Если это AX2009, AX2012 - то пожалуй да, усложнять без необходимости нет смысла.
Development tutorial: SysExtension framework in factory methods where the constructor requires one or more arguments
http://kashperuk.blogspot.co.uk/2017...extension.html
At the
Dynamics 365 for Operations Technical Conference earlier this week, Microsoft announced its plans around overlayering going forward.
The direct impact of this change is that we should
stop using certain patterns when writing new X++ code.
Pattern to avoid
One of these patterns is the implementation of factory methods through
a switch block, where depending on an enumeration value (another typical example is table ID) the corresponding sub-class is returned.