adamRenny / LayerJS

2D Canvas Library supporting Layered Rendering
MIT License
8 stars 1 forks source link

Method naming for adding children to RenderableGroup is inconsistent #59

Open aaronholsonege opened 11 years ago

aaronholsonege commented 11 years ago

Stage has the following methods for adding children:

RenderableGroup has:

For API consistency, I think RenderableGroup should have prependChild added and addChild should be renamed to appendChild.

adamRenny commented 11 years ago

After deep contemplation and discussion with you, I think you're right. Let's take the append/prepend route. Its just more environment friendly considering we're in JS & DOM.

aaronholsonege commented 11 years ago

Since Stage.addChild is now a proxy for Stage.appendLayer, should it be removed? If so, what is the best way to deprecate a method?

aaronholsonege commented 11 years ago

Ready for merge: https://github.com/adamRenny/LayerJS/tree/feature/%2359

adamRenny commented 11 years ago

To answer your question way late... deprecation within our API should simply stop using the functionality after a certain point. As far as other developers using it, it should include an @deprecated tag inside the docblock.

adamRenny commented 11 years ago

Not yet ready for merge - the APIs in the scene will still be inconsistent. Update the methods in the scene to follow the same naming patterns and we'll push those last changes through.