<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
<div><br class="webkit-block-placeholder"></div><div><br class="Apple-interchange-newline"></div><br><div><div>On 21 Sep 2007, at 21:22, Duane Johnson wrote:</div><blockquote type="cite"><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="4" style="font: 14.0px Helvetica"> With this architecture, we could take  </font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="4" style="font: 14.0px Helvetica">advantage of inheritance in the OO way (as well as map exceptions to  </font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="4" style="font: 14.0px Helvetica">actions the OO way):</font></div></blockquote></div><div><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><div><br class="khtml-block-placeholder"></div><div>I think this is an interesting point! </div><div><br class="webkit-block-placeholder"></div><div><br></div><div><br class="webkit-block-placeholder"></div><div>With more of my projects taking the REST view on the world, I'll often have a base controller with common create/update/show/delete methods, that I then overide if they need modifying.</div><div><br class="webkit-block-placeholder"></div><div>By taking an approach where actions are classes, this situation might be improved.</div><div><br class="webkit-block-placeholder"></div><div>Worth thinking about ... but is quite a step away from the current "way" that it's not going to be an easy switch.</div><div><br class="webkit-block-placeholder"></div><div>might the idea maybe be to have:</div><div><br class="webkit-block-placeholder"></div><div>app/controllers/users/index.rb</div><div><br class="webkit-block-placeholder"></div><div>class Users::Index &lt; Users::Action</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>def to_html<br class="webkit-block-placeholder"></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>render<br class="webkit-block-placeholder"></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>end<br class="webkit-block-placeholder"></div><div><br class="webkit-block-placeholder"></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>def to_xml<br class="webkit-block-placeholder"></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>'&lt;xml/&gt;'<br class="webkit-block-placeholder"></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>end</div><div>end</div><div><br class="webkit-block-placeholder"></div><div>which then renders the template at</div><div><br class="webkit-block-placeholder"></div><div>app/views/users/index.html.erb</div><div><br class="webkit-block-placeholder"></div><div><br class="webkit-block-placeholder"></div><div>where Users::Action is the base "action" class for users (where you would put all your methods that all user actions require) and Users::Action is inherited from Application::Action (where all the app-level methods are) which is a Merb::Action</div><div><br class="webkit-block-placeholder"></div><div>I think the GetAction idea is poor and all that sort of logic should stay in the router code.</div><div><br class="webkit-block-placeholder"></div><div>I like the ideas of the matching up of the action.rb file and the template.erb, but I'm not entirly convinced, the directory structures in /controller and /views would be nicely mirrored.</div><div><br class="webkit-block-placeholder"></div><div><br class="webkit-block-placeholder"></div><div>anyway this is all very theoretical, more things for the _ry-experimental-playground-branch ;)</div><div><br class="webkit-block-placeholder"></div><div><br class="webkit-block-placeholder"></div><div><br class="khtml-block-placeholder"></div><div><br class="khtml-block-placeholder"></div><div><br class="khtml-block-placeholder"></div><div>Regards</div><div><br class="khtml-block-placeholder"></div><div>Farms.</div><div><font class="Apple-style-span" color="#BDBDBD" size="3"><span class="Apple-style-span" style="font-size: 12px;; color: rgb(189, 189, 189); "><br class="khtml-block-placeholder"></span></font></div></span></span></span></span></div><br></body></html>