Live data from Hacker News

EmberJS Confuses Me

wekeroad.com

91–100 of 142 posts

Re: EmberJS Confuses Me

#91
I tried Emberjs and Angularjs recently, as both framework offered two-way binding between view & model, at client side.

Angularjs was easy to pickup and I have completed what I wanted to do in about half a day, except one issue, angularjs template rendering is DOM driven. I wanted server-side templates, hence I have to boot phantomjs at server-side. I didn't quite like booting phantomjs for server-side templates.

Since Emberjs offered, handlebar based templates, I was happy that I could render my templates at server-side. So tried emberjs, it took about 3 days, to get it done. Many out dated tutorials & documents spread across internet about older versions of Emberjs. Documentation at emberjs.com is minimal and not helpful. I started looking at source code of discourse.org and try to understand how they used ember. I felt the power of emberjs when I needed complete control of context and rendering of nested templates. It was real beauty.

Re: EmberJS Confuses Me

#92
post #65

I think the problem is MVC itself is a confused mess. It means whatever each person wants it to mean, since it's too easy to make up a bunch of reasonable sounding argumentation for whatever you want to do if you use the words model, view, and controller a lot.

This is the comment I agree with most. Replace a solution defined as a "design pattern" with one defined as a data structure and you get a lot more clarity. The problem MVC solves can be recomposed as "synchronization of concurrent, related, mutable data structures." The relations are definable as a DAG for each direction; the synchronization process with a cyclical graph.

"Synchronization of concurrent, related, mutable data structures" is totally clear to me.

Re: EmberJS Confuses Me

#93
post #21

Earlier quoted context omitted.

The controller is the data. The model is grafted onto it for convenience. This ties the view to the model to the controller which is sort of orthogonal to "separation of concerns". In my opinion at least.

That's not how I'm seeing it. The controller has data, some of which might be from the model. The view shouldn't care whether the data came from a model or not. It would be coupling if the view did care. The view asks the controller for data. The controller might delegate that question to the model. The view shouldn't care whether the data was delegated or not; it should just get a response from the controller. Seems…

Great explanation. I'm not sure why (or if) ember states it so clearly.

A view calling controller.model.property is MORE tightly coupled than controller.property. The controller is tied to the view and the model as it's supposed to be. The view is not tied to the model.

Re: EmberJS Confuses Me

#94
post #66

I come from Backbonejs background with which I have worked for about 1.5 years. So I feel quite comfortable with it. I decided to try Emberjs - not for any other reason than trying to pick up something else and see how other JS framework approaches. I gave full two-days worth of time into it. Initially I thought - "How different can it get?" Plus, I believe even if it's very foreign I'll just keep reading, googling,…

The Ember teams has been planning for a sweep of all outdated information about Ember. We'll be updating SO questions and asking blog authors to add a disclaimer. Ember Data is a completely optional component of Ember that seeks to bring ORM-like abilities to the client side. It's not as far along or as stable as core Ember. For what it's worth, you can easily just use jQuery.ajax and create Ember.Objects from the re…

Since Ember 1.0 isn't compatible with Ember x.0 you could save yourself a lot of that work by sticking to semantic versioning and just calling it 'Ember2'

I went through the same thing grandparent post did - a lot of old tutorials. I think it would be a good idea for Ember to make a complete break and to call this 1.0 release something else.

Re: EmberJS Confuses Me

#95
Ember confuses me too. I've worked with many server and desktop MVC frameworks for almost 20 years. I'm familiar with MVC, it plays simple and easy, like rock-paper-scissors. My problem with Ember is that it seems to be more like "rock-paper-scissors-lizard-spock but for us the rock punches through the paper and the scissors cut the rock like butter. And you can play without actually showing your hand". Confusing.

Re: EmberJS Confuses Me

#96
Yes, I too agree EmberJS always a confusing library, Following are my resaons.

1)They say it follows MVC. Its actually MVC but MVP, if you look closely at the implementation.

2)Controller job is not precisely defined. Example: Even the data validations are done at controller level not a model level

So i switched to Backbone.js, which is very flexible library with tons of plugins that can be used when needed.

Since implementation of UI is different from requirement to another requirement. I feel EmberJS doesn't satisfy this, which leads to people using Backbone.js.

Regarding AngularJS, please use it only if you are new javascript and prefer learning Angular Javascript (which is not javascript by the way) :)

Re: EmberJS Confuses Me

#98
post #88

Curious for yourself? Try following my simple starter app tutorial of Rails + Ember.js here: http://www.devmynd.com/blog/2013-3-rails-ember-js Though, I understand the pain of coming from a server-side MVC architecture, I found it refreshing that Ember.js takes the "desktop" MVC approach. Our web apps are now living on the client, acting like desktop apps. Most people struggle with this reverse at first, but can conc…

While there is quite a deal of information on integrating ember-data with rails, there is much less on integrating it with other server-side MVC/REST frameworks. This means that using it with another framework often means modifying that interaction pattern to be more like how rails views ajax, complete with the root objects ({"model":{}}). This may more accurately apply to the REST driver in ember-data, but that is q…

That's def a job for the adapters. Django, for instance, has a REST adapter that has been worked on here: https://github.com/toranb/ember-data-django-rest-adapter

As far as the root objects are concerned, I've always been a fan of that part of Rails. Not to say that it cannot be easily gotten rid of with something like this (for ActiveResource)...

ActiveResource::Base.include_root_in_json = false

Or, like in my example app, with this (for ActiveModelSerializers)...

https://github.com/rails-api/active_model_serializers#1-disa...

Re: EmberJS Confuses Me

#99
post #89

Curious for yourself? Try following my simple starter app tutorial of Rails + Ember.js here: http://www.devmynd.com/blog/2013-3-rails-ember-js Though, I understand the pain of coming from a server-side MVC architecture, I found it refreshing that Ember.js takes the "desktop" MVC approach. Our web apps are now living on the client, acting like desktop apps. Most people struggle with this reverse at first, but can conc…

There seems to be some very positive buzz around this screencast mentioned both in the OP's blog and around HN in general: https://peepcode.com/products/emberjs . I found it particularly instructive but found that it only scratched the surface of this new framework. At least, it scratched enough off the top that I feel comfortable rooting through source and API documentation to figure out the rest. YMMV, of course.

Agreed. I'd like to spend some time and come up with a longer screencast that did a little bit more of a "deep dive".

Re: EmberJS Confuses Me

#100
post #91

I tried Emberjs and Angularjs recently, as both framework offered two-way binding between view & model, at client side. Angularjs was easy to pickup and I have completed what I wanted to do in about half a day, except one issue, angularjs template rendering is DOM driven. I wanted server-side templates, hence I have to boot phantomjs at server-side. I didn't quite like booting phantomjs for server-side templates. Sin…

[deleted]
Post reply on HN