global variables in main()
is it bad oop practice to keep all your global constants in main() and have your other classes access them from there?
also, would anyone happen to know of a good online resource that addresses proper oop practices and goes beyond explaining the foundation stuff like inheritence, encapsulation, polymorphism, etc.?
[328 byte] By [
pete_c12a] at [2007-10-2 21:45:53]

if all of your constants are specific only to the application, then keeping them in the main class won't hurt anything.
however, if you are going to create a class, say circle, and wanted to define a constant BigDecimal that was an EXTREMELY accurate version of PI, you would not want to put that in your main class, you would want to put that in your circle class, because that way you have access to it where ever you use the circle class.
so my answer is, put it in the class it is most closely related to.
- Adam