Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is this a good design? #128

Closed
whatisor opened this issue Dec 19, 2014 · 2 comments
Closed

Is this a good design? #128

whatisor opened this issue Dec 19, 2014 · 2 comments

Comments

@whatisor
Copy link

I am a developer who use threejs somewhere.
I've discovered playcanvas and felt its sample pretty good and BIG options instead of threejs
Howerver, when I check sample code, I feel something about this:

application.context.systems.model.addComponent

just question, is this a good design which call DEEPLY into child?
Thank you

@Maksims
Copy link
Contributor

Maksims commented Dec 23, 2014

Hi @whatisor
We have been on the journey to rethink and redefine API design as a whole for some time now, as we do recognise that this is "not the best" design at all.
We brought certain ideas on table, and there is a work going on, being still backwards compatible (temporarily), enable simple and straight forward use of APIs.

No more too crazy multiple inheritances with thousands of dots in between. And no more need to memorise all this madness.
But it is quiet a bit of work still to do to get it out right.

Just to assure you, simplification - it is happening, but need a bit more time ;)

@daredevildave
Copy link
Contributor

We've streamlined the Entity/Component API in the latest release.

Now the code looks like this:

    var entity = new pc.Entity();
    entity.addComponent("camera");
    entity.addComponent("light", {
        type: "point"
    });

Much better!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants