I am working in AS3. We have an abstract class, call it MyAbstractClass (I don’t think it is truly abstract, but we are ONLY extending it). The classes that extend this class also implement an interface, call it IMyInterface. IMyInterface has a function called updateView.
I want one of my functions in MyAbstractClass to call updateView, but of course MyAbstractClass doesn’t have a function called updateView so it won’t compile. Am I attempting a bad-practice type of thing? Is there an easy way to do what I want?
Should I move updateView to MyAbstractClass, and just override it everywhere I need to? thanks
Yes, it absolutely sounds like this should be an abstract method within
MyAbstractClass. If all the implementations also implementIMyInterface, it sounds like you should possibly declare thatMyAbstractClassdeclares it too. Of course, these will both require that you makeMyAbstractClassproperly abstract.Basically, you need to ask yourself: logically, should you be able to treat every instace of
MyAbstractClassas anIMyInterface? Should they all haveupdateView? Does that make sense forMyAbstractClass, or are they logically separate?