Optimize with a SATA RAID Storage Solution
Range of capacities as low as $1250 per TB. Ideal if you currently rely on servers/disks/JBODs
Java Toolbox
"Why extends is Evil"
Allen Holub
Differentiating derivation and encapsulation
Allen,
I don't understand the difference between extension by derivation and extension by encapsulation. I think both are the same.
To explain this, let me write the same Monitorable_Stack class in Listing 0.1 as an extension, and then please kindly explain the difference to me.
35| class Monitorable_Stack extends Simple_Stack
36| {
37| private int high_water_mark = 0;
38|
Nishant Kumar
"More JSP Best Practices"
Dustin Marx
Zip up TLD files
Dustin,
There's a JavaServer Pages (JSP) best practice you didn't mention, and, if used, would obsolete one of the other practices you described.
In particular, you can package JSP tag libraries in their jar file with the TLD (Tag Library Descriptor) file in the META-INF directory. If taglib directives in the JSP pages use the Uniform Resource Identifier (URI) specified in the TLD, then you don't need to package
the TLD for the tag library separately (you remove the need to create a tld subdirectory of WEB-INF), and the web.xml file does not have to specify the tag library.
David Karr
XHTML use
Dustin,
In your article, you advocate the use of JSP documents and XHTML as opposed to JSP pages and vanilla HTML. I agree that this
is cleaner, but I am hampered because there doesn't seem to be a way to generate a <DOCTYPE> declaration for the resulting XHTML page without causing a JSP compile error.
DOCTYPES are necessary for generating XHTML pages and for standards-compatible Cascading Style Sheets (CSS) rendering on Internet
Explorer 6.x browsers.
Tarun Ramakrishna Elankath
Java Design Patterns
"Make Your Apps Fly"
David Geary
On the Smalltalk defensive
David,
Your comments about Smalltalk were misinformed and wrong. You state:
Object-oriented design is sometimes at odds with performance. From a design standpoint, it's best to encapsulate everything in an object so you can treat those objects uniformly, reuse them, and extend them. Unfortunately, modeling everything as an object can be expensive performance-wise. A case-in-point is Smalltalk, which literally models everything as an object, as opposed to Java, which provides a mix of objects and intrinsic types. Today, Java is much more prevalent than Smalltalk, due in no small part to Java's better performance.
Java did not become more popular than Smalltalk because of performance. Smalltalk performance has not been an issue for years, and Smalltalk performance was much better than Java performance in Java's early years. Java won out for the same reason that Microsoft Windows won: marketing.
In fact, Smalltalk makes extensive use of the Flyweight pattern for performance reasons. In Smalltalk, for example, everything including numbers is an object. Numbers are represented as flyweight objects; there is only one instance of the number five in a Smalltalk VM. The everything-is-an-object philosophy leads to a consistent language with no need for all the kludges Java has had to introduce to get around the primitive object dichotomy.