Probably, I would just check the outcome of the method instead of checking
interaction with a constant.
Craig
So you guys wouldn’t worry about the spec for class A being coupled to this
constant in class B?
Since class A is coupled to class B, the specs for A are also coupled to
class B through class A. Thus, I wouldn’t worry about the coupling. Why
does
a method of class A directly access a constant of class B? Does the
constant
belong in class A? Does the method belong in class B? If you can and
want to
be more specific with your code and specs, I’m sure that we can all
write
some specs together.
Since class A is coupled to class B, the specs for A are also
coupled to class B through class A. Thus, I wouldn’t worry about the
coupling. Why does a method of class A directly access a constant of
class B? Does the constant belong in class A? Does the method belong
in class B? If you can and want to be more specific with your code
and specs, I’m sure that we can all write some specs together.
Cool. Having seen something a little more concrete, I like your design
decisions. In this case, I’d go with Scott’s recommendation of hiding
the
constant behind a method.
Cool. Having seen something a little more concrete, I like your
design decisions. In this case, I’d go with Scott’s recommendation
of hiding the constant behind a method.
Regards,
Craig
Thanks for taking a look, Craig, and giving me your opinion.