Devs.site

Abstract classes become available in Apache Royale

A syntax for abstract classes has been suggested and accepted for the MXMLC compiler in the GIT development branch

Abstract classes become available in Apache Royale

Soon to be followed by the integration of abstract methods, abstract classes have become available for developers who want to better organize the logic behind their code


In order to enable this feature (which is disabled by default), you have to call the compiler like this:

    mxmlc -allow-abstract-classes App.mxml

When a class is declared like this:

    package com.example
    {
        public abstract class MyAbstractClass
        {
            public MyAbstractClass()
            {

            }
        }
    }

a [RoyaleAbstract] metadata is created, and it becomes this:

    package com.example
    {
        [RoyaleAbstract]
        public class MyAbstractClass
        {
            public MyAbstractClass()
            {

            }
        }
    }

Just like in other languages that have abstract classes, you cannot instantiate them (doing so will trigger an error). And remember that this works only for classes at the moment.

Update the compiler from the GIT source and test the new experimental addition.

0 comments

Specify your e-mail if you want to receive notifications about new comments and replies