Re: Decoupling musing



On Sun, 20 Nov 2005 17:44:51 GMT, "VisionSet" <spam@xxxxxxxxxxxx>
wrote, quoted or indirectly quoted someone who said :

> X x = myClassOfX.newInstance();

The catch with this approach is you must use a no-arg constructor.
That means you have to do everything you normally would do in the
constructor via setter methods. Your no-arg constructor hatches
malformed objects in many cases that really should not see the light
of day until they have had some setters run. You lose the nice
ability of the constructor to only allow fully formed
logically-consistent objects out into the world.

--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
.