|
|
#1 |
|
Участник
|
Axilicious:AX2012 Extension framework generation wizard
Источник: http://www.ksaelen.be/wordpresses/dy...ration-wizard/
============== Many of you might have come accross the Extension Framework while venturing in AX2012 for some years now. Personally, I use this pattern a lot in my code as the benefits of using it are obvious:
First, before all else, we need an enum that contains the different behaviors that will be available. In our sample we will use two methods of calculating, adding and multiplying. Do not forget the none value so that we can easily see if the type has been passed on. Then opening the wizard and clicking next, it shows the second tab page allowing you to specify the following information:
When ready, move to the third tab and fill in the class name and XML documentation description for the following objects:
With all of this filled in, click finish and you are ready with your end of the bargain. Now sit back and let the wizard take care of the following part. The result should look like this:
The only thing we have to do to get things up and running is creating the behaviors ourselves since the wizard does not know what we want to do. So to implement our two behaviors, we need to do the following:
![]() This should output the following: ![]() And there we have it, just calling the same code with different enums changes the behavior of the calculation. And the best part, from now on, if a developer wants to extend this and write other behaviors, the only thing he need to do is add and enum element and write a class that passes that enum to the attibute! The source code of the wizard can be found here Источник: http://www.ksaelen.be/wordpresses/dy...ration-wizard/
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору. |
|
|
|
|
| Опции темы | Поиск в этой теме |
| Опции просмотра | |
|