From: "Hal E. Fulton" Date: 2001-11-02T05:04:04+09:00 Subject: [ruby-talk:24111] Modularity question Opinion question for you all. Not *purely* Ruby-related, but I am coding in Ruby and will especially appreciate any Ruby-like tricks that I may not have thought of... I'm about to start coding an app. Will let you know more when it's finished. :) Besides the "main logic" it will have a component that manipulates external data and a component that handles the interface. I want these to be as discrete from each other as possible. It's a "separation of concerns" issue (and a relatively easy one, no AOP involved, I think). For one thing, I want to allow at least two different UIs (graphical (Tk?) and text-based), and I want the possibility of changing the graphical part later without too much difficulty -- maybe even adding a web interface or some other. As for the database part, I'm uncertain as to whether I want to use simple marshaling or DB or even MySQL. But I don't want to be "tied" to however I first implement this. My first thought is to have a very high-level interface that simply handles things in a way utterly transparent to the main logic -- using calls that mean "ask the user for a yes or no response" or "get the object that corresponds to this name or key." I could then (for the UI) do a different "require" based on a command line parameter or whatever. But I can't help feeling that I'm overlooking a chance to Do Something the Right Way. Anyone have opinions on this? Hal