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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 30.01.2009, 16:05   #1  
Blog bot is offline
Blog bot
Участник
 
25,644 / 848 (80) +++++++
Регистрация: 28.10.2006
axStart: If X++ will act like c#
Источник: http://axstart.spaces.live.com/Blog/...C0A0!465.entry
==============


For the past couple of months I have worked on a Type Safe interface for Dynamics AX .net connector. I’m quite happy with the current version (0.92).  However I run in strange things in our AOT. It is possible to do parameter overloading in X++.
Parameter overloading:
It works for Boolean and base enum base parameters or return types. So a method with return type Boolean can be overloaded with return type yesno. 
Base class
ABC retunBaseEnum()
{
    return ABC::A;
}
Derived class
ABCModel retunBaseEnum()
{
    return ABCModel::Link;
}
If we have to convert this to C#, the method of the base class becomes virtual. But the derived method can’t be of type overload. Even virtual new is wrong. According to C# the derived method should be virtual.
Optional parameters and inheritance:
Consider the following X++ code:
Base class
void optionalParaMeter(int _a, int _b = 0)
{
 
}
Derived class
void optionalParaMeter(int _a, int _b, int _c = 0)
{
    super(_a,_b);
}
If we translate this code to c#, we get 2 methods in our base class.  Virtal void optionalParaMeter(int _a) and Virtal void optionalParaMeter(int _a, int _b ).   This is acceptable code.  The next step is the derived method.  C# will looks like void optionalParaMeter(int _a, int _b) and  void optionalParaMeter(int _a, int _b, int _c). But now we get in trouble as they both need to be of type overload, but void optionalParaMeter(int _a, int _b, int _c) can’t be of type overload because this one does not exist in the base class. So we get a new virtual function and an overload function.
 
I ran in this issue when converting the AOT to C#.


Источник: http://axstart.spaces.live.com/Blog/...C0A0!465.entry
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
axStart: Check if the table field is mapped. Blog bot DAX Blogs 0 07.03.2009 00:05
if (record) vs if (record.RecId) kashperuk DAX: Программирование 18 27.11.2008 18:53
axStart: SQL Synchronize trouble, work around Blog bot DAX Blogs 0 18.12.2007 20:40
InventJournalTrans DreamCreator DAX: Программирование 7 14.12.2004 14:48
Говорят вышел SP2 для Axapta 3. Кто нибуть что знает на эту тему? soin DAX: Прочие вопросы 10 13.10.2003 10:43

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

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

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 18:01.