gmac / backbone.epoxy

Declarative data binding and computed models for Backbone
http://epoxyjs.org
MIT License
615 stars 89 forks source link

Configurable Model Name #61

Closed JesterXL closed 10 years ago

JesterXL commented 10 years ago

I don't follow Backbone's "model" instance naming for Views. Instead, I call it what it actually is such as "personModel" or "parentalControlsCollection" or "contacts". That way in the code you know what kind of model you're dealing with in larger code bases. Since JavaScript's lack of typing, and Sublime/Webstorm not really helping on the code hinting front, it makes the code more clear.

However, it appears Epoxy assumes it does follow this convention and throws exceptions for properties not being defined which you added here:

https://github.com/gmac/backbone.epoxy/issues/11

... however, the actual model itself is undefined.

Enhancement request: A) please allow this variable name to be configurable or... B) please modify the exception earlier on in the function to say "model is undefined in your View" or something to that effect.

Thanks for your hard work on Epoxy!

gmac commented 10 years ago

Thanks for the feedback, I can definitely appreciate your thinking and your intent. Unfortunately, I've got to pass on this one. Epoxy is first and foremost an extension of the Backbone framework, and therefore designed to build upon Backbone's patterns, conventions, and documentation. This sort of personalization feature would greatly increase library code and documentation complexity, while not offering any real functional value. Consistency offers its own form of simplicity and cleanliness.