Well, I wrote the code in these codeboxes as "example", so indeed I will be using other names :)
Also, assuming every unit frame is going to have a health bar, and no unit frame will have more than one health bar, it's really just a waste to move the "create a health bar" code into a separate function. Just create the health bar right in the "create a unit frame" function.
If you are specifically trying to learn how to write OOP code, and don't actually have a particular end result in mind, that's one thing... but if you're actually trying to write a unit frames addon, I think you're going about it in a way that's much, much more complicated than it needs to be.
Actually, this would be the 3rd/4th rewrite.
Right now, I have a "factory" function that creates and returns unitframes and every element of such unitframes are created within the "factory function" itself.
This was more an exercise to "learn how to write OOP code".
You're right. I guess the right way to call that is "self:SomeFunction(x)" for the purpose I was looking for.