Thursday, 12 September 2013

What are the negative impacts of extending classes in ActionScript 3?

What are the negative impacts of extending classes in ActionScript 3?

In my game engine I use Box2D for physics. Box2D's naming conventions and
poor commenting ruin the consistent and well documented remainder of my
engine which is a little frustrating and presents poorly when you're using
it.
I've considered making a set of wrapper classes for Box2D. That is,
classes which extend each of the common Box2D objects and have their
functions rewritten to follow the naming conventions of the rest of my
engine, and to have them more clearly and consistently commented. I have
even considered building ontop of some of the classes and adding some bits
and pieces (like getters for pixel-based measurements in the b2Vec2
class).
This is fine but I am not 100% sure what the negative impacts of this
would be and the degree to which those would affect my applications and
games. I'm not sure if the compiler alleviates some of my concerns to a
degree or whether I do need to be considerate when adding somewhat
unnecessary classes for the sake of readability and consistency.
I have some suspicions:
More memory consumption to accommodate the extra level of class structure.
Performance impact when creating new objects due to initializing an extra
level of members?
I am asking specifically about runtime impacts.

No comments:

Post a Comment