On Thu, May 2, 2013 at 9:36 AM, Daniel Kinzler <[email protected]> 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

_______________________________________________
Wikitech-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Reply via email to