AXForum  
Вернуться   AXForum > Microsoft Dynamics AX > DAX Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск Все разделы прочитаны

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 24.06.2018, 23:13   #1  
Blog bot is offline
Blog bot
Участник
 
25,459 / 846 (79) +++++++
Регистрация: 28.10.2006
jaestevan: Embrace the extensions mindset with Dynamics 365 for Finance and Operations #2 – SysExtension framework [EN]
Источник: https://www.jaestevan.com/embrace-th...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:
  • Metadata Extensions — to add a new Enum Value in a standard Base Enum.
  • Class Extensions — to add a new method to a standard class.
  • Chain-of-Command — to add a block of code to an existing standard class method.
  • Event-Handler subscription — to subscribe our own method to an existing standard delegate provided as an extension point.
If you still didn’t read that blog post, please take a moment now. If you already did it (thanks!), let’s continue with another pattern we have to consider: SysExtension Framework (also SysPlugin, that is quite similar).

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.





Источник: https://www.jaestevan.com/embrace-th...n-framework-en
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
jaestevan: Embrace the extensions mindset with Dynamics 365 for Finance and Operations #2 – SysExtension framework [EN] Blog bot DAX Blogs 0 14.06.2018 14:14
jaestevan: Microsoft Dynamics 365 for Operations Blog bot DAX Blogs 0 02.11.2016 01:11
jaestevan: Dynamics 365, AppSource, PowerApps y compañía… ¿Qué esperar del futuro de los ERP en Microsoft? Blog bot DAX Blogs 0 26.07.2016 22:11
emeadaxsupport: New Content for Microsoft Dynamics AX 2012 : October 2011 Blog bot DAX Blogs 0 27.10.2011 17:11
Platform updates overview - 3.70.B - NAV2009 R2 Blog bot Dynamics CRM: Blogs 0 07.02.2011 22:06
Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск
Опции просмотра

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 20:45.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.