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

[FEATURE ember-container-inject-owner]: Inject owner instead of container during lookup. #11874

Merged
merged 2 commits into from
Nov 4, 2015

Commits on Nov 4, 2015

  1. [FEATURE ember-container-inject-owner] Introduce getOwner / setOwner …

    …helpers.
    
    Use a symbol to obscure the owner property.
    dgeb committed Nov 4, 2015
    Configuration menu
    Copy the full SHA
    7d7450c View commit details
    Browse the repository at this point in the history
  2. [FEATURE ember-container-inject-owner] Inject owner instead of `con…

    …tainer` during `lookup`.
    
    This change represents the final brick needed to wall off the
    `Container` as fully private.
    
    The Container no longer injects itself into every object that it looks
    up. Instead, it uses the new `setOwner` helper to inject the "owner",
    which can then be retrieved from any object using the new `getOwner`
    helper.
    
    The current net effect is that an app instance is injected into every
    looked up object instead of that app instance's container. This
    provides clean, public access to methods exposed by the app
    instance's ContainerProxy and RegistryProxy methods. It also guarantees
    that the only supported path to get to a Container or Registry is
    through a proxied method. This guarantee is important because it allows
    for owner-specific logic to be placed in proxy methods.
    
    In the future, other classes, such as Engine (coming soon), may mix in
    ContainerProxy and thus have the potential to be "owners".
    
    This work is behind the `ember-container-inject-owner` flag. Without
    this flag enabled, the Container will continue to inject itself directly
    into objects that it instantiates (as `container`).
    dgeb committed Nov 4, 2015
    Configuration menu
    Copy the full SHA
    9845a9a View commit details
    Browse the repository at this point in the history