Beginning Pojo.Pdf

Total Page:16

File Type:pdf, Size:1020Kb

Beginning Pojo.Pdf Sam-Bodden_596-3 FRONT.fm Page i Friday, February 24, 2006 9:59 AM Beginning POJOs From Novice to Professional ■■■ Brian Sam-Bodden Sam-Bodden_596-3 FRONT.fm Page ii Friday, February 24, 2006 9:59 AM Beginning POJOs: From Novice to Professional Copyright © 2006 by Brian Sam-Bodden All rights reserved. No part of this work may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage or retrieval system, without the prior written permission of the copyright owner and the publisher. ISBN-13 (pbk): 978-159059-596-1 ISBN-10 (pbk): 1-59059-596-3 Printed and bound in the United States of America 9 8 7 6 5 4 3 2 1 Trademarked names may appear in this book. Rather than use a trademark symbol with every occurrence of a trademarked name, we use the names only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark. Lead Editor: Steve Anglin Technical Reviewer: Dilip Thomas Editorial Board: Steve Anglin, Dan Appleman, Ewan Buckingham, Gary Cornell, Jason Gilmore, Jonathan Hassell, James Huddleston, Chris Mills, Matthew Moodie, Dominic Shakeshaft, Jim Sumser, Matt Wade Project Manager: Kylie Johnston Copy Edit Manager: Nicole LeClerc Copy Editor: Hastings Hart Assistant Production Director: Kari Brooks-Copony Production Editor: Katie Stence Compositor: Susan Glinert Proofreader: Lori Bring Indexer: Michael Brinkman Artist: April Milne Cover Designer: Kurt Krames Manufacturing Director: Tom Debolski Distributed to the book trade worldwide by Springer-Verlag New York, Inc., 233 Spring Street, 6th Floor, New York, NY 10013. Phone 1-800-SPRINGER, fax 201-348-4505, e-mail [email protected], or visit www.springeronline.com. For information on translations, please contact Apress directly at 2560 Ninth Street, Suite 219, Berkeley, CA 94710. Phone 510-549-5930, fax 510-549-5939, e-mail [email protected], or visit www.apress.com. The information in this book is distributed on an “as is” basis, without warranty. Although every precaution has been taken in the preparation of this work, neither the author(s) nor Apress shall have any liability to any person or entity with respect to any loss or damage caused or alleged to be caused directly or indirectly by the information contained in this work. The source code for this book is available to readers at www.apress.com in the Source Code section. Sam-Bodden_596-3 FRONT.fm Page iii Friday, February 24, 2006 9:59 AM I dedicate this book to my wife Anne for her unwavering love and support and to my two-year-old son Michael for putting a smile on my face every time I felt like quitting. Sam-Bodden_596-3 FRONT.fm Page iv Friday, February 24, 2006 9:59 AM Sam-Bodden_596-3 FRONT.fm Page v Friday, February 24, 2006 9:59 AM Contents at a Glance About the Author . xiii Acknowledgments . xv Introduction . xvii ■CHAPTER 1 Introduction . 1 ■CHAPTER 2 Eclipse . 23 ■CHAPTER 3 Building with Ant . 47 ■CHAPTER 4 Object Relational Mapping with Hibernate . 87 ■CHAPTER 5 Business Services with JBoss . 145 ■CHAPTER 6 The Spring Framework . 195 ■CHAPTER 7 Tapestry . 239 ■CHAPTER 8 Testing . 305 ■CHAPTER 9 Continuous Integration . 345 ■CHAPTER 10 Additional Topics . 363 ■INDEX . 381 v Sam-Bodden_596-3 FRONT.fm Page vi Friday, February 24, 2006 9:59 AM Sam-Bodden_596-3 FRONT.fm Page vii Friday, February 24, 2006 9:59 AM Contents About the Author . xiii Acknowledgments . xv Introduction . xvii ■CHAPTER 1 Introduction . 1 The Java EE Market . 1 Case Study: The TechConf Website . 3 Defining the Stakeholders . 4 The Business Problem . 5 General Application Requirements . 6 Attendees. 6 Presenters . 6 Sponsors . 7 Administrators. 7 Architectural Requirements . 8 Open Issues and Assumptions . 10 Assumptions . 10 Open Issues. 11 Design Road Map . 11 Finding and Refining Candidate Domain Model Elements . 13 Use Case Modeling . 16 Modeling Best Practices . 18 The Open Source Tools . 18 Useful Open Source Resources . 19 Summary . 20 ■CHAPTER 2 Eclipse . 23 Installing Eclipse . 24 Using Eclipse . 25 vii Sam-Bodden_596-3 FRONT.fm Page viii Friday, February 24, 2006 9:59 AM viii ■CONTENTS Creating an Eclipse Project . 26 Creating a Java Interface. 29 Creating a Java Class. 32 Running a Java Class . 34 Debugging a Java Class. 35 Eclipse Plug-ins . 36 Concurrent Versions System . 37 Understanding CVS. 37 CVS Concepts . 37 CVS in Eclipse . 38 Database Plug-ins . 40 SQL Explorer . 40 Web Development Plug-ins . 46 Summary . 46 ■CHAPTER 3 Building with Ant . 47 Introduction to Ant . 48 Obtaining and Installing Ant. 50 Ant’s Command-Line Options . 51 A Simple Ant Example . 52 More on Targets . 57 Target Dependencies . 58 Tasks . 61 Properties . 61 Datatypes. 63 Case Study: Building TechConf with Ant . 65 Compiling. ..
Recommended publications
  • J2EE Development Standards
    Indiana University J2EE Development Standards University Information Systems September 2004 Version 1.4 Table of Contents Introduction............................................................................................................... 3 Methodology..............................................................................................................6 Architecture...............................................................................................................12 Coding Conventions..................................................................................................18 Standard Libraries ....................................................................................................20 Tools ..........................................................................................................................21 Development Platform ..............................................................................................22 Shared Services .........................................................................................................23 Deployment................................................................................................................24 References and Links................................................................................................26 Appendices.................................................................................................................28 J2EE Development Standards v1.4 - 2 - J2EE Development Standards: Introduction
    [Show full text]
  • Javaedge Setup and Installation
    APPENDIX A ■ ■ ■ JavaEdge Setup and Installation Throughout the book, we have used the example application, JavaEdge, to provide a practical demonstration of all the features discussed. In this appendix, we will walk you through setting up the tools and applications required to build and run JavaEdge, as well as take you through the steps needed to get the JavaEdge application running on your platform. Environment Setup Before you can get started with the JavaEdge application, you need to configure your platform to be able to build and run JavaEdge. Specifically, you need to configure Apache Ant in order to build the JavaEdge application and package it up for deployment. In addition, the JavaEdge application is designed to run on a J2EE application server and to use MySQL as the back-end database. You also need to have a current JDK installed; the JavaEdge application relies on JVM version 1.5 or higher, so make sure your JDK is compatible. We haven’t included instruc- tions for this here, since we are certain that you will already have a JDK installed if you are reading this book. However, if you do need to download one, you can find it at http://java. sun.com/j2se/1.5.0/download.jsp. Installing MySQL The JavaEdge application uses MySQL as the data store for all user, story, and comment data. If you don’t already have the MySQL database server, then you need to obtain the version applicable to your platform. You can obtain the latest production binary release of MySQL for your platform at http://www.mysql.com.
    [Show full text]
  • Full-Graph-Limited-Mvn-Deps.Pdf
    org.jboss.cl.jboss-cl-2.0.9.GA org.jboss.cl.jboss-cl-parent-2.2.1.GA org.jboss.cl.jboss-classloader-N/A org.jboss.cl.jboss-classloading-vfs-N/A org.jboss.cl.jboss-classloading-N/A org.primefaces.extensions.master-pom-1.0.0 org.sonatype.mercury.mercury-mp3-1.0-alpha-1 org.primefaces.themes.overcast-${primefaces.theme.version} org.primefaces.themes.dark-hive-${primefaces.theme.version}org.primefaces.themes.humanity-${primefaces.theme.version}org.primefaces.themes.le-frog-${primefaces.theme.version} org.primefaces.themes.south-street-${primefaces.theme.version}org.primefaces.themes.sunny-${primefaces.theme.version}org.primefaces.themes.hot-sneaks-${primefaces.theme.version}org.primefaces.themes.cupertino-${primefaces.theme.version} org.primefaces.themes.trontastic-${primefaces.theme.version}org.primefaces.themes.excite-bike-${primefaces.theme.version} org.apache.maven.mercury.mercury-external-N/A org.primefaces.themes.redmond-${primefaces.theme.version}org.primefaces.themes.afterwork-${primefaces.theme.version}org.primefaces.themes.glass-x-${primefaces.theme.version}org.primefaces.themes.home-${primefaces.theme.version} org.primefaces.themes.black-tie-${primefaces.theme.version}org.primefaces.themes.eggplant-${primefaces.theme.version} org.apache.maven.mercury.mercury-repo-remote-m2-N/Aorg.apache.maven.mercury.mercury-md-sat-N/A org.primefaces.themes.ui-lightness-${primefaces.theme.version}org.primefaces.themes.midnight-${primefaces.theme.version}org.primefaces.themes.mint-choc-${primefaces.theme.version}org.primefaces.themes.afternoon-${primefaces.theme.version}org.primefaces.themes.dot-luv-${primefaces.theme.version}org.primefaces.themes.smoothness-${primefaces.theme.version}org.primefaces.themes.swanky-purse-${primefaces.theme.version}
    [Show full text]
  • (19) United States (12) Patent Application Publication (10) Pub
    US 20110191743Al (19) United States (12) Patent Application Publication (10) Pub. No.: US 2011/0191743 A1 Cope et al. (43) Pub. Date: Aug. 4, 2011 (54) STACK MACROS AND PROJECT Publication Classi?cation EXTENSIBILITY FOR PROJECT STACKING (51) Int Cl AND SUPPORT SYSTEM G06F 9/44 (200601) (75) Inventors: Rod Cope, Broom?eld, CO (US); ( 52 ) US. Cl. ...................................................... .. 717/101 Eric Weidner, Highlands Ranch, (57) ABSTRACT CO (Us) A tool is provided for addressing a number of issues related to _ assembling software stacks including multiple uncoordinated (73) Asslgnee? OPENLOGIC, INC-i B1" Oom?eld, components such as open source projects. The tool identi?es CO (Us) individual projects for stacking, manages dependency rela tionships and provides an intuitive graphical interface to (21) App1_ NO_; 11/556,094 assist a user. A project ?lter is also provided for controlling access to or installation of projects in accordance With ?lter (22) Filed. N0“ 2 2006 criteria. In this manner, compliance With internal policies ' ’ regarding the use of open source or other software is facili . tated. The user can also add projects to the collection of Related U's' Apphcatlon Data supported projects and de?ne stack macros or stacros. Once (60) Provisional application No. 60/732,729, ?led on Nov. such stacros are de?ned, various functionality can be pro 2, 2005' vided analogous to that provided for individual projects. 1208 1210 1212 USER PARAMETERS USE PARAMETERS LICENSE PARAMETERS 1200 l A l / USER INTERFACE # ; FILTERS _ V USER SYSTEM 1204 1 202 1 21 4 PROJECTS 1206 Patent Application Publication Aug.
    [Show full text]
  • Developing Java™ Web Applications
    ECLIPSE WEB TOOLS PLATFORM the eclipse series SERIES EDITORS Erich Gamma ■ Lee Nackman ■ John Wiegand Eclipse is a universal tool platform, an open extensible integrated development envi- ronment (IDE) for anything and nothing in particular. Eclipse represents one of the most exciting initiatives hatched from the world of application development in a long time, and it has the considerable support of the leading companies and organ- izations in the technology sector. Eclipse is gaining widespread acceptance in both the commercial and academic arenas. The Eclipse Series from Addison-Wesley is the definitive series of books dedicated to the Eclipse platform. Books in the series promise to bring you the key technical information you need to analyze Eclipse, high-quality insight into this powerful technology, and the practical advice you need to build tools to support this evolu- tionary Open Source platform. Leading experts Erich Gamma, Lee Nackman, and John Wiegand are the series editors. Titles in the Eclipse Series John Arthorne and Chris Laffra Official Eclipse 3.0 FAQs 0-321-26838-5 Frank Budinsky, David Steinberg, Ed Merks, Ray Ellersick, and Timothy J. Grose Eclipse Modeling Framework 0-131-42542-0 David Carlson Eclipse Distilled 0-321-28815-7 Eric Clayberg and Dan Rubel Eclipse: Building Commercial-Quality Plug-Ins, Second Edition 0-321-42672-X Adrian Colyer,Andy Clement, George Harley, and Matthew Webster Eclipse AspectJ:Aspect-Oriented Programming with AspectJ and the Eclipse AspectJ Development Tools 0-321-24587-3 Erich Gamma and
    [Show full text]
  • Abkürzungs-Liste ABKLEX
    Abkürzungs-Liste ABKLEX (Informatik, Telekommunikation) W. Alex 1. Juli 2021 Karlsruhe Copyright W. Alex, Karlsruhe, 1994 – 2018. Die Liste darf unentgeltlich benutzt und weitergegeben werden. The list may be used or copied free of any charge. Original Point of Distribution: http://www.abklex.de/abklex/ An authorized Czechian version is published on: http://www.sochorek.cz/archiv/slovniky/abklex.htm Author’s Email address: [email protected] 2 Kapitel 1 Abkürzungen Gehen wir von 30 Zeichen aus, aus denen Abkürzungen gebildet werden, und nehmen wir eine größte Länge von 5 Zeichen an, so lassen sich 25.137.930 verschiedene Abkür- zungen bilden (Kombinationen mit Wiederholung und Berücksichtigung der Reihenfol- ge). Es folgt eine Auswahl von rund 16000 Abkürzungen aus den Bereichen Informatik und Telekommunikation. Die Abkürzungen werden hier durchgehend groß geschrieben, Akzente, Bindestriche und dergleichen wurden weggelassen. Einige Abkürzungen sind geschützte Namen; diese sind nicht gekennzeichnet. Die Liste beschreibt nur den Ge- brauch, sie legt nicht eine Definition fest. 100GE 100 GBit/s Ethernet 16CIF 16 times Common Intermediate Format (Picture Format) 16QAM 16-state Quadrature Amplitude Modulation 1GFC 1 Gigabaud Fiber Channel (2, 4, 8, 10, 20GFC) 1GL 1st Generation Language (Maschinencode) 1TBS One True Brace Style (C) 1TR6 (ISDN-Protokoll D-Kanal, national) 247 24/7: 24 hours per day, 7 days per week 2D 2-dimensional 2FA Zwei-Faktor-Authentifizierung 2GL 2nd Generation Language (Assembler) 2L8 Too Late (Slang) 2MS Strukturierte
    [Show full text]
  • Soumaya HACHICHA Formation Expériences Professionnelles
    Soumaya HACHICHA Ingénieur Informatique Née le : 13/11/1987 Mariée Sakiet Eddaier km 6, Rue cheikh Salemi N°60, 3011, Sfax, Tunisie (+216)53475698 @ [email protected] Formation 2008-2011 Cycle Ingénieur en informatique à l’Ecole Nationale d’Ingénieurs de Sfax, option ISI (Ingénierie des Systèmes Intelligents) Etude préparatoire en Mathématiques-Physiques - Institut 2006-2008 préparatoires aux études d’ingénieurs à Sfax 2005-2006 Baccalauréat, Science Mathématiques, Mention « Bien » Expériences professionnelles Période Sujet, outils et langages utilisés Recherche académique : Compression des maillages 3D multirésolution Depuis 2014 basée GPU Enseignement : Enseignante à l’ISET de Sidi Bouzid. 2011-2012 Matière enseignées : HTML (cours intégré et Tps), JavaScript (Tps), Commerce électronique (cours), 3P (suivie et direction des étudiants dans la réalisation de leurs projets). Sujet : Logiciel de contrôle d’accès et des présences des employés à 2011 distance en utilisant l’empreinte digitale comme étant une technique biométrique d’identification (Stage Projet Fin d’Etudes), Mention « Très 1 Bien » Outils : Visual C++ 2005, SQL SERVER 2008 Langages : C++, C++/CLI Sujet : Reconnaissance des caractères (Mini-projet) 2010 Outils : Visual C++ Langages : C++ - Stage technicien (1 mois) Sujet : Développement d’application de gestion de réservation dans un 2009-2010 hôtel (Projet Fin d’Année) Outils : SQL Server 2005, Delphi 2009 Langages : Delphi Eté 2009 Sujet : Stage ouvrier (1 mois) Sujet : Développement d’un site web de réservation
    [Show full text]
  • Component-Based Development
    Component-Based Development 2004-2005 Marco Scotto ([email protected]) Component-Based Development Outline ¾Introduction to Eclipse • Plug-in Architecture •Platform •JDT •PDE ¾HelloWorld Example ¾PDE Views Component-Based Development 2 Eclipse Project Aims ¾ Provide open platform for application development tools • Run on a wide range of operating systems • GUI and non-GUI ¾ Language-neutral • Permit unrestricted content types • HTML, Java, C, JSP, EJB, XML, GIF, … ¾ Facilitate seamless tool integration • At UI and deeper • Add new tools to existing installed products ¾ Attract community of tool developers • Including independent software vendors (ISVs) • Capitalize on popularity of Java for writing tools Component-Based Development 3 Eclipse Overview Another Eclipse Platform Tool Java Workbench Help Development Tools JFace (JDT) SWT Team Your Tool Plug-in Workspace Development Debug Environment (PDE) Their Platform Runtime Tool Eclipse Project Component-Based Development 4 Eclipse Origins ¾ Eclipse created by OTI and IBM teams responsible for IDE products • IBM VisualAge/Smalltalk (Smalltalk IDE) • IBM VisualAge/Java (Java IDE) • IBM VisualAge/Micro Edition (Java IDE) ¾ Initially staffed with 40 full-time developers ¾ Geographically dispersed development teams • OTI Ottawa, OTI Minneapolis, OTI Zurich, IBM Toronto, OTI Raleigh, IBM RTP, IBM St. Nazaire (France) ¾ Effort transitioned into open source project • IBM donated initial Eclipse code base Platform, JDT, PDE Component-Based Development 5 Brief History of Eclipse 1999 April
    [Show full text]
  • Objectweb Consortium Sustainable Development of Next Generation Software Infrastructure
    ObjectWeb Consortium Sustainable Development of Next Generation Software Infrastructure. Club Irisatech - February 4th, 2005. Christophe Ney ObjectWeb Executive Director Development Project Director, INRIA Rhône-Alpes Legal redistribution under the licensing terms of Creative Commons Attribution NonCommercial-NoDerivs 2.0 - © 2005 INRIA/ObjectWeb Agenda . ObjectWeb : A consortium to bring open-source middleware to the heart of the main stream market. JOnAS : ObjectWeb’s implementation of the J2EE specifications . ObjectWeb and Open-Source in Next Generation of GRID Software ObjectWeb Consortium NG Software Infrastructure e-business Middleware and Grid Software e-administration . Abstract network resources e-…. Ease development, deployment, management of distributed apps . Service Oriented Architecture . Convergence between Business/Computing Network . Stake for the future of Information Society Software Infrastructure is critical for everyone “… economic and social life becomes dependent upon a common computing infrastructure.” Professor Siobhan O’Mahony, Harvard Business School Software Infrastructure is shared by everybody Software Infrastructure “offers far more value when shared than when used in isolation” Nicholas Carr in “IT Doesn’t Matter”, Harvard Business Review ObjectWeb Consortium […] The importance of Software production goes beyond industrial and economic reasons. In highly-connected environments with pervasive computing, social, ethical and legal issues will have an ever increasing significance. The implementation of regulations
    [Show full text]
  • Doktora Tezi
    A METRICS-BASED APPROACH TO THE TESTING PROCESS AND TESTABILITY OF OBJECT-ORIENTED SOFTWARE SYSTEMS A THESIS SUBMITTED TO THE GRADUATE SCHOOL OF INFORMATICS OF THE MIDDLE EAST TECHNICAL UNIVERSITY BY TOLGA YURGA IN PARTIAL FULFILLMENT OF THE REQUIREMENTS FOR THE DEGREE OF DOCTOR OF PHILOSOPHY IN THE DEPARTMENT OF INFORMATION SYSTEMS FEBRUARY 2009 Approval of the Graduate School of Informatics Prof. Dr. Nazife BAYKAL Director I certify that this thesis satisfies all the requirements as a thesis for the degree of Doctor of Philosophy. Prof. Dr. Yasemin YARDIMCI Head of Department This is to certify that we have read this thesis and that in our opinion it is fully adequate, in scope and quality, as a thesis for the degree of Doctor of Philosophy. Prof. Dr. Semih BİLGEN Assoc. Prof. Ali H. DOĞRU Co-Supervisor Supervisor Examining Committee Members Dr. Ali ARİFOĞLU (METU, II) Assoc. Prof. Ali H. DOĞRU (METU, CENG) Prof. Dr. Semih BİLGEN (METU, EEE) Assist. Prof. Dr. Aysu Betin CAN (METU, II) Dr. Sadık EŞMELİOĞLU (BİLGİ GRUBU) I hereby declare that all information in this document has been obtained and presented in accordance with academic rules and ethical conduct. I also declare that, as required by these rules and conduct, I have fully cited and referenced all material and results that are not original to this wok. Name, Last name : Tolga YURGA Signature : _________________ iii ABSTRACT A METRICS-BASED APPROACH TO THE TESTING PROCESS AND TESTABILITY OF OBJECT-ORIENTED SOFTWARE SYSTEMS Yurga, Tolga Ph.D., Department of Information Systems Supervisor: Assoc. Prof. Dr. Ali Hikmet DOĞRU Co-Supervisor: Prof.
    [Show full text]
  • Introducing the Spring Framework
    04_574833 ch01.qxd 6/10/05 12:49 PM Page 1 Introducing the Spring Framework Why Spring? The Spring Framework is an open source application framework that aims to make J2EE develop- ment easier. In this chapter we’ll look at the motivation for Spring, its goals, and how Spring can help you develop high-quality applications quickly. Spring is an application framework. Unlike single-tier frameworks such as Struts or Hibernate, Spring aims to help structure whole applications in a consistent, produc- tive manner, pulling together best-of-breed single-tier frameworks to create a coher- ent architecture. Problems with the Traditional Approach to J2EE Since the widespread implementation of J2EE applications in 1999/2000, J2EE has not been an unqualified successCOPYRIGHTED in practice. While it has brought aMATERIAL welcome standardization to core middle- tier concepts such as transaction management, many — perhaps most — J2EE applications are over- complex, take excessive effort to develop, and exhibit disappointing performance. While Spring is applicable in a wide range of environments — not just server-side J2EE applications — the original motivation for Spring was the J2EE environment, and Spring offers many valuable services for use in J2EE applications. Experience has highlighted specific causes of complexity and other problems in J2EE applications. (Of course, not all of these problems are unique to J2EE!) In particular: 04_574833 ch01.qxd 6/10/05 12:49 PM Page 2 Chapter 1 ❑ J2EE applications tend to contain excessive amounts of “plumbing” code. In the many code reviews we’ve done as consultants, time and time again we see a high proportion of code that doesn’t do anything: JNDI lookup code, Transfer Objects, try/catch blocks to acquire and release JDBC resources.
    [Show full text]
  • Architectural, Technological and Performance Issues in Enterprise Applications
    World Academy of Science, Engineering and Technology International Journal of Computer and Systems Engineering Vol:1, No:3, 2007 Architectural, Technological and Performance Issues in Enterprise Applications Melek Oktay, Ayşe Betül Gülbağcı, and Mustafa Sarıöz According to the success and failure percentages, it can be Abstract—Enterprise applications are complex systems that are indicated that it is very hard to achieve success in enterprise hard to develop and deploy in organizations. Although software applications. application development tools, frameworks, methodologies and A large number of people at different backgrounds are patterns are rapidly developing; many projects fail by causing big involved in enterprise applications. There are complex costs. There are challenging issues that programmers and designers businesses, management and technical issues which are face with while working on enterprise applications. In this paper, we difficult to control. Also it takes 6-7 years to complete an present the three of the significant issues: Architectural, technological and performance. The important subjects in each issue enterprise application from early design to successful are pointed out and recommendations are given. In architectural company transformation [3]. Therefore, it is not unusual to issues the lifecycle, meta-architecture, guidelines are pointed out. have so many problems like over-budgeting, over-time in .NET and Java EE platforms are presented in technological issues. enterprise applications. There are many pitfalls, bottlenecks The importance of performance, measuring performance and and confusing works from beginning to end of an enterprise profilers are explained in performance issues. application. In this paper we propose to analyze the significant issues in Keywords—Enterprise Applications, Architecture, Technology, enterprise applications.
    [Show full text]