Actor Framework Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

New to AF- Understanding the Hands-On

Hello,

I have decided to have a go at learning the Actor Framework and have been going through the Evaporative Cooler Hands-On exercise.  I am also trying to write my own simple project so that I can be sure that I have correctly grasped what is going on.

I have a question regarding the Cooler Class.  Why is it at the bottom of the class hierarchy and not higher up, as it appears to be 'in control' of the application?

I want to do a simple water machine for myself.  This is similar to the cooler, but in reverse.  It uses a compressor and a fan to draw water from the air into a tank but only if the tank is not full and the temperature and humidity in the room are above certain thresholds.

So the classes I plan are:

Timing Class (inherits from Actor class)

Sensor Class (inherits from Timer)

Temperature (inherits from Sensor)

Humidity (inherits from Sensor)

Water Level  (inherits from Sensor)

Output Class (inherits from Timer)

Fan (inherits from Output)

Compressor (inherits from Output)

So I have inputs and outputs.  I am getting slightly confused as to which is in overall control, or do I need another class (Water Machine) that calls all the shots.

Many thanks for any help,

Malcolm Myers

Certified LabVIEW Architect and LabVIEW Champion specialising in Noise, Vibration and Harshness
Message 1 of 5
(4,591 Views)

The easy answer is that inheritance has nothing to do with call hierarchy. Indeed, the vast majority of classes that are actually used in any application are leaf-level classes. The middle layers are never actually instantiated as objects -- so, for example, there is never a raw "Message" object anywhere in the code, but there are plenty of specific message objects, like "Stop Msg", running around. There's never an object whose exact type is "Actor". There are plenty of objects whose type is some descendant of Actor. A class inherits behaviors from its ancestors. The class that finally has enough functionality to execute is the composite of all those ancestors.

I'm sorry... I do not have time this week to help with further architecture questions, but I figured I could answer that one point of confusion easily enough.

0 Kudos
Message 2 of 5
(3,468 Views)

So stuff at the bottom of the class heirarchy is notionally more powerful that stuff at the top as it inherits from all preceding levels.  That makes sense.  (I feel a Homer moment coming on.)  Thank you!

Certified LabVIEW Architect and LabVIEW Champion specialising in Noise, Vibration and Harshness
0 Kudos
Message 3 of 5
(3,468 Views)

Yes. As human parents hope that their children have better lives than they did, so parent classes hope their child classes have more functionality. 😉

Message 4 of 5
(3,468 Views)

  I'm nearly there, just one bug to fix I think but I'll do it tomorrow.  Thanks again.

Certified LabVIEW Architect and LabVIEW Champion specialising in Noise, Vibration and Harshness
0 Kudos
Message 5 of 5
(3,468 Views)