Question

I just started with Ember.js and I can't seem to find a legitimate reason to use it in any kind of project, except for maybe a stand alone HTML5 application (not a website). That's just my opinion and know lots of people make use of it for good but isn't duplicating the ORM code on the client side a bit of boilerplate ?

Was it helpful?

Solution

There's a lot of discussion on "why Ember" elsewhere, so I'll keep this sorta short...

Ember and many of the other client-side MVC frameworks are best suited for applications that need to manage complex state changes between UI elements and their underlying data. Once you get to a certain level of sophistication on the UI, it becomes harder and harder to manage with data- attributes and jQuery dom finders. You can compare and contrast implementation of a sample application using different frameworks here: http://todomvc.com/

Ember is not duplicating the ORM layer. It does not do the actual persistence or integrate with your database, map the columns to the attributes, etc. It might feel similar in that you have JS objects that look similar to your models, but they serve a different purpose. They are meant to be data objects for your UI; almost the same as if you were going to produce JSON representations of your model for an API consumer; except these models can have behavior and can be bound to the UI (via controller) so that the UI stays in synch when the model data changes.

There's some good advice and opinion on Ember here (code syntax is outdated): https://github.com/trek/trek.github.com/blob/4bc36e47a9017bead7cbfd769d6dc87b57c8808d/_posts/2012-08-30-advice_on_and_instruction_in_the_use_of_emberjs.md

The Ember info out there (esp here and with the data interface) is a little difficult to navigate because a lot of the syntax has changed. This transition guide can help: https://github.com/emberjs/data/blob/master/TRANSITION.md

The Ember tutorials out there are also tricky because almost all of them assume that you are building an app from scratch and want your entire app to be based on Ember. This is a valid use case, but if you manage and maintain an existing app it's hard to visualize how to fit Ember into what you already have.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top