2007/11/5, Russell Blau russblau@imapmail.org:
"Merlijn van Deen" valhallasw@arctus.nl wrote:
One module per class
I'd make an exception to this one to allow including subclasses in the same module, such as Page, ImagePage, and Category.
One module per class is a bit too much of a javaism for me too. It is not really efficient since it requires quite a lot of "import"s in the code, and actually finding a class becomes quite expensive!
On unit testing -- it may be difficult to write unit tests for methods that access the wiki, because the value returned will depend on the contents of the wiki at any given time. Maybe if we have a dedicated test wiki with at least some pages that are locked, so that they give predictable values, that would be a way around the problem.
You are talking about testing, not unit testing. For unit testing you will not need a sensibly filled wiki. The code that needs sensible data will be tested separately from the wiki-fetching code. Each piece of separable functionality should be tested separately with true unit tests.
Rob