Hey,

James wrote down a great list of advice. There is however one point I would
advice against following:

* Avoid turning protected/private into public methods unless it is
> necessary and instead use the ReflectionClass [a.10] for testing (SMW
> has as several tests that is following this schema)
>

If methods are protected or private, one should not test them directly as
this breaks encapsulation. They should be viewed as being inline code of
the public methods. If testing all this logic through the public methods is
to complex, it likely means your object is doing to much and needs to be
split up or that there is some other design issue you ought to take care
off.

See slide 12 of this excellent webinar for more info:
https://www.zend.com/flvplayer.swf?file=http://files.zend.com/webinar/70170000000bk4b-testablecode-20120315.flv&autoStart=true

Cheers

--
Jeroen De Dauw
http://www.bn2vs.com
Don't panic. Don't be evil.
--
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and 
their applications. This 200-page book is written by three acclaimed 
leaders in the field. The early access version is available now. 
Download your free book today! http://p.sf.net/sfu/neotech_d2d_may
_______________________________________________
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel

Reply via email to