O'Reilly logo

haXe 2 by Benjamin Dasnois

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The dot-notation

If you remember, one constraint was to be able to read values of metadata and properties using the dot-notation.

In fact, everything we've done until now has been done only for the sake of this exercise and for you to write some haXe code.

Although this is important, let's move on to implementing access via the dot-notation.

To do that, we will make our class implement Dynamic<String> and implement a resolve method.

Before doing that, there's just one question that arises: how are we going to handle the situation if a key exists in the metadata Hash and in the properties Hash? In our example, we will handle this situation quite easily by simply returning the value that is in the metadata.

So, here is our Component class modified: ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required