Comparision between X++ and C#

Posted by Alvin You
2013. 10. 5. 01:38 Dynamics AX

AX의 개발 언어인 X++과 MS의 대표적인 개발언어인 C#의 비교자료입니다.

같은 Object-Oriented Programming 언어이지만, OOP의 개념을 어떻게 풀어 넣었느냐에 따라 개발 방법이나 사용 방법은 틀려질꺼라 생각됩니다.

Axapta가 AX 2012 버젼이 되면서 MS의 Backoffice 서버 제품군(Sharepoint Server, Project Server)과의 통합에 많은 주력을 한 듯 보입니다.

Enterprise Portal과 Project Module의 추가를 보면 많은 신경을 쓴 듯 보입니다. 아직 국내에는 활발하게 해당 모듈을 이용한 프로젝트가 많지는 않지만, 향후에는 많은 프로젝트들이 생기길 기대해 봅니다.

Abaper들과 어깨를 견주길 바라며, Xppler 여러분 화이팅입니다.

X++
C#
abstract
class
The modifiers public and private are ignored on class declarations.
There is no concept of a namespace grouping of classes. There are no dots (.) in any class names.
The modifiers public and private can be used to modify class declarations. C# also has the keyword internal, which relates to how classes are grouped together in assembly files.
extends
A class declaration can inherit from another class by using the extends keyword.
A colon (:) is used where the key words extends and implements are used in X++.
final
A final method cannot be overridden in a derived class. A final class cannot be extended.
The keyword sealed on a class means the same thing that final means on an X++ class.
implements
A class declaration can implement an interface by using the implements keyword.
(See extends.)
interface
An interface can specify methods that the class must implement.
An interface can specify methods that the class must implement.
new
The new keyword is used to allocate a new instance of a class. Then the constructor is automatically called.
Each class has exactly one constructor, and the constructor is named new. You can decide what parameters the constructor should input.
The new keyword is used to create a new instance of a class. Then the constructor is automatically called.
Constructor methods themselves are not named new; they have the same name as the class.
null
private and protected
The private and protected keywords can be used to modify the declaration of a class member.
The private and protected keywords can be used to modify the declaration of a class member.
public
A method that is not modified with public, protected, or privatehas the default access level of public.
A method that is not modified with public, protected, or private has the default access level of private.
static
A method can be static, but a field cannot.
Both methods and fields can be static.
super
The super keyword is used in a derived class to access the same method on its base class.
void method2()
{
;
// Call method2 method
// on the base class.
super();
}
The base keyword is used in a derived class to access various methods in its base class.
void method2()
{
// Call methods on
// the base class.
base.method2();
base.method3();
}
this
For a call from one instance method to another on the same object, a qualifier for the called method is required. The keyword this is available as a qualifier for the current object.
For a call from one instance method to another on the same object, a qualifier for the called method is not required. However, the this keyword is available as a qualifier for the current object. In practice, the keyword this can be helpful by displaying IntelliSense information.
finalize
The Object class contains the finalize method. The finalize method is not final, and it can be overridden.
The finalize method appears to resemble the System.Object.Finalize method in C#, but in X++ the finalize method has no special meaning of any kind.
An object is automatically removed from memory when the last reference to the object stops referencing the object. For example, this can happen when the last reference goes out of scope or is assigned another object to reference.
The methods Finalize and Dispose are common on some types of classes.
The garbage collector calls the Finalize and Dispose methods when it destroys and object.
main
Classes that are invoked from a menu have their main method called by the system.
Classes that are invoked from a command line console have their Main method called by the system.