Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8973455
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T18:27:03+00:00 2026-06-15T18:27:03+00:00

I seem to be getting more and more confounded at what appears, on the

  • 0

I seem to be getting more and more confounded at what appears, on the surface at least to be pretty basic architectural questions regarding building ember apps.

Which Controller type?

In the last month or so, I’ve seen people implement controllers through Ember.Controller, Ember.ArrayController, Ember.ObjectController, and Ember.ArrayProxy. Removing ArrayController and ArrayProxy (due to them being identical), what are common use cases between each type?

So far, i’ve been able to gather that:

  • ArrayControllers/Proxies should be used when you have n elements within the view you intend to control
  • ObjectControllers should be used when the view is simple enough to maintain it’s state in a single object, or be a single instance of a model’s object.
  • Controllers — ? No idea.

What are some basic differences between the controller types? There doesn’t seem to be concrete information on when to use which, and for which use case. The API docs are good at telling me the nitty gritty of each of them, but not WHEN to use each.

The relationship between a View and a Controller can be baffling

When a View is connected via a routes ConnectOutlets function call, what exactly happens between the controller and the view?

Are events tied into the view itself (which seems to be the case) and if so, where on earth do you interact with the controller singleton to perform CRUD-esq things on its properties? this.get(‘controllerName’) doesn’t seem to do the trick, and nearly each post or tutorial or code sample out there does this a different way.

Models that aren’t

I realize that Ember Data looks to help solve some of the more irritating parts of dealing with data and keeping it in sync, but at a larger perspective, in the concept of “MVC”, ember doesn’t really seem to have a Model of any kind. It’s just some object that gets subclassed from a specific thing and then tracked….somewhere? Somehow? Magical?

@trek sufficed that an Ember.Object could manage ajax’ing data and handling state on the client just fine, but if you look at something like the todomvc.com ember app, it uses a localStorage paradigm that is COMPLETELY different in implementation then everything i’ve looked at.

How EXACTLY should the ‘Model’ part of the MVC equation be done here?

Views make me want to murder children

There seems to be a significant number of ways to construct a “view” in terms of displaying markup to a user.

  • ContainerViews, using subviews / childviews
  • nested outlets
  • Handlebars templates + an outlet
  • using #each foo in controller
  • Injection through literals (template: Ember.Handlebars.compile('<h1>foo</h1>') etc)

With that in mind, what’s the ‘proper’ way to build modular UI components with ember? This more than anything is a major pain point for the adoption of this framework for me.

I love the direction that Ember is going with application development on the web. The concepts seem simple, but the verbosity is that of Objective-C (which makes sense given it’s lineage) but I swear to god I feel like i’m fighting the god damned framework more than i’m actually working on my application. The verbosity of the syntax and the lack of structured documentation outside of API documentation (which lets face it, 300k of javascript is a significant amount of code to throw some breakpoints down and try to debug your issues).

I realize the challenge that you guys are up against, but hopefully this at least makes you pause for a minute and think of how you could make life easier for the incoming developer who’s worked with other frameworks (or hell, even worked within an MVC framework, like rails or django or backbone or angular) and say “this is how we think ember should be used”.

Take some of the opinionated software design decisions and apply them toward the community. We’ll do nothing but be cheerleaders for you if you do it, promise.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T18:27:05+00:00Added an answer on June 15, 2026 at 6:27 pm

    Please don’t hurt any children. AFAIK the ember-core team are all over 18, so any ember-view-related frustration is clearly better directed towards adults. With that in mind…

    Which Controller Type?

    You’ve got the “what” right, but maybe missing the “why”. Controller can be a little misleading, especially coming from rails. Think of these controller singletons as representing the state (in-memory) of your application.

    Which kind of controller to use depends on what is required for that part of your application. For example, a back-of-napkin sketch for any app might have a topnav, postList, postDetails section. In ember, each is represented by one or more view/controller pairs. In this app I would expect to see ApplicationController and NavigationController extending Ember.Controler while postList would extend ArrayController and PostDetails would be an ObjectController.

    You could do it all using just Ember.Controller but ObjectController and ArrayController are really useful for wrapping model data. Any non-trivial ember app will probably use all three.

    The relationship between a View and a Controller

    A controller’s job is to provide the context in which the view will be rendered. Ideally you’d like to keep logic out of views, so a typical controller will have lots of computed properties to do things like:

    • transform data from the underlying model objects
    • sort/filter/select a list of objects
    • reflect application state

    whats the deal with connectOutlets? This is where you should be using the requested route/context to decide which views/data should be plugged into the outlets of your application. The controller’s connectOutlet method has a bunch of magic to make it easy, but maybe too much magic. What happens (afaik) when you call: parentcontroller.connectOutlet ‘child’ is

    • Ember creates an instance of ChildView
    • The {{outlet}} handlebars helper in parentController’s view is bound to this childView instance
    • The childView is rendered with the router.childController singleton as it’s context

    where to do crud stuff?: Typically in an action on the router. This seems crazy at first. Think of ember router not like rails but as a stateManager that just happens to also handle routing. In near-future router API will change to make this more clear. Anyway, use router actions to do things like create model instances, commit/rollback transactions and trigger state change. This is easy to do if you use the handlebars {{action}} helper for links/buttons as it targets the router by default.

    Views on the other hand should have logic for “reacting to browser events” – that means really low-level stuff like show/hide something on mouseover or integrate with 3rd party libraries to do effects and animations.

    You might find this screencast helpful in understanding how to do CRUD-esq things:
    http://blog.bigbinary.com/2012/09/06/crud-application-in-emberjs.html

    Models WTF?

    Agreed in Ember any object could be used as a ‘Model’. I think @trek does a good job of demonstrating how one might accomplish this via Ember.Object. This works great for a simple app, and six months back maybe would’ve been your best bet as ember-data was really immature. I’m not clear on the history of ember’s todomvc app, but for sure it was written months ago. For sure it should be updated, but meantime I’d not recommend using it to learn about current ember best-practices.

    Instead, you should go with ember-data. Over the last few months it has really evolved and should be the default choice for any new, non-trivial ember app. @tomdale just gave a great presentation on this topic, I’d recommend having a look: https://speakerdeck.com/tomdale/ember-data-internals

    what’s the ‘proper’ way to build modular UI components with ember?

    For building modular UI components:

    • ContainerViews, using subviews / childviews
    • Injection through literals (template: Ember.Handlebars.compile …)

    For building an individual application:

    • nested outlets
    • Handlebars templates + an outlet
    • using #each foo in controller

    Building modular UI components is a totally different problem than building an application. Ember.View and it’s subclasses were designed for this purpose. You can easily extend/combine them to compose widgets with custom behaviors and share those widgets across applications.

    At least that’s how i’ve seen it done. If they are for internal use could also reference handlebars templates instead of object literals, but if planning to distribute the object literals approach seems best.

    A great real-world example of this is the ember-bootstrap project. I learned a lot about working with ember-views by reading through that project’s source. http://emberjs-addons.github.com/ember-bootstrap/

    TLDR

    • Pick controller that maps to type of data being represented
    • Controllers provide context for the view and remember application state
    • Use ember data for your models
    • Use subclasses of Ember.View to make components
    • Be nice to children
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I seem to be getting a little muddled here, so clarification more than anything
The more I research this problem, the more confused I seem to be getting.
I am getting some very surprising results that seem to indicate that it's more
I seem to be getting this particular always when i am trying to receive
I seem to be getting the above error when trying to make a callable
I've been coding for a while now but seem to be getting this issue
Spent a good few hours on this now and don't seem to be getting
I've added # config/initializers/will_paginate_array_fix.rb require 'will_paginate/array' but still do not seem to be getting
I'm getting errors and warnings that seem to indicate that 4th edition examples are
I seem to have a problem with getting MVC to fill in my custom

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.