Closed thomasconner closed 12 years ago
Chaplin relies on AMD so the configuration should be an AMD module. It needs to be defined before the Chaplin module is loaded so it can try to require()
it. Don’t know how AMD module loaders handle this, but I’ll investigate. In general that seems to be kind of a hack, probably someone comes up with a better idea.
In JavaScript there are several ways to create pseudo-classes dynamically, of course. For example a class factory which creates a custom Model class based on a given superclass. But we would need to dump the CoffeeScript class declarations for full flexibility.
In general, I’m aware that the concept of CoffeeScript pseudo-classes has several limitations. For example, if you’re not using CoffeeScript, super calls are tedious, and what you really want is AOP-style method composition. That’s easily possible because of the functional nature of JavaScript, but it doesn’t fit into the classical inheritance mold. Also, you will need multiple inheritance, traits or at least mixins sooner or later. After all, CoffeeScript classes add a lot of convenience, readability and conventions to the code, so at the moment I don’t want to dump them completely.
Yea I agree and thats why I was looking for some input. Thanks for responding.
Figured out a solution and will discuss later.
@ThomasConner I'm having the same trouble — would like to hear your solution.
I love this library and would like to continue to use it for my projects but I keep running into a major issue. Since chaplin.js is dependent on backbone.js and its base/core modules, you can not add backbone.js enhancements from other third party libraries. For example, I would like to you Backbone-relational by PaulUithol (Backbone-relational) but simply cannot without editing the src for model and collections in chaplin.js. I believe there could be a more elegant way. Simply having a file that informs chaplin.js where to inherit from would help. Something like the following:
Any thoughts or ideas? Let me know if this is possible. Thanks and keep up the good work.