Architechting a FXRuby app

View: New views
3 Messages — Rating Filter:   Alert me  

Architechting a FXRuby app

by Martin Trejo :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi list,

I'm new to FXRuby and been reading and toying with it for a couple of months. Now I'm on the process to start a new app but I'm not sure on how to design this kind of application, GUI to say.

I've been working the last two years with Ruby On Rails and the MVC pattern is quite familiar to me. I've also developed with other technologies, mainly .NET in web and desktop with Windows Forms.

As I've done some searching and reading, found that desktop applications are more for MVP (Model-View-Presenter) pattern than MVC and this is because of the interaction of the controls (widgets) with the other elements. I haven't found a sample of MVP implementation with Ruby nor FXRuby and I'm wondering if this pattern could apply to build an application with this framework.

Is there any guide? sample? pattern?

Regards,

Martín Trejo Chávez



_______________________________________________
fxruby-users mailing list
fxruby-users@...
http://rubyforge.org/mailman/listinfo/fxruby-users

Re: Architechting a FXRuby app

by Meinrad Recheis :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, Sep 14, 2009 at 8:43 PM, Martin Trejo <chilli.coder@...> wrote:
Hi list,

I'm new to FXRuby and been reading and toying with it for a couple of months. Now I'm on the process to start a new app but I'm not sure on how to design this kind of application, GUI to say.

I've been working the last two years with Ruby On Rails and the MVC pattern is quite familiar to me. I've also developed with other technologies, mainly .NET in web and desktop with Windows Forms.

As I've done some searching and reading, found that desktop applications are more for MVP (Model-View-Presenter) pattern than MVC and this is because of the interaction of the controls (widgets) with the other elements. I haven't found a sample of MVP implementation with Ruby nor FXRuby and I'm wondering if this pattern could apply to build an application with this framework.
I thought MVP stands for Microsoft most Valuable Professional.

Just kidding. I'd read Martin Fowler's http://www.martinfowler.com/eaaDev/uiArchs.html#Model-view-presentermvp , he is the guy who defined it so as it is understood nowadays. FXRuby has no framework such as Rails to magically support MVC so you need to handcraft it all by yourself. But in my opinion MVP is a highly overengineered pattern that is not really necessary for standard application design. So if you are not sure, just go for MVC (especially if you know it better) it's good enough.
 

Is there any guide? sample? pattern?

Haven't yet come across one for FXRuby yet. Most people I know just derive a class from FX::Window and put all the business logic in there. I am using MVC by separating the model from the gui code but leave view and controller highly coupled (i.e. together in one class) as there is mostly no benefit in separating V and C, or you could say it is MVP without a P. Sometimes, when I identify a reusable behaviour in my view I refactor it out into a separate controller and reuse it on other views --> which means the question should not be "MVC or MVP?" ... you can combine the two if there is need. When you need a class between model and view in order to keep your model from exposing a view-specific interface use MVP, otherwise it's just overkill IMHO.

Cheers,
-- henon


Regards,

Martín Trejo Chávez



_______________________________________________
fxruby-users mailing list
fxruby-users@...
http://rubyforge.org/mailman/listinfo/fxruby-users


_______________________________________________
fxruby-users mailing list
fxruby-users@...
http://rubyforge.org/mailman/listinfo/fxruby-users

Re: Architechting a FXRuby app

by Martin Trejo :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

Thank you for the answer.


On Mon, Sep 14, 2009 at 2:56 PM, Meinrad Recheis <meinrad.recheis@...> wrote:
On Mon, Sep 14, 2009 at 8:43 PM, Martin Trejo <chilli.coder@...> wrote:
Hi list,

I'm new to FXRuby and been reading and toying with it for a couple of months. Now I'm on the process to start a new app but I'm not sure on how to design this kind of application, GUI to say.

I've been working the last two years with Ruby On Rails and the MVC pattern is quite familiar to me. I've also developed with other technologies, mainly .NET in web and desktop with Windows Forms.

As I've done some searching and reading, found that desktop applications are more for MVP (Model-View-Presenter) pattern than MVC and this is because of the interaction of the controls (widgets) with the other elements. I haven't found a sample of MVP implementation with Ruby nor FXRuby and I'm wondering if this pattern could apply to build an application with this framework.
I thought MVP stands for Microsoft most Valuable Professional.

:P jajajaja
 
Just kidding. I'd read Martin Fowler's http://www.martinfowler.com/eaaDev/uiArchs.html#Model-view-presentermvp , he is the guy who defined it so as it is understood nowadays. FXRuby has no framework such as Rails to magically support MVC so you need to handcraft it all by yourself. But in my opinion MVP is a highly overengineered pattern that is not really necessary for standard application design. So if you are not sure, just go for MVC (especially if you know it better) it's good enough.
 

Is there any guide? sample? pattern?

Haven't yet come across one for FXRuby yet. Most people I know just derive a class from FX::Window and put all the business logic in there. I am using MVC by separating the model from the gui code but leave view and controller highly coupled (i.e. together in one class) as there is mostly no benefit in separating V and C, or you could say it is MVP without a P. Sometimes, when I identify a reusable behaviour in my view I refactor it out into a separate controller and reuse it on other views --> which means the question should not be "MVC or MVP?" ... you can combine the two if there is need. When you need a class between model and view in order to keep your model from exposing a view-specific interface use MVP, otherwise it's just overkill IMHO.

The point is that the plan for my app is without many windows, more like the shutter example and then found that fxswitcher may help.

Then instead of having many windows I might have many panels to instantiate on the fxswitcher, just like a controller rendering a view (<= railese talking) but thought of a presenter because of the interaction of controls and events.

Cheers,
-- henon

And kudos for foxGUIb!!!

Regards,

Martín Trejo Chávez



_______________________________________________
fxruby-users mailing list
fxruby-users@...
http://rubyforge.org/mailman/listinfo/fxruby-users


_______________________________________________
fxruby-users mailing list
fxruby-users@...
http://rubyforge.org/mailman/listinfo/fxruby-users


_______________________________________________
fxruby-users mailing list
fxruby-users@...
http://rubyforge.org/mailman/listinfo/fxruby-users