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

Introduce an ApplicationInstance-specific registry to Boot Cleanup WIP #10308

Merged
merged 4 commits into from
Jan 29, 2015

Conversation

dgeb
Copy link
Member

@dgeb dgeb commented Jan 29, 2015

The ApplicationInstance-specific registry uses its corresponding Application's registry as a failover to resolve registrations and injections.

Soon, this registry will be abstracted behind proxies such as register and inject on the instance itself.

cc @wycats @tomdale

@@ -18,23 +18,34 @@ var VALID_FULL_NAME_REGEXP = /^[^:]+.+:[^:]+$/;
@class Registry
*/
function Registry(options) {
this.failover = options && options.failover ? options.failover : null;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a total bikeshed, but I'm not totally in love with the term "failover." To me, a failover implies latch-like behavior: once the "fail" has occurred, you switch everything over to the failover. For example, if the power goes out, you have a "failover" generator that everything switches to.

In this case, it's not really a failover per se… it just looks in its local one first, then expands its search to the parent registry if it's available. Perhaps this terminology is controversial, but I think I'd almost prefer parentRegistry to failover.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fallback?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fallback seems good.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, fallback it is - thanks @rwjblue!

A registry's fallback registry resolves registrations and injections
when no matches can be found.
The instance's registry sets its fallback to the corresponding
application's registry.
@dgeb
Copy link
Member Author

dgeb commented Jan 29, 2015

@tomdale @rwjblue ok, I've fixed up my commits to use fallback instead of failover

Ensure that `name` and `type` are valid after initial parsing and before
any post-parsing mutations might be performed.

This fixes a problem in which mutations are performed to the cached
object (e.g. "route:basic" -> "route:") and then the validation of the
mutated object fail when it's accessed a second time.

It's also more efficient, since validation only occurs once.
@tomdale
Copy link
Member

tomdale commented Jan 29, 2015

Bless you child. 🙏

@tomdale tomdale merged this pull request into emberjs:boot-reform Jan 29, 2015
@dgeb
Copy link
Member Author

dgeb commented Jan 29, 2015

🍻

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

Successfully merging this pull request may close these issues.

None yet

3 participants