14.06.2018, 14:14 | #1 |
Участник
|
jaestevan: Embrace the extensions mindset with Dynamics 365 for Finance and Operations #2 – SysExtension framework [EN]
Источник: http://www.jaestevan.com/embrace-the...n-framework-en
============== In my previous post Embrace the extensions mindset with Dynamics 365 for Finance and Operations we reflected on some of the patterns we can leverage to create our customizations by using only non-intrusive changes based on a real example: Adding a new Number Sequence to a standard module. In particular, we discussed:
This pattern allows us to create new sub-classes for factory methods without any over-layering or coupling with the original hierarchy. Therefore, we can add new sub-classes in our own packages without any intrusive modifications and replace a very common pattern, widely used all over the application, like this (taken from AX 2012 R3): static SalesCopying construct(SalesPurchCopy salesPurchCopy) { switch(salesPurchCopy) { case SalesPurchCopy::CreditNoteHeader : return new SalesCopying_CreditNote(); case SalesPurchCopy::CreditNoteLines : return SalesCopyingCreditNoteLine::construct(); case SalesPurchCopy::CopyAllHeader : case SalesPurchCopy::CopyAllLines : case SalesPurchCopy::CopyJournalHeader : case SalesPurchCopy::CopyJournalLines : return new SalesCopying(); // case SalesPurchCopy::VoidFiscalDocument_BR : return new SalesCopying_VoidFiscalDocument_BR(); // default : throw error(strFmt("@SYS19306",funcName())); } throw error(strFmt("@SYS19306",funcName())); } This pattern has many of problems to be extensible. The most obvious is likely the throw error on the default case, that makes impossible to an extension class to subscribe to the Post event on the method to add new cases. But even deleting this throw sentence (that has been indeed deleted in many standard methods as a quick way to make them extensible), the pattern itself is still a problem. If a new customer or partner customization or even a new standard module needs a new case, this class needs to be modified and the full package compiled and deployed. Read the full article at “Dynamics AX in the Field”, the blog from the Premier Field Engineering team at Microsoft. Источник: http://www.jaestevan.com/embrace-the...n-framework-en
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору. |
|
|
Опции темы | Поиск в этой теме |
Опции просмотра | |
|