Skip to content
Arthur van de Vondervoort edited this page Oct 12, 2024 · 5 revisions

Interface name must start with the capital 'I' without any spaces following it.

The goal of this rule is to bring a widely adopted naming convention by other languages for interface objects to the AL Language.

Example

interface ISubscriber
{
    procedure Notify()
}

Prefixes

interface "ABC ISubscriber"

Setting the mandatoryAffixes or mandatoryPrefix in the AppSourceCop.json file will enable this rule to handle prefixes.

The AppSourceCop itself doesn't need to be enabled. We're only using the config file to retrieve the affixes, avoiding duplicate configuration in case of AppSource development.

AL vs C#

procedure Foo(Subscriber: interface ISubscriber) 
void Foo(ISubscriber subscriber)

There are differences between AL and C#. When a parameter or variable is declared we include both type and name. That is not the case in C#. So you could argue that the benefits of the I prefix gets lost in AL.

External

Clone this wiki locally