It would be hard to completely separate the view and controller. One
thing I suggest is to modularize UI code into Widgets to keep your
view/controller code small and maintainable. I think this is common in
GUI land. You have a bunch of little controller/views and you aggregate
them into the main controller/view. Of course, separating the model part
is easy.
doug livesey wrote:
Would the UI code not get really messy?
I have very little experience with complex UIs, so don't know, but
remember an OpenLaszlo book recommending that you extract any state
changes your UI undergoes into some kind of state controller that got
called with things like "state_controller.transition(
'to-display-product', ... )". I'm paraphrasing incredibly heavily
there, not least because the examples in the book were in LZX, not Ruby.
But then, that state controller could get called by the
business/modularised controllers when they added or indexed or deleted
or whatever.
Or am I muddying the waters horribly, here?
Wouldn't be the first time. ;)
�� Doug.
2009/4/20 Joel Fernandes <[email protected]
<mailto:[email protected]>>
Hi Doug,
That sounds great, except for the part where you would have to
separate drawing (view) from the event handling (controller).
For example
button("my button").click do
� � somemodel.dosomething
� � widget1.draw
� � somemodelother.dosomething
end
I guess you could start off with 2 layers, a "model" and a
"controller/view".
Joel
On Sun, Apr 19, 2009 at 5:52 PM, doug livesey <[email protected]
<mailto:[email protected]>> wrote:
> So, do you think you could have, say:
> 1) A models folder, with business objects in it.
> 2) A widgets folder, with the actual widgets.
> 3) A controllers folder, with modules named for sensibly
modularised parts
> of the app, that event handlers call methods on.
>
> Would that make sense?
> Cheers,
> �� Doug.
>
> 2009/4/19 Joel Fernandes <[email protected]
<mailto:[email protected]>>
>>
>> MVC would actually play very well:
>>
>> Model - the logical entities of your app, as Widgets or Objects.
>> View - drawing elements, widgets, layout
>> Controller - your event handlers (click, hover etc..)
>>
>> Joel
>>
>> On Sun, Apr 19, 2009 at 3:38 PM, doug livesey
<[email protected] <mailto:[email protected]>> wrote:
>> > Hi -- I'm mainly a Rails coder, so am used to having a
full-featured MVC
>> > framework do a lot of my thinking for me when it comes to
application
>> > structure & organisation.
>> > I've been thinking of ways that I can adapt the rails way of
organising
>> > things to Shoes, but of course they are different paradigms,
so was
>> > wondering if there were any, more desktop-app-driven
>> > approaches/frameworks
>> > that people used with shoes?
>> > Cheers,
>> > �� Doug.
>> >
>>
>>
>>
>> --
>> joel
>
>
--
joel