Re: Singleton
From: Hoff, Todd (todd_at_possibility.com)
Date: 10/30/03
- Next message: Topmind: "Re: OO's best feature survey results"
- Previous message: Daniel T.: "Re: Help me find the pattern..."
- In reply to: Michael Feathers: "Re: Singleton"
- Next in thread: Michael Feathers: "Re: Singleton"
- Reply: Michael Feathers: "Re: Singleton"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 30 Oct 2003 06:31:35 GMT
"Michael Feathers" <mfeathers@objectmentorNOSPAM.com> wrote:
> Yes, its doable. The hard parts are knowing which ones you need, and
> what states they are supposed to be in. Then, usually, you have to add
> something like a static setter to rig them for test.
This is the equivalent of destroying an object used in the
test. If you remember to do that you can remember to do
the reset. With the singleton i'll at least assert when
i try to set the singleton again on the next test run.
With objects passed around this will never happen and
the code will always seem to work. Been there.
-- Do a caterpillar and butterfly speak the same language?
- Next message: Topmind: "Re: OO's best feature survey results"
- Previous message: Daniel T.: "Re: Help me find the pattern..."
- In reply to: Michael Feathers: "Re: Singleton"
- Next in thread: Michael Feathers: "Re: Singleton"
- Reply: Michael Feathers: "Re: Singleton"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]