2

can I have some examples of how you organize your Shoes apps? I mean, simply using a Shoes.app{} block and instance variables is clumsy.. I'd like to achieve a MVC like structure.. I'm used to it (from rails, FLEX frameworks and others..) and would like to recreate something similar..

4

2 回答 2

2

我通常处理这个问题的方法是通过以下分离:

  • 模型- 您的普通模型代码/业务逻辑(适合测试!)
  • 选项卡/视图- 应用程序中嵌入的不同菜单项的单独视图

为了实现后者,我提取了一个小插槽处理库,该库尚未提取到其单独的 gem 甚至存储库(在这里等待 shoes4)。

所需的文件在我的 pomdoro 跟踪器项目中——它是 slot.rb、slot_manager.rb 和 dynamic_slot.rb——你可以看到它们在上述项目中被使用。

基本上,插槽管理器隐藏旧视图并根据请求加载新视图。此代码最初是从hackyhack 选项卡中提取的。

希望有帮助!

于 2012-11-09T13:56:41.833 回答
0

我会看看一些开源鞋类应用程序,看看开发人员是如何组织它们的。可在以下网址找到大量鞋类产品:http: //the-shoebox.org/

于 2010-05-09T05:33:29.070 回答