From: Vladimir Dozen Date: 2002-03-12T00:50:21+09:00 Subject: Re: packages (jar-alike) ehlo. > Actually this is the reason why putting them into one single file > makes more sense. But let's entertain the idea that you have hundreds > of dissimilar classes each in its own file. I just explained things wrong. The files are of two group -- static engine files (kernel) and replacable set of (possibly) user-supplied classes implementing various strategies. For example, there might be two or more NearestNeighbourFinder class, and only one can be used for given set of data; kernel loads one of implementation and directly creates objects of that type =============================== load "SimpleNearestNeighbourFinder.rb" if ... load "BufferedNearestNeighbourFinder.rb" if ... load "AdvancedNearestNeighbourFinder.rb" if ... load @UserSuppliedName if ... ... nnf = NearestNeighbourFinder.new(...) ================================ Each file has definition of class with the same name, that's why they can't be put in single file. > 1. Put them into directories. Each time your program runs, iterate > over all the files in that directory and require'd each one. This > is a 3-line code (OK, I lied, it's short enough to be a 1-liner). That's how I plan to do it now. I just dislike to navigate in this directory tree. It would be nice if, for example, all classes from specific user would be stored in single file. > 2. If directory is too mesy, use zip or tar.gz. Same approach as > directory, but you can package them in one neat file. How? dozen