Calling base class
(Created page with "EAL (Eco Action Language) is fantastic as it allows you to create a complete system without bringing out visual studio or c# at all (nothing is wrong with c# – but it is ama...")
 
(Automatically adding template at the end of the page.)
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
EAL (Eco Action Language) is fantastic as it allows you to create a complete system without bringing out visual studio or c# at all (nothing is wrong with c# – but it is amazing to be able to execute the model alone). But it had a limitation: when overriding methods there was no way to call the base class implementation of the method.
EAL (Extended Action Language) is fantastic as it allows you to create a complete system without bringing out Visual Studio or C# at all (nothing is wrong with C# – but it is amazing to be able to execute the model alone). It had a limitation: when overriding methods, there was no way to call the base class implementation of the method.


Now that is fixed by introducing the EAL operation “base” – works just as in c#:
Now that is fixed by introducing the EAL operation “base” – it works just as in C#:


[[File:Base class - 1.png|frameless]]
[[File:Base class - 1.png|frameless]]


Given the OnCreate method (that is called when a object is created).
Given the OnCreate method (that is called when an object is created).


The RootClass.OnCreate
The RootClass.OnCreate
Line 15: Line 15:
[[File:Base class - 3.png|frameless|467x467px]]
[[File:Base class - 3.png|frameless|467x467px]]


Note the self.base.OnCreate call that calls the superclass implementation of OnCreate (just as in c#)
Note the <code>self.base.OnCreate</code> call that calls the superclass implementation of OnCreate (just as in C#)


And when creating a new Person I get this output:
And when creating a new Person, I got this output:


[[File:Base class - 4.png|frameless]]
[[File:Base class - 4.png|frameless]]


…as in the RootClass added “RA ” and the Person added “PA ”
…as in the RootClass added “RA” and the Person added “PA.
[[Category:EAL]]
{{Edited|July|12|2024}}

Latest revision as of 15:27, 10 February 2024

EAL (Extended Action Language) is fantastic as it allows you to create a complete system without bringing out Visual Studio or C# at all (nothing is wrong with C# – but it is amazing to be able to execute the model alone). It had a limitation: when overriding methods, there was no way to call the base class implementation of the method.

Now that is fixed by introducing the EAL operation “base” – it works just as in C#:

Base class - 1.png

Given the OnCreate method (that is called when an object is created).

The RootClass.OnCreate

Base class - 2.png

And the Person.OnCreate

Base class - 3.png

Note the self.base.OnCreate call that calls the superclass implementation of OnCreate (just as in C#)

And when creating a new Person, I got this output:

Base class - 4.png

…as in the RootClass added “RA” and the Person added “PA.”

This page was edited 101 days ago on 02/10/2024. What links here