SPECIAL OFFER
Use code BACKTOLEARN during checkout to save 50% on books, eBooks, & videos. Shop now.
Register your product to gain access to bonus material or receive a coupon.
The first Java guide specifically for experienced ColdFusion developers and Web professionals!
With ColdFusion MX and this book, any Web professional can leverage the power of Java to build robust, high-performance Web applications. Leading Web developer and columnist Eben Hewitt begins with a rapid-fire introduction to Java that builds on what you already know about ColdFusion to teach you exactly what you need to know about Java programming. Hewitt's focused examples, real-world insights, and code will take you from the basics of object-oriented programming to sophisticated JSP/servlet development, XML-based applications, and beyond!
The bookÕs extensive code examples (downloadable from www.corecoldfusion.com) include a start-to-finish Java e-commerce application.
Java Objects and Classes in ColdFusion
Foreword.
Acknowledgments.
1. Introduction.
Why Java for ColdFusion Developers? Who This Book Is For. What This Book Is Not. Overview of Book Sections.
The New ColdFusion Architecture. Benefits of Moving to the Java Technology Platform. The Java Platform. Gathering Your Tools. Anatomy of a Simple Java Program. Understanding the API. Exercise 1: Download and Install the SDK. Exercise 2: Using the API Documentation.
Binary Overview. Data Types in ColdFusion. Data Types in Java. Primitive Data Types. Variable Assignment and Initialization. Operators. Overflow. Operator Precedence. Casts and Conversions. Java Standard Classes. What's Next.
Wrapper Classes. Strings. Loops. Arrays. Conditional Logic. Example Program: CheckerBoard.java. Example Program: Debt Calculator. Command Line Input. Using Methods: Toward Object-Oriented Programming. Visibility. Composition of the main Method. What's Next?
Objects. Why Software Projects Fail. Software Development Processes. Case Study: Bookstore. Introduction to OOAD. Use Cases. Creating UML Diagrams. Class Diagrams. User Scenarios and Use-Case Diagrams. Collaboration Diagrams. Sequence Diagrams. Package Diagrams. Encapsulation. Inheritance. Software and Hollywood Movies. What's Next?
Macromedia Editor Changes and Java IDEs. Projects. Dreamweaver MX. Sun ONE Studio 3 (Forte for Java). Jbuilder. IntelliJ IDEA. Putting Your IDE to Work. What's Next.
Packages. Documentation with JavaDoc. Field Defaults and Field Initializers. Polymorphism. Constructors. static Methods. The this Reference. Stack and Heap Memory. Putting Things Together. What's Next.
Exceptions. What's Next.
Inner Classes. Inheritance. Abstract Classes and Abstract Methods. Interfaces. Final. Reflection. What's Next?
Configure ColdFusion Server Settings for Java. Using <cfobject>. CFX Custom Tags. Applets. Using Applets with <cfapplet>. Working with Browsers and the Java Plugin. Swing and AWT. What's Next?
Synchronization and <cflock>. ColdFusion Structures. Collections Overview. General Collections Methods. Collections Interfaces. Collection Classes. Lists. Sets. Maps. Using Regular Expressions. What's Next.
Using JDBC. Metadata. Transactions. Stored Procedures. Example GUI Application: Database Query Viewer. What's Next.
Using Java Technology to Create Web Sites. Compare ColdFusion and Java Web Technologies. ColdFusion MX J2EE Capabilities. Java Web Servers. Installing Tomcat. Configuring JSP Web Applications. Creating a Tomcat Web Application Manually. Servlets. A Database-Driven Authentication Servlet. ColdFusion MX and J2EE Integration. Configuring MySQL Database Server. What's Next? 436.
Overview of JSP. Scripting Elements. Directives. Actions. Model-View-Controller. Implicit Objects. Error Pages. JavaBeans. Sample Bean Application: Writing Dynamic XML. What's Next?
Getting Started with Custom Tags. Writing a Simple Custom Tag. Importing a JSP Library in CFMX. Working with the JSTL. The web.xml File. JSP Satellite Developments. What's Next?
Application Overview. Database. Setup. Root Application Files. Styles. WEB-INF. WEB-INF/classes/com/cybertrails/store. WEB-INF/classes/com/cybertrails/store/beans. WEB-INF/classes/com/cybertrails/store/tags. WEB-INF/classes/com/cybertrails/admin. WEB-INF/lib. WEB-INF/jstl10. What's Next?
Comments. Directives. Standard Actions.
javax.servlet Interfaces, Classes, and Exceptions. JSP API for javax.servlet.jsp and java.servlet.jsp.tagext. javax.servlet. javax.servlet.http Interfaces and Classes.
General Java. JSP and Servlets.
Checking Environment Variables. Setting CLASSPATH. Setting JAVA_HOME. Setting the PATH. Checking Current Version. Compiling and Running Programs. Primitive Data Types. Declaring and Initializing Variables. Class Definition. Constructors. Declaring Methods. Calling Methods. Overloading Methods. Overriding Methods. Package. Import. Inheritance. Defining and Implementing an Interface. Exceptions. Creating a .jar File. Creating the Proper Directory Structure for a Web Application. The Simplest Possible web.xml File. Creating a .war File.
Well, someone has finally dared to use the J-word in a book written for the ColdFusion developer community. I couldn’t be happier! Eben Hewitt has written a book about Java for ColdFusion developers—and it’s an excellent book, I’m happy to report.
But wait—Java? Hasn’t Macromedia spent a great deal of effort reassuring ColdFusion developers that they won’t need to learn Java to use ColdFusion? They certainly have—and when the question is phrased as “Must I learn Java?,” the answer must be “No.” But perhaps our question ought to be, “Should I learn Java?” Ask a better question and you may get a better answer.
There are any number of very practical reasons that you might want to learn Java. That you’re holding this book in your hands rather than another indicates that you’re probably well aware of them. For many of us, the most compelling reasons are the increased job opportunities and better pay that knowing Java represents.
Like it or not, we developers work in a field where our current knowledge has a finite lifetime of usefulness. In the hyper-accelerated environment of Web technology, new knowledge springs forth daily to replace the old. Our hard-won expertise becomes less valuable daily. Economists even have a term for this; they call it a wasting asset. Ouch.
The inescapable fact is that this new knowledge mainly centers on Java, and that fact can be a terrifying one to ColdFusion programmers, who might ask, “Java? You want me to learn Java—with all its weird, C-like syntax and classes that extend from this and inherit that and are dependent on something else? That Java?”
Yes—that Java. Java represents a watershed event in the history of software development—the mass adoption of object orientation (OO) as the standard for building software. For 30 years, OO has been being nurtured in a community of dedicated academicians, theorists, and tool-builders.
Building on the best practices that proceeded it, OO provides not only some new languages (e.g., Eiffel, Smalltalk, and Java), but a new way of approaching how we create software. During my career, OO has moved from being a quirky, ivory-tower science project to the dominant paradigm for building commercial software. And Java stands as the unchallenged 800-pound gorilla of OO languages.
Financial considerations aside, I find that developers are very creative people who enjoy the thrill of making scale-modeled universes that work! Java represents a new set of tools that can help you built bigger, better, cooler (and yes, more profitable) universes. Learning Java will almost certainly make you a more capable and more secure developer. And, while you don’t have to learn Java to continue to use ColdFusion, the new capabilities of ColdFusion MX make learning Java more attractive than ever.
All right; you’ve decided to take the plunge. If Java is the future, you’re ready to embrace it. Why this book, though? There’s certainly no shortage of Java books around. Some are bigger, some are cheaper, some even have a snazzier cover! Or does it even matter? Having made the decision to learn Java, does the choice of book really make much of a difference?
I believe it does. Learning a new language is not easy. Consider the difficulties encountered for centuries by Egyptologists trying to decipher the picture-language used by ancient Egyptians. Scholars had expended great efforts only to achieve scant results. Then, in 1799, some of Napoleon’s soldiers were digging the foundations of an addition to a fort near the town of Rashid in the Nile delta when they came across a six-foot tall stone with hieroglyphs on it.
Had that been all there was to the stone, very little consideration would have been given to it. It dated from about 195 B.C., but such ancient artifacts endowed with hieroglyphs were neither rare nor notable in the Nile valley. The text of the stone was not particularly noteworthy, either. It began with the praises of King Ptolemy V, it was followed by an account of the siege of the city, Lycopolis, and it ended with the establishment of a religion venerating the king. But, today, every schoolchild knows of this stone, which became known as the Rosetta stone. What made this stone special was the fact that the text was inscribed in both the unknown Egyptian hieroglyphs and the familiar Greek language. The scholars’ knowledge of Greek thus became a key to learning an unknown language.
You might think of this book as a type of Rosetta stone—one that will help you to decipher Java. It begins with what you know—ColdFusion—and uses this as a key to help you understand Java. I can think of no better way to learn a new language.
Building on this excellent idea, Eben uses clear language, copious examples, insightful theory, and wry humor to achieve his goal—helping us leverage our ColdFusion knowledge into Java expertise.
This book won’t teach you everything about Java. No book can. As a friend of mine says, “Saying ‘I know Java’ is like saying, ‘I know science.’” There’s plenty of material to work with for years to come. But this book will give you a working knowledge of Java basics and a firm foundation on which to increase your knowledge. If you’re a ColdFusion programmer looking to learn Java, I can offer no better advice than to buy this book and study it.
Hal Helms