Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 937 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
937
Dung lượng
4,25 MB
Nội dung
Java™ Application Development on Linux® By Carl Albing, Michael Schwarz Publisher : Prentice Hall PTR Pub Date : November 22, 2004 ISBN : 0-13-143697-X Pages : 600 Readers learn how to: Table of • Contents • Index Use development tools available on Linux, such as the GNU Compiler for Java (gcj), Ant, the NetBeans IDE, IBM's Eclipse Java IDE, JUnit, and SunONE Studio Develop business logic layers using Java DataBase Connectivity (JDBC) Add a Web interface using servlets and JSPs Add a GUI using Sun's Abstract Window Toolkit (AWT) and IBM's SWT Deploy EJBs in Linux The authors conclude by demonstrating how a hierarchy of budgets can be created, tracked, and shared with Concurrent Versions System (CVS) A companion Website includes all source code and a link to each tool described Java(TM) Application Development on Linux(R) can propel you from a standing start to the full-speed development and deployment of Java applications on Linux Java™ Application Development on Linux® By Carl Albing, Michael Schwarz Publisher : Prentice Hall PTR Pub Date : November 22, 2004 Table of ISBN : 0-13-143697-X • Contents Pages : 600 • Index Copyright Bruce Peren's Open Source Series Preface Java and Linux Free Software and Java You Can Help! Acknowledgments Introduction Who Should Buy This Book Who Should Not Buy This Book How to Use This Book Part I: Getting Started Chapter 1 An Embarrassment of Riches: The Linux Environment Section 1.1 What You Will Learn Section 1.2 The Command Line: What's the Big Deal? Section 1.3 Basic Linux Concepts and Commands Section 1.4 Review Section 1.5 What You Still Don't Know Section 1.6 Resources Chapter 2 An Embarrassment of Riches: Editors Section 2.1 What You Will Learn Section 2.2 Eye to Eye with vi Section 2.3 Editors Galore Section 2.4 Review Section 2.5 What You Still Don't Know Section 2.6 Resources Chapter 3 An Experienced Programmer's Introduction to Java Section 3.1 What You Will Learn Section 3.2 Fundamental Language Elements Section 3.3 Using (and Making) Java APIs Section 3.4 Encapsulation, Inheritance, and Polymorphism Section 3.5 O, Templates! Where Art Thou? Section 3.6 Virtually Final Section 3.7 A Useful Simple Application Section 3.8 Review Section 3.9 What You Still Don't Know Section 3.10 Resources Section 3.11 Exercises Chapter 4 Where Am I? Execution Context Section 4.1 What You Will Learn Section 4.2 A Simple Start Section 4.3 The System Class Section 4.4 The Properties Class Section 4.5 The Runtime Class Section 4.6 Review Section 4.7 What You Still Don't Know Section 4.8 Resources Chapter 5 The Sun Microsystems Java Software Development Kit Section 5.1 What You Will Learn Section 5.2 All You Need, and Not One Thing More Section 5.3 The Java Compiler Section 5.4 The Java Runtime Engine Section 5.5 Complete, Up-to-Date Program Documentation Made Easy Section 5.6 Dispensing with Applets Section 5.7 Going Native Section 5.8 Introducing RMI Section 5.9 The Java Debugger Section 5.10 Return to the Source: The Java Decompiler Section 5.11 Bundling a Java Program: Put it in a JAR Section 5.12 The Rest of the Toolkit Section 5.13 Review Section 5.14 What You Still Don't Know Section 5.15 Resources Chapter 6 The IBM Developer Kit for Linux, Java 2 Technology Edition Section 6.1 What You Will Learn Section 6.2 Use Linux Features to Make Multiple Java SDKs Play Nicely Together Section 6.3 How the IBM JDK Differs from the Sun JDK Section 6.4 What Are All These "_g" Versions? Section 6.5 Review Section 6.6 What You Still Don't Know Section 6.7 Resources Chapter 7 The GNU Compiler for Java (gcj) Section 7.1 What You Will Learn Section 7.2 A Brand GNU Way Section 7.3 The GNU Compiler Collection Section 7.4 Compiling Our Simple Application with gcj Section 7.5 Options and Switches Section 7.6 Reasons to Use gcj Section 7.7 Reasons Not to Use gcj Section 7.8 Review Section 7.9 What You Still Don't Know Section 7.10 Resources Chapter 8 Know What You Have: CVS Section 8.1 What You Will Learn Section 8.2 Source Control: Whys and Hows Section 8.3 A GUI: jCVS Section 8.4 Review Section 8.5 What You Still Don't Know Section 8.6 Resources Chapter 9 Ant: An Introduction Section 9.1 What You Will Learn Section 9.2 The Need for a Different Build Tool Section 9.3 Obtaining and Installing Ant Section 9.4 A Sample Ant Buildfile Section 9.5 Review Section 9.6 What You Still Don't Know Section 9.7 Resources Chapter 10 Integrated Development Environments Section 10.1 What You Will Learn Section 10.2 NetBeans: The Open Source IDE Section 10.3 SunONE Studio Community Edition Section 10.4 Eclipse: The Source of SWT Section 10.5 Review Section 10.6 What You Still Don't Know Section 10.7 Resources Part II: Developing Business Logic Chapter 11 Balancing Acts: An Imaginary Scenario Section 11.1 What You Will Learn Section 11.2 Statement of the Need Section 11.3 How to Develop Software Section 11.4 What Makes a Good Requirement Section 11.5 Whom to Ask for Requirements Section 11.6 Requirements for the Budget Application Section 11.7 Documenting, Prototyping, and Stakeholder Buy-In Section 11.8 Review Section 11.9 What You Still Don't Know Section 11.10 Resources Section 11.11 Exercises Chapter 12 Analysis and Design: Seeking the Objects Section 12.1 What You Will Learn Section 12.2 Facing the Blank Page Section 12.3 Using CRC Cards Section 12.4 Finding the Objects Section 12.5 Finding the Methods and Attributes Section 12.6 Essential and Nonessential Section 12.7 Analysis Paralysis Section 12.8 Real Software Engineering Section 12.9 Core Classes Section 12.10 Review Section 12.11 What You Still Don't Know Section 12.12 Resources Section 12.13 Exercises Chapter 13 JUnit: Automating Unit Testing Section 13.1 What You Will Learn Section 13.2 JUnit: Why All the Fuss? Section 13.3 Design Then Test Then Code Section 13.4 Installing and Running JUnit Section 13.5 Writing Test Cases Section 13.6 Running Test Suites Section 13.7 Review Section 13.8 What You Still Don't Know Section 13.9 Resources Section 13.10 Exercises Chapter 14 Storing the Data Section 14.1 What You Will Learn Section 14.2 Follow the Objects Section 14.3 Of Persistence Section 14.4 Thinking of the Future, or Painting in Corners Section 14.5 Oracle, PostgreSQL, MySQL Section 14.6 Being Self-Contained Section 14.7 Beyond the Basics Section 14.8 Persistence Is Not the Whole Story Section 14.9 Setting Up PostgreSQL for BudgetPro Section 14.10 Review Section 14.11 What You Still Don't Know Section 14.12 Resources Section 14.13 Exercises Chapter 15 Accessing the Data: An Introduction to JDBC Section 15.1 What You Will Learn Section 15.2 Introducing JDBC Section 15.3 Making Connections Section 15.4 Querying Data Section 15.5 Getting Results Section 15.6 Updates, Inserts, Deletes Section 15.7 Review Section 15.8 What you Still Don't Know Section 15.9 Resources Section 15.10 Exercises Part III: Developing Graphical User Interfaces Chapter 16 Getting in the Swing of Things: Designing a GUI for BudgetPro Section 16.1 What You Will Learn Section 16.2 A Simple Swing Program Section 16.3 Stompin' at the Savoy, or The Swing Paradigm Section 16.4 Slow, Slow, Quick-Quick, Slow: The Basic Swing Objects Section 16.5 Layout Managers Section 16.6 Beyond Arthur Murray: Actions, Listeners, Events Section 16.7 Getting Down to Cases: Designing a GUI for BudgetPro Section 16.8 Review Section 16.9 What You Still Don't Know Section 16.10 Resources Section 16.11 Exercises Chapter 17 Other Ways: Alternatives to Swing Section 17.1 What You Will Learn Section 17.2 The IBM SWT Toolkit Section 17.3 Porting BudgetPro to SWT Section 17.4 SWT and gcj Section 17.5 Review Section 17.6 What You Still Don't Know Section 17.7 Resources Section 17.8 Exercises Part IV: Developing Web Interfaces Chapter 18 Servlets: Java Pressed into Service Section 18.1 What You Will Learn Section 18.2 Servlets: Program-Centric Server-Side Documents Section 18.3 Perspective Section 18.4 How to Write a Servlet Section 18.5 Input, Output Section 18.6 Matters of State: Cookies, Hidden Variables, and the Dreaded "Back" Button Section 18.7 Designing a BudgetPro Servlet Section 18.8 Review Section 18.9 What You Still Don't Know Section 18.10 Resources Section 18.11 Exercises Chapter 19 JSP: Servlets Turned Inside Out Section 19.1 What You Will Learn Section 19.2 Servlets Turned Inside Out: JSP Section 19.3 How to Write a JSP Application Section 19.4 Using JSP with BudgetPro Section 19.5 Review Section 19.6 What You Still Don't Know Section 19.7 Resources Section 19.8 Exercises Chapter 20 Open Source Web Application Servers Section 20.1 What You Will Learn Section 20.2 Downloading JBoss Section 20.3 Be an Enabler, or "Let's Be Codependent!" Section 20.4 Installing JBoss Section 20.5 Things That Make It Go Section 20.6 Disposition of Forces Section 20.7 Apache Geronimo Section 20.8 Installing Geronimo Section 20.9 Running the Geronimo Server Section 20.10 Review Section 20.11 What You Still Don't Know Section 20.12 Resources Part V: Developing Enterprise Scale Software Chapter 21 Introduction to Enterprise JavaBeans Section 21.1 What You Will Learn Section 21.2 Expanding to EJBs Section 21.3 What's in a Name? An Introduction to JNDI Section 21.4 Review Section 21.5 What You Still Don't Know Section 21.6 Resources Chapter 22 Building an EJB Section 22.1 What You Will Learn Section 22.2 EJBs: You Don't Know Beans? Section 22.3 Review Section 22.4 What You Still Don't Know Section 22.5 Resources Chapter 23 Deploying EJBs Section 23.1 What you Will Learn Section 23.2 Lend Me Your EAR: Enterprise Packaging and Deployment Section 23.3 Deploying the EAR Section 23.4 Maintaining a Distributed Application Section 23.5 Abstracting Legacy Applications Section 23.6 Review Section 23.7 What you Still Don't Know Section 23.8 Resources Chapter 24 Parting Shots Section 24.1 The Future's So Bright, I Squint and Look Confused Section 24.2 Our Book Is Yours Section 24.3 Came the Revolution Section 24.4 What You Still Don't Know Section 24.5 Resources Appendix A ASCII Chart Appendix B A Java Swing GUI for BudgetPro Appendix C GNU General Public License Preamble Terms and Conditions for Copying, Distribution, and Modification No Warranty How to Apply these Terms to Your New Programs Index Copyright Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks Where those designations appear in this book, and the publisher was aware of a trademark claim, the designations have been printed with initial capital letters or in all capitals The authors and publisher have taken care in the preparation of this book, but make no expressed or implied warranty of any kind and assume no responsibility for errors or omissions No liability is assumed for incidental or consequential damages in connection with or arising out of the use of the information or programs contained herein The publisher offers excellent discounts on this book when ordered in quantity for bulk purchases or special sales, which may include electronic versions and/or custom covers and content particular to your business, training goals, marketing focus, and branding interests For more information, please contact: U S Corporate and Government Sales (800) 382-3419 corpsales@pearsontechgroup.com For sales outside the U S., please contact: International Sales international@pearsoned.com Visit us on the Web: www.phptr.com Library of Congress Cataloging-in-Publication Data: CIP data on file setgid bits setHorizontalScrollBarPolicy() setHorizontalTextPosition() setInt() setLayout() 2nd setProperty setProperty() setReorderingAllowed() setResizingAllowed() Sets setStatus() 2nd setString() setters setText() 2nd setTimestamp() setTotal() setUp() 2nd setVerticalScrollBarPolicy() setVerticalTextPosition() setVisible() 2nd SGML 2nd Shell 2nd 3rd 4th 5th 6th shell languages shell scripts 2nd for startup JUnit tests loops parameters running 2nd shells 2nd shopping cart 2nd 3rd short short-circuiting Slider sliders SMAC SMB software engineering 2nd 3rd documenting iterative approach 2nd requirements 2nd 3rd Software Engineering Institute sorting source control 2nd 3rd 4th files for SourceForge SPARC SPI 2nd split panes SpringLayout sprintf() SQL 2nd 3rd Stallman, Richard 2nd 3rd 4th 5th 6th standard error 2nd standard input 2nd 3rd standard output 2nd 3rd piping 2nd reassigning redirecting 2nd 3rd startsWith() Statement statements, in Java static access modifier 2nd 3rd 4th static initializers 2nd status lines 2nd step STL algorithms Stochniol, Andrzej store() stored procedures streams strftime() String 2nd StringBuffer strings comparing concatenating 2nd length searching 2nd substrings strlen() StrongARM su 2nd substring() Subversion sudo 2nd Sun 2nd 3rd 4th 5th 6th 7th Java SDK 2nd 3rd 4th differences from IBM Java SDK installing Micro Edition SOS (SunONE Studio) 2nd Web site 2nd 3rd 4th 5th 6th 7th 8th 9th 10th 11th Swing 2nd 3rd 4th compared to SWT 2nd 3rd 4th containers documentation 2nd graphical objects performance portability using with HTML switch SWT 2nd 3rd 4th ActiveX support adapters and garbage collection compared to Swing 2nd 3rd documentation 2nd 3rd installing performance portability using with gcj SWT class SWTException symlinks 2nd 3rd 4th circular chains dangling System 2nd System V init system 2nd Index [SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Y] [Z] tabbed panes TabFolder TabItem table 2nd Table 2nd TableCellEditor TableCellRenderer 2nd tableChanged() TableColumn 2nd TableColumnModel TableItem 2nd TableModel 2nd 3rd TableModelEvent 2nd TableModelListener tables background color editors in Swing 2nd 3rd 4th in SWT renderers scrolling tag libraries tail tar 2nd 3rd 4th command-line options 2nd 3rd examining contents of files target Task Taub, Mark TCP/IP 2nd td tearDown() 2nd 3rd TestCase 2nd 3rd TestRunner 2nd TestSuite Text text areas text fields 2nd 3rd 4th text panes the Thinking in Java 2nd 3rd 4th 5th 6th 7th throw 2nd throws time value of money Timestamp toLowerCase() Tomcat 2nd 3rd 4th 5th tool tips ToolBar toolbars 2nd 3rd ToolItem toString() 2nd 3rd 4th 5th 6th 7th 8th 9th touch toUpperCase() tr traverse() Tree TreeItem trees 2nd true try 2nd Index [SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Y] [Z] uid 2nd Umbrello 2nd UML 2nd 3rd 4th UnicastRemoteObject Unicode 2nd 3rd UNIX archive formats 2nd as programmer-friendly platform 2nd commercial versions daemon processes filesystems 2nd 3rd online manuals operating system commands philosophy releases shell scripts standard I/O 2nd tools user interface unzip 2nd inspecting files before unzipping URLEncoder URLs 2nd parameters in 2nd 3rd passwords in useBean 2nd USER UTF-8 Index [SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Y] [Z] validation variables declaring inside for loops local of object type vi 2nd 3rd case sensitiveness copying/pasting deleting exiting indentation 2nd 3rd modes ex 2nd 3rd 4th input 2nd 3rd 4th vi positioning 2nd repeating commands searching 2nd 3rd 4th substitutions 2nd undoing/redoing using with CVS using with NetBeans words in vim 2nd 3rd virtual VISUAL VNC Vogen, Kirk 2nd Von Neumann architecture Index [SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Y] [Z] WAR files 2nd 3rd building with Ant 2nd wc Web pages changing common parts dynamically generated 2nd 3rd static 2nd WEB-INF web.xml 2nd WebSphere 2nd well-formedness which while changing execution compared with the for loop 2nd whitespace in filenames trailing Widget 2nd 3rd windows (in GUI), resizing 2nd 3rd 4th WordStar 2nd Index [SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Y] [Z] X Window 2nd 3rd X.500 X11 2nd xcoral XDoclet documentation generating interfaces using with Ant using with JBoss xedit XFree86 XHTML xinetd XML 2nd using for JSP XML Schema XSLT xterm Index [SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Y] [Z] YaST 2nd Index [SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Y] [Z] zip 2nd 3rd ZIP files 2nd in NetBeans inspecting before unzipping Zoetebier, John zone transfers ... Java Application Development on Linux By Carl Albing, Michael Schwarz Publisher : Prentice Hall PTR Pub Date : November 22, 2004 Table of ISBN : 0-13-143697-X • Contents Pages... Section 3.7 A Useful Simple Application Section 3.8 Review Section 3.9 What You Still Don't Know Section 3.10 Resources Section 3.11 Exercises Chapter 4 Where Am I? Execution Context Section 4.1... John H Terpstra Preface Java and Linux Free Software and Java You Can Help! Acknowledgments Java and Linux Why another book on Java? Why a book on Java and Linux? Isn't Java a platform-independent system? Aren't there enough