Which class comes first....?

I really appreciated the blog by Peter de Decker:
https://developer.garmin.com/index.php/blog/post/pro-tip-tackling-connect-iq-versions-screen-shapes-and-memory-limitations

I am building a new datafield on the method he proposes with a hierarchy of classes based on 4 layers of inheritance. Building it, I am wondering which code gets executed first. If several classes with "on update" exist with code, where the classes refer to eachother, which code gets executed first?
  • It follows what you tell it to do:
    • The first class that is executed is the main class referenced from the manifest.xml (entry), in the example blog this is PetersWatchFaceApp
    • In that class it picks up the getInitialView method to instantiate the highest level class level (DeviceView) so it will also use this onUpdate first if it exists.
    • From there it uses the logic within each function and will execute lower levels of the inheritance tree if you decide to call it eg

      class DeviceView extends CiqView {
      ....
      function onUpdate(dc) {
      CiqView.onUpdate(dc); // you explicitely state when and where you execute the code of the lower class levels....
      etc...
      }

      }

  • Ah, quite logical ????. Thanks!


    Strange those question marks. I meant:
    Ah, quite logical!!!! Thanks!