Jeff's Rule of StaticsFinally, there is what I immodestly call Jeff's Rule of Statics:
The simple rule comes about from observing first Java development efforts. A little knowledge goes a long way. A little knowledge about statics often leads developers to use them rampantly. My philosophical opposition to overuse of statics is that they are not object-oriented. The more static methods you have in your system, the more procedural it isit becomes a bunch of essentially global functions operating on global data. My practical opposition is that improper and careless use of statics can cause all sorts of problems, including design limitations, insidious and bizarre defects, and memory leaks. You will learn when it is appropriate to use statics and when it is not. Make sure that you do not use a static unless you understand why you are doing so. |