So I am still in the process of translating some of my AS2 classes over to AS3. AND I have been doing so supplemental reading on design patterns in the process. I am thinking maybe this is the time to really make my classes more effecient using the **Design/Decorator Pattern which I read about in Head Start Design Patterns.
So I have this class that extends the Sprite class. Depending on the ‘shape type’ of the shape I want to draw, it will calculate certain points via a pointLogic method and then based on the ‘vis type’ will either call drawWireFrame (), drawSolid (), or drawShaded ().
How I was doing this in AS2 was basically extending a base class and then overriding the aforementioned 4 methods in each of the subclasses. In AS3 I am looking to use the same base class and basically attach certain classes that will instruct the base class on the pointLogic (), drawWireFrame (), drawSolid (), and drawShaded () depending on the shape I want to draw.
So I am kinda stumped on how to approach this. I guess the real issue is how do I bring in these classes and have them give their instructions on how to draw the base class? Am I going to need to use something like *owner or parentDocument *to have these drawing classes talk to the base class.
Any comments, suggestions, questions etc. will be greatly appreciated. THANKS :pac: