in reply to Re: general rule for using use
in thread general rule for using use
I think what I'm getting at is that using Order in X is misguided. When we say that doSomething() operates on an Order object, we are really saying that it operates on an object that behaves like an Order. It could be an instance of Order or an instance of a sub-class or just a mocked-up object that implements enough of the methods of an Order to make it look like an Order to doSomething().
There may be no harm in including it, but on the other hand I can't think of a compelling reason to do so. If a real instance of Order will get passed to doSomething, then the caller can be responsible for ensuring that the Order name space is loaded.
Perhaps I forgot to mention that this particular application consists of 800+ modules, and all of that unnecessary module loading is a big drag on unit testing.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: general rule for using use
by targetsmart (Curate) on Apr 09, 2009 at 05:38 UTC | |
by drench (Beadle) on Apr 09, 2009 at 17:48 UTC | |
|
Re^3: general rule for using use
by moritz (Cardinal) on Apr 19, 2009 at 11:36 UTC |