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

Application is both mixing in the config into itself and to a params field #65

Open
cjolif opened this issue Jul 10, 2012 · 2 comments
Open

Comments

@cjolif
Copy link
Contributor

cjolif commented Jul 10, 2012

See:

constructor: function(params, node){
  lang.mixin(this, params);
  this.params = params;
  // ...
}

This seems redundant. I think only params should be kept the mixin is dangerous. For example Application defines a controller object that contains the instances of controllers and the config also contains such a property.

@cjolif
Copy link
Contributor Author

cjolif commented Jul 10, 2012

View is doing only mixin of params. I would say at least we should be consistent between the app and view. So either only mixin in both or only set a params field (preferred in my opinion as it prevents any potential clash).

@dmachi
Copy link
Owner

dmachi commented Jul 10, 2012

I agree that it should probably be one or the other and don't feel overly strong about either way. On the one hand mixing in can have clashes as cjolif points out, but on the other hand the whole point of that object is to make it easy to config/change/override an app in different situations. All that said, we can use params and then set properties on the main instances by inspecting that object, so its an extra step but no loss of capabilities.

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

2 participants