From: stephan b. <st...@s1...> - 2004-12-29 00:03:23
|
Okay, this point is really bugging me, and i couldn't sleep... Please understand: i'm not complaining to anyone here, i'm just trying to express how important a solid dependencies model is on flexible software. At the end of this mail i detail the short list of things we need to do to reach a "well-dependencied" tree. i've been playing around on paper, and i've found a deps tree which: a) i really like. b) is extremely close to what we have now. Unfortunately, i can't copy my drawing into the mail. i will try to express it in "flat form" here. Assumption #0: Core depends on no other P Modules. Period. Assumption #1: all modules depend on the Core. This is a fair assumption, even if it isn't 100% technically true. Assumption #2: all modules except Core depend on Util. This is almost 100% true, but not quite. Assumption #3: all modules depend on themselves. Sounds silly, but it is significant. When i write: A ==> B That means module A has a direct dep on module B. A uses B. Thus: A <==> B is circular, and therefore Evil. Now, here are the deps as i BELIEVE them to be currently: (Reminder: Unicode and s11n's core are handled by Assumptions #1 and #2.) System ==> Unicode System ==> IO Net ==> IO Net <==> System (only timeout.h) SIO ==> (s11n and s11n::io) s11n::io ==> s11n (s11n Plugins ===> may freely dep on any P module That's all fairly good - i'm fairly happy with that :). Now comes the problem: Util ==> IO (only because of the Prefs' throw IOError) Util ==> System (only classes ThreadPool and WorkerQueue) That means that ALL other modules have a dep on IO and System. Nothing is standalone :(. Nothing! Actually, we're much closer than i thought! i thought Unicode had a dep on Util, and that IO had a dep on System, but this does not appear to be the case (after some grepping) :). So, here is what i propose we do: a) Change Util::Prefs to throw Error instead of IOError. IMO this is a much better solution for Prefs' API, anyway. b) Move the thread-related Util stuff into Thread (==> System) or into System. c) Is Net's dep on timeout.h really significant? This seems like an extremely low-level detail which we could overlook? If nobody objects, i will happily do (a) and (b). "i await your command..." (And now i'm really going to bed...) -- ----- st...@s1... http://s11n.net "...pleasure is a grace and is not obedient to the commands of the will." -- Alan W. Watts |