On Thu, May 2, 2013 at 9:36 AM, Daniel Kinzler <daniel(a)brightbyte.de> wrote:
1) The "composition" approach, using:
[...]
Disadvantages:
* more classes
* ???
* A lot of added complexity
2) The "subclassing" approach, using:
[...]
3) Instead of making a bunch of one-public-method classes used only by
ApiQueryLangLinks, just put the logic in methods of ApiQueryLangLinks.
Advantages:
* Everything is in one file, not lost in a maze of twisty little classes.
* These methods could still be written in a "composition" style to be
individually unit tested (possibly after using reflection to set them
public[1]), if necessary.
Disadvantages:
* If someone comes up with someplace to reuse this, it would need to
be refactored then.
[1]:
http://sebastian-bergmann.de/archives/881-Testing-Your-Privates.html
--
Brad Jorsch
Software Engineer
Wikimedia Foundation