Re: Could an object refuse to be created!?
From: Sunny (sunnyask_at_icebergwireless.com)
Date: 05/16/04
- Next message: MAY: "Re: Mouse coordinate"
- Previous message: Frans Bouma [C# MVP]: "Re: Treeview selectednode problem/question"
- In reply to: Justin Rogers: "Re: Could an object refuse to be created!?"
- Next in thread: Nicole Calinoiu: "Re: Could an object refuse to be created!?"
- Messages sorted by: [ date ] [ thread ]
Date: Sun, 16 May 2004 08:53:10 -0500
Good point.
Sunny
Justin Rogers wrote:
> Would be nice to note, that in cases where your object creation is linked
> to valid input criterion, that you might instead use a factory method.
> Factory methods demonstrate, better than constructors, that work is going
> to occur
> and that validation of parameters might be necessary. Factory methods are
> also capable of returning null rather than throwing an exception. To then
> prevent the user from instantiating your type directly, you simply
> privatize the constructor.
>
>
- Next message: MAY: "Re: Mouse coordinate"
- Previous message: Frans Bouma [C# MVP]: "Re: Treeview selectednode problem/question"
- In reply to: Justin Rogers: "Re: Could an object refuse to be created!?"
- Next in thread: Nicole Calinoiu: "Re: Could an object refuse to be created!?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|