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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 23.12.2015, 09:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,643 / 848 (80) +++++++
Регистрация: 28.10.2006
mfp: X++ in AX7: Attributes without specifying ”Attribute”
Источник: http://blogs.msdn.com/b/mfp/archive/...attribute.aspx
==============
The naming convention in X++ (and C# by the way) is to postfix attribute classes' name with "Attribute". When using the attribute to decorate a class, it is a bit verbose to type in "Attribute" as it is apparent from the context, so now in X++ - just like in C# - you can skip the last part of the name.
Example:

class MyTestCase extends SysTestCase
{
[SysTestMethodAttribute]
public void testCase1()
{
}
}


Is semantically identical to:

class MyTestCase extends SysTestCase
{
[SysTestMethod]
public void testCase1()
{
}
}


Now, there is a difference in opinion on which one is best. One camp would argue that the shorter code is easier to read and write. Another camp would argue that referring to the same type in two different ways makes tooling (like refactoring tools, F12/Go to declaration and cross references tool) harder to implement. I agree with both, however, now the door is opened for this dual way of referencing and the tooling needs to follow suit. I'm in favor for the short notion.





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







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

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
mfp: X++ in AX7: Garbage Collection Blog bot DAX Blogs 0 21.12.2015 11:11
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, время: 11:47.