From: Ryan Leavengood Date: 2001-11-02T05:34:46+09:00 Subject: [ruby-talk:24114] Re: Modularity question > 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). Well I think "separation of concerns" or orthogonality is always A Good Thing (as expressed in the PragProg book.) So you are on the right track as far as that is concerned. > 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. Way back when I first starting programming professionally I came up with the concept of a "database wrapper" that abstracted away the data store into an object. This was before I had learned of patterns, but it is the same kind of concept expressed in some patterns. I still think this is a good idea. That way you can change the implementation details (where the information is coming from), without having to change the clients of the code. But this is pretty basic OO stuff, so I'm probably not enlightening too many people on this list ;) But one thing I will point out in this case is that I'm not just talking about a DBI system where you aren't concerned whether you are talking to MySQL or DB2 or SQL Server. I'm saying that you don't even care if the data is coming from a SQL database, a text file, or from some network. You just know when you call .name() on a person object you get that person's name. Of course I guess this is really just about proper encapsulation, which again is probably something most of you guys already know a lot about. > But I can't help feeling that I'm overlooking a chance to > Do Something the Right Way. > > Anyone have opinions on this? Well as I continue to learn about XP and try to use its concepts more, I can't help but feel that issues like this are cases of BigDesignUpFront. Maybe you are trying too hard to predict the future use of your code? Of course if one of the explicit requirements is "the application will have pluggable interfaces", then maybe this is something that needs to be considered. I'm not sure on that really, since like I said I'm still experimenting with XP. So for any of you XP gurus in the audience: if I find myself thinking a lot about some design issue like Hal's, am I on the wrong track? Ryan Leavengood