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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 19.12.2015, 16:12   #1  
Blog bot is offline
Blog bot
Участник
 
25,475 / 846 (79) +++++++
Регистрация: 28.10.2006
mfp: X++ in AX7: Method signatures
Источник: http://blogs.msdn.com/b/mfp/archive/...ignatures.aspx
==============


This post is about one of the more subtle changes in AX7. AX7 uses the .NET runtime, aka CLR. This has some implications for method signatures. In the CLR a method's signature includes casing, parameters and return type. In AX2012 a method's signature was simply the method's name – case insensitive.

Why is this important? If you change a method's signature, then all references to the method needs to be recompiled. Including those changes that appear harmless, like:
  • Fixing a casing issue in a method name, e.g. "somemethod" -> "someMethod".
  • Changing return type from void to
Here is an example, where I changed the casing of a method, that is being consumed by a test. I did NOT recompile the test before running it.

Notice the System.MissingMethodException: Method not found: 'Void Dynamics.AX.Application.MyClass.myMethod()'. The CLR only knows of a method with all lower case.



Optional parameters
It is still safe to add and remove (unused) optional parameters. The X++ compiler uses CLR's method overloading, i.e. several methods with the same name and the variations of supported parameters are produced by the compiler.

Lesson to learn
Do not change a method's signature, unless you are willing (and able) to recompile all consumers.



THIS POST APPLIES TO MICROSOFT DYNAMICS AX7 TECHNICAL PREVIEW; IS PROVIDED AS-IS AND CONFERS NO RIGHTS.




==============
Источник: http://blogs.msdn.com/b/mfp/archive/...ignatures.aspx
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
mfp: X++ in AX7: Extension methods Blog bot DAX Blogs 10 17.12.2015 18:22
mfp: X++ in AX7: Const keyword Blog bot DAX Blogs 0 17.12.2015 12:02
mfp: X++ in AX7: Readonly keyword Blog bot DAX Blogs 3 15.12.2015 18:22
mfp: X++ in AX7: Static event subscription Blog bot DAX Blogs 0 11.12.2015 11:11
mfp: X++ in AX7 Blog bot DAX Blogs 0 02.12.2015 22:13
Опции темы Поиск в этой теме
Поиск в этой теме:

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

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

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

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