-
1. Re: Design Question/Say Best Java Practice.
jonlee Dec 2, 2003 11:30 PM (in response to vashistvishal)Pragmatically, I would say it depends on usage and organisation.
Suppose that the constants are used more by "users" of the implementation rather than the implementors, you would put it in the interface because you are using the interface to "isolate" the user-developer from the implemented class. Otherwise, you may not want to "expose" these constants and keep it with the final or implemented class - this is only a physical packaging distinction.
If you aren't using an interface, you need to decide on what is the most relevant class related to the global constants.
There are no absolutes, but if you are using interfaces it probably makes more sense to go with the interface (except if those who use the interface don't use the global constants).
MHO. -
2. Re: Design Question/Say Best Java Practice.
vashistvishal Dec 3, 2003 6:49 PM (in response to vashistvishal)Appreciate yr views here.
Thanks Jonlee.