如何实现命令模式而不是使用适配器?
How to implement Command Pattern instead of using Adapter?
我是 EmberJS 的新手,有点迷茫。我想请教一些正确入门的建议。
我们有一个不是用 EmberJS 构建的 SaaS。我正在尝试重构它的一部分并为此使用 EmberJS。
我们的软件实现了命令模式。这意味着我们向服务器发送操作(JSON 对象)以创建、更新和删除(也 undo/redo)我们的模型对象。
我真的不能为此使用适配器,因为它们接缝是为 REST 接口创建的,但我们没有为该部分使用 REST。
您绝对需要使用面向 REST 的 Ember-data
。参见 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。我相信最后一个例子是一个很好的起点。
我是 EmberJS 的新手,有点迷茫。我想请教一些正确入门的建议。
我们有一个不是用 EmberJS 构建的 SaaS。我正在尝试重构它的一部分并为此使用 EmberJS。
我们的软件实现了命令模式。这意味着我们向服务器发送操作(JSON 对象)以创建、更新和删除(也 undo/redo)我们的模型对象。
我真的不能为此使用适配器,因为它们接缝是为 REST 接口创建的,但我们没有为该部分使用 REST。
您绝对需要使用面向 REST 的 Ember-data
。参见 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。我相信最后一个例子是一个很好的起点。