Re: Decoupling musing
- From: Roedy Green <my_email_is_posted_on_my_website@xxxxxxxxxxxxxx>
- Date: Sun, 20 Nov 2005 23:14:16 GMT
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.
.
- Follow-Ups:
- Re: Decoupling musing
- From: Andrew McDonagh
- Re: Decoupling musing
- From: VisionSet
- Re: Decoupling musing
- References:
- Decoupling musing
- From: VisionSet
- Decoupling musing
- Prev by Date: Re: short circuit evaluations
- Next by Date: Re: Decoupling musing
- Previous by thread: Re: Decoupling musing
- Next by thread: Re: Decoupling musing
- Index(es):