You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

Canjs uses a Model View Controller design pattern, where data is held in a Can Observable or Can Model, flow control is handled by a Can Control, and the view is created in html and Javascript with either EJS or mustache templates. We use EJS currently, because it allows us to make conditional statements in the template (which can be bad or good, depending). In addition, routing is handled by a separate router controller that listens to url changes and based on them passes control to different page controllers.

I (Mike Berger) find this paradigm to be simpler to understand and implement and easier to use when multiple people are working on an application because the MVC pattern enforces separation of concerns. In other words, once person can work on a view and another can work on a controller without working on the same file and coming into conflict. Therefore, we expect each page to at a minimum have its own controller and at least one view (EJS file in our case).

  • No labels