Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > GUI and non-GUI data

Reply
Thread Tools

GUI and non-GUI data

 
 
Hal Fulton
Guest
Posts: n/a
 
      08-05-2004
I'm refactoring some ugly code and looking for some general
high-level advice.

I'm always rather at a loss when it comes to separating the GUI-related
data from the non-GUI data.

For example, a Note might have certain attributes. But a NoteWidget, which
would know about a Note, would have different (GUIish) attributes.

But I'm a little uncomfortable with this separation, and I always end up
with a certain tangling anyway.

How do you handle this sort of issue?


Hal



 
Reply With Quote
 
 
 
 
Austin Ziegler
Guest
Posts: n/a
 
      08-05-2004
On Fri, 6 Aug 2004 05:13:07 +0900, Hal Fulton <(E-Mail Removed)> wrote:
> I'm refactoring some ugly code and looking for some general
> high-level advice.
>
> I'm always rather at a loss when it comes to separating the GUI-related
> data from the non-GUI data.
>
> For example, a Note might have certain attributes. But a NoteWidget, which
> would know about a Note, would have different (GUIish) attributes.
>
> But I'm a little uncomfortable with this separation, and I always end up
> with a certain tangling anyway.
>
> How do you handle this sort of issue?


It varies. I think we're using a variety of things in Ruwiki (not gui,
per se, but still). The backends are handled through delegates. The
tokens are handled through inheritance. Both are right for the choices
made.

I think I did a decent job of allowing for alternative FEs to
RTidy/CD, although I don't think much of the rest of the code in the
app at this point (my first "big" Ruby program).

If a single NoteWidget can represent one of any number of Notes, then
delegation is probably the right choice. If the GUI will create a
NoteWidget for each Note, then inheritance is the right choice ...
IMO. Someone else will probably have a different opinion.

-austin
--
Austin Ziegler * http://www.velocityreviews.com/forums/(E-Mail Removed)
* Alternate: (E-Mail Removed)


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Baseline GUI Architecture (was: Baseline GUI Prototype?) Stefan Ram Java 3 11-20-2011 02:18 AM
PyGTK GUI update without signals from GUI Andrew Lapidas Python 0 04-12-2008 11:07 PM
[Gui] Which GUI is available with Ruby? Flaab Mrlinux Ruby 3 11-15-2006 11:44 PM
GUI - GUI value passing paul.foreman Java 5 10-25-2004 08:06 AM
[PY GUI] interest function in python GUI(wxpython,pyqt) program.wxpython,pyqt ulysses Python 4 10-22-2003 03:28 PM



Advertisments