436 views
in Embedded Wizard Studio by

Hi Support ,

I want to import "polymorphism" in Embedded Wizard project to implement a single interface to entities of different gui components.

Does EW  implement "polymorphism"?

Could you give me a simple code for "polymorphism", please.

 

The code in picture is a test for polymorphism.

it is in line with Chora?

Thank you.

Charles.

1 Answer

0 votes
by

Hello Charles,

in Embedded Wizard you can define an interface (e.g. diverse methods and properties) in a common base class. All classes descending from this base class inherit this interface implicitly. If it is necessary, in derived classes you can override the methods and provide other implementation. In your concrete case:

1. the common base class is GridComponents::GridVirtualClass.

2. Add to this common class the desired methods InitialF(), getGridValue(), etc. Similarly, if it is necessary, add desired properties to the class.

3. Implement the methods with their default functionality or leave the methods empty.

4. In the descending class (e.g. GridComponents::GridSizeaStylea) override the methods and implement there code particular to the derived class. See also: Override an inherited method.

5. At the runtime when invoking the method, the corect vwersion is determined dynamically depending on the instance of the object in context of which the method is invoked.

I hope it helps you further.

Best regards

Paul Banach

 

Ask Embedded Wizard - Archive

Welcome to the Ask Embedded Wizard archive. This community forum served us well for many years, but we've evolved our support approach!

Your resources:

The Embedded Wizard Online Documentation provides comprehensive documentation, tutorials, examples and ready-to-use software packages.

For dedicated assistance, explore our Embedded Wizard Product Support.

You can still browse the valuable discussions from our community history here.

Embedded Wizard Website | Privacy Policy | Imprint

...