Search code examples
javascriptember.jscommand-pattern

How to implement Command Pattern instead of using Adapter?


I'm new to EmberJS and a bit lost. I would like to ask some advice to get started correctly.

We have a SaaS which is not built with EmberJS. I'm trying to refactor a part of it and use EmberJS for that.

Our Software implements the command pattern. It means we send action (JSON object) to the server to create, update and delete (also undo/redo) our model objects.

I can't really use Adapter for that because they seam to be created for REST Interface, but we are not using REST for that part.


Solution

  • You most definitely need to use Ember-data which is REST oriented. See Robin Ward's talk on using Ember without Ember-data. I was able to find a simple example of using the command pattern in an example app here. Here is another article by Yoran Brondsema on using the command pattern in an Ember app. I believe that the last example is a good jumping off point.