Rapid J2EE™ Development: An Adaptive Foundation for Enterprise Applications

Book description

Praise for Rapid J2EE Development

"The author provides a good survey of the technologies and approaches for rapid development in the J2EE arena. He touches on all areas that should be of interest to a reader, from design through testing. He illustrates the different phases of rapid development by going into several technologies in depth, and he also lists or otherwise mentions other available technologies. I would recommend this book to anyone looking to get started with developing J2EE applications."

—Beth Stearns, Consultant, ComputerEase Publishing

"This book has a lot of great material in it. The author really shows his experience in the subject matter. The content is excellent. I haven't seen another book that is as comprehensive or contains as many real-world lessons learned."

—Madhu Siddalingaiah, Consultant, SEA Corporation

"I think the book does a good job of presenting a set of processes and technologies that enable rapid development. I think this is an extremely useful book, and I would recommend it to others."

—Satadip Dutta, Software Engineer, HP

"The author skillfully presents a collection of tools, technologies and processes that facilitate rapid development of J2EE applications. I see this book as a valuable addition to any company bookshelf, especially given its broad application across the software lifecycle. It's also quite amazing that a Google search does not reveal any existing publications with this title. This book should neatly fill that hole."

—Martin Westacott, Director and Senior Consultant, Solstice Software Limited, U.K.

"If you ever needed to put some polish to your J2EE development understanding or would like to move into the role of Senior J2EE Developer, then this is the book for you. The author covers everything you need to take you from design to coding to build process. Along the way he introduces some new valuable 'leading-edge' technologies. All this will leave you with good capabilities to tackle most J2EE projects confidently."

—Shane Griggs, J2EE Architect

Learn to accelerate J2EE development, from design through testing and beyond.

Covers agile development, model-driven architecture, code generation, aspect-oriented programming, test-driven development, and much more.

An essential resource for every J2EE developer, project leader, and manager.

J2EE is today's premier platform for enterprise-level development, but it's difficult to deliver J2EE solutions as quickly as today's businesses need them. This book presents a complete, practical foundation for rapid development throughout your entire project lifecycle. Its best-practice techniques and tools don't just accelerate development—they help you adapt smoothly to increasing complexity and non-stop change. You'll learn how to make the most of iterative development, model-driven architecture (MDA), code-generation tools, aspect-oriented programming (AOP), test-driven development, and much more.

Coverage includes

  • Defining end-to-end J2EE development strategies that promote speed without compromising quality

  • Understanding how your design-time decisions impact overall project schedules

  • Building agile application architectures that promote rapid development

  • Using UML modeling to streamline system design and validation

  • Speeding database development with code generation and object-relational mapping

  • Practical test-driven development: constructing automated unit test suites and using mock objects to "test from the inside out"

  • Leveraging the full value of Eclipse and other IDEs

  • If you're a J2EE developer, project leader, or manager, you're under constant pressure to deliver quality applications more rapidly. Rapid J2EE Development gives you all the skills and resources you need to respond.

    © Copyright Pearson Education. All rights reserved.

    Table of contents

    1. Copyright
      1. Dedication
    2. Praise for Rapid J2EE Development
    3. Hewlett-Packard® Professional Books
    4. Preface
      1. What Is This Book About?
      2. Who Should Read This Book?
      3. How This Book Is Organized
        1. Part I: Adaptive Processes
        2. Part II: Agile Architectures
        3. Part III: Rapid Languages
        4. Part IV: Dynamic Environments
      4. About the Software
      5. What This Book Contains
    5. Acknowledgments
    6. About the Author
    7. I. Adaptive Processes
      1. 1. A J2EE Adaptive Foundation
        1. The Need for Rapid Development
        2. The Enterprise Challenge
        3. The J2EE Platform
        4. Defining an Adaptive Foundation
          1. Why a Foundation?
          2. Why Adaptive?
        5. Laying the Foundations for Rapid Development
          1. People
          2. Tools
          3. Frameworks
          4. Practices
          5. Standards
          6. Processes and Procedures
          7. Training
          8. Continuous Improvement
        6. Foundation Investment Benefits
        7. Critical Success Factors
          1. Obtaining Developer Acceptance
            1. Seminars
            2. Groupware
          2. Education
          3. Management Support
        8. Summary
          1. Additional Information
      2. 2. Rapid Application Development
        1. Common Elements of RAD
          1. Timebox Development
          2. Domain-Specific Languages
          3. Software Reuse
          4. Object-Oriented Programming (OOP)
          5. Component-Based Architectures
          6. Productivity Tools
          7. Rapid Prototyping
        2. Working with Prototypes
          1. Prototyping Approaches and Types
            1. Throwaway Prototyping
            2. Evolutionary Prototyping
            3. Behavioral Prototypes
            4. Structural Prototypes
          2. Choosing Between Throwaway and Evolutionary
        3. Summary
          1. Additional Information
      3. 3. Embracing Adaptive Methods
        1. Why Use a Methodology?
          1. A J2EE RAD Methodology
          2. Adaptive Versus Predictive Methods
        2. The Waterfall Lifecycle Model
          1. The Classic Waterfall Model
          2. Strengths and Weaknesses
          3. A Case Study
        3. Iterative Development
          1. The Benefits of an Iterative Approach
            1. Accommodates Changing Requirements
            2. Encourages Refinement of System Requirements
            3. Addresses Major Risks Early in the Lifecycle
            4. Produces a Robust Software Architecture
            5. Promotes Understanding and Facilitates Software Reuse
            6. Provides a Good Environment for Learning
            7. Software Quality Is Continually Assessed
            8. Estimates Are More Accurate and Realistic
            9. The Development Process Itself Can Be Evolved and Adapted
            10. Offers a More Enjoyable Team-Working Environment
          2. Iterative Processes
        4. Introducing RUP
          1. A Use-Case-Driven Process
          2. Iterative Development with RUP
          3. Phases of the Process
          4. Disciplines
          5. The Elements of RUP
            1. Artifacts: The What
            2. Activities: The How
            3. Roles: The Who
            4. Workflow: The When
          6. Planning
          7. Supporting Enterprise Projects
          8. Disadvantages of RUP
        5. Agile Methods
        6. Introducing XP
          1. The XP Practices
          2. Planning
          3. Designing
          4. Coding
          5. Testing
          6. XP Roles
          7. Adopting XP for Enterprise J2EE Projects
        7. Summary
          1. Additional Information
    8. II. Agile Architectures
      1. 4. Designing for Rapidity
        1. Architecture and Design Objectives
        2. RAD Architecture and Design
          1. Work to the Strengths of the Team
          2. Use Best-of-Breed Frameworks
          3. Think Ahead
            1. Include Test Stubs and Unit Tests as Part of the Design
            2. Be Wary of Weakly Typed Interfaces
          4. Be Wary of Designing for Reuse
          5. Apply Orthogonal Design
          6. Adopt a Layered Architecture
            1. Client Tier
            2. Middle/Business Tier
            3. Enterprise Information System Tier
        3. Approaches to J2EE Architecture
          1. Two-Tier Versus Multitier Architectures
          2. Enterprise JavaBeans
          3. Remote and Local Client Views
          4. Distributed Components
            1. Performance
            2. Complexity
            3. Object-Oriented Impedance
          5. Choosing the Appropriate Design
          6. Web-Centric Architecture
          7. EJB-Centric Architecture
        4. Summary
          1. Additional Information
      2. 5. Modeling Software
        1. Why Model?
          1. Communication
            1. Communication with the Customer
            2. Communication with the Project Team
            3. A Common Vocabulary
          2. Validation
            1. Driving Out Risk
            2. Controlling Change
        2. Multiple Views of Architecture
        3. The Unified Modeling Language
          1. Use-Case Diagrams
          2. Activity Diagrams
          3. Class Diagrams
          4. Interaction Diagrams
          5. Statechart Diagrams
          6. Deployment and Component Diagrams
        4. Common Failings
          1. Cargo Cult Software
        5. Modeling Tools
          1. Choosing a Modeling Tool
          2. UML Support
          3. Model Validation
          4. Forward and Reverse Engineering
          5. Design Pattern Support
        6. Why Modeling Tools Fail
          1. Christmas Puppy Syndrome
            1. Replacing Code with Diagrams
            2. Modeling Tools as a Replacement for OO Skills
            3. Ease-of-Use Layer
            4. No Inbuilt Methodology
            5. Training Is Not Required
        7. Succeeding with Modeling Tools
          1. Start Small
          2. Learn Modeling First
          3. Make the Tools Available to the Team
          4. Allow Time to Learn
          5. Remember to Communicate
        8. Summary
          1. Additional Information
      3. 6. Code Generation
        1. What Is Code Generation?
        2. Passive Code Generators
          1. Code Generation with Apache Velocity
          2. Benefits of Passive Code Generation
        3. Active Code Generators
          1. Benefits of Active Code Generation
          2. Active Code Generators and Boilerplate Code
        4. Attribute-Oriented Programming
          1. What Are Attributes?
          2. Attributes Versus Preprocessor Directives
          3. J2SE 5.0 Annotations and Attributes
        5. Introducing XDoclet
          1. Installing XDoclet
          2. Setting Up the Ant Build File
            1. Setup the XDoclet Classpath
            2. Define the XDoclet EJB Task
            3. Invoke XDoclet from Ant
          3. Creating a Session Bean
            1. Declaring XDoclet Attributes
            2. Class-Level Tags
            3. Method-Level Tags
            4. Inspecting the Output
        6. Working with Actively Generated Code
          1. Guidelines for Code Generation
            1. Generate Code as Part of the Build Process
            2. Keep Generated Code Separate from Other Source
            3. Do Not Place Actively Generated Code Under Source Control
            4. Be Wary When Using Refactoring Tools
            5. Avoid Mixing Active and Passive Code Generation
        7. Summary
          1. Additional Information
      4. 7. Rapidity and the Database
        1. The Database Dilemma
          1. Enterprise Data Is Valuable
            1. Separate Development and Database Teams
            2. Shared Data Between Systems
            3. Legacy Data Structures
            4. Data Security and Confidentiality
          2. The Object-Relational Impedance Mismatch
            1. Mapping Database Types to Java Types
            2. Mapping Relationships
            3. Data Models Driving the Object Model
        2. Data Access Options
          1. Java Database Connectivity (JDBC)
          2. Object/Relational Mapping Tools
          3. Entity Beans
          4. Java Data Objects
        3. Code Generation and O/R Mapping
          1. Introducing Hibernate
          2. Introducing Middlegen
        4. Setting Up the Database
          1. Introducing MySQL
          2. Creating a Database Schema
          3. Running the Database Script
        5. Generating the Persistence Layer
          1. Running Middlegen from Ant
          2. The Middlegen GUI
          3. Hibernate O/R Mapping Documents
          4. From Mapping Documents to Java
          5. Completing the Round Trip
        6. Summary
          1. Additional Information
      5. 8. Model-Driven Architecture
        1. The Promise of MDA
        2. MDA Explained
          1. Platform
          2. Models
            1. Platform-Independent Model
            2. Platform-Specific Model
          3. Mapping
        3. MDA Versus Traditional Modeling
          1. Strengths
            1. Business Focused
            2. Supports an Incremental Development Process
            3. Leveraging Change
            4. Fewer Application Defects
            5. Technology portability
          2. Weaknesses
            1. Working with Legacy Systems
            2. Viability
        4. MDA Compliant Tools
          1. Introducing AndroMDA
        5. MDA with AndroMDA
          1. Model Interchange with XMI
          2. PIM Marks
          3. MDA Cartridges
          4. Anatomy of a Cartridge
          5. Cartridge Templates
          6. AndroMDA Applied
            1. Reverse Engineering the Model
            2. Managing Handwritten Code
          7. AndroMDA 3.0
        6. Summary
          1. Additional Information
    9. III. Rapid Languages
      1. 9. Scripting
        1. Why Use a Scripting Language?
        2. Features of a Scripting Language
          1. Team Experience
          2. Crossplatform
          3. Integration with Java Classes
        3. Introducing Jython
          1. Installing Jython
          2. Running Scripts
          3. The Jython Language
          4. Integration with Java
          5. User-Interface Prototyping
          6. Creating a Jython Servlet
        4. A Groovy Alternative
        5. Summary
          1. Additional Information
      2. 10. Working to Rule
        1. Business Rules
          1. What Is a Business Rule?
          2. Structure of a Business Rule
          3. Dynamic Nature of Business Rules
        2. Business Rules in Software
          1. Hardcoded Rules
          2. Rule Definition Languages
          3. Tight Coupling of System and Business Logic
          4. Rule Duplication
        3. Rule Engines
          1. Rule-Based Systems
          2. Rules Engines in Enterprise Systems
        4. Introducing Jess
          1. Installing Jess
          2. Jess Example
            1. The Rete Algorithm
            2. Forward and Backward Chaining
          3. Jess and Java
        5. The Java Rule-Engine API
        6. Enterprise-Level Rule Engines
          1. Enterprise Rule-Engine Features
            1. Externalized Business Rules
            2. Rule-Based Language Support
            3. Rule Management Tools
          2. Rule-Engine Evaluation Criteria
        7. Summary
          1. Additional Information
      3. 11. Aspect-Oriented Programming
        1. Why AOP?
          1. Crosscutting Concerns
          2. Code Tangling and Scattering
          3. Traditional Approaches to Crosscutting Concerns
            1. Frameworks
            2. Design Patterns
            3. Mix-in Classes
            4. Domain-Specific Languages
        2. AOP Explained
          1. Concepts and Terminology
          2. Hunchbacks and Dragons
          3. Weaving Methods
        3. Introducing AspectJ
          1. AspectJ and Eclipse
          2. The AspectJ Compiler
          3. AspectJ Example
        4. Language Versus Framework
          1. AOP Framework Implementations
        5. Introducing AspectWerkz
          1. XML Aspect Definition
          2. Aspects as Metadata Annotations
          3. AspectWerkz Weaving Options
          4. Aspect-Oriented Middleware
        6. Adopting Aspects
          1. Development Aspects
          2. Production Aspects
          3. AOP and Other Paradigms
        7. Summary
          1. Additional Information
    10. IV. Dynamic Environments
      1. 12. Optimal Builds
        1. Time and Motion
          1. The Software Production Line
          2. Time and Motion for Software Development
        2. The Build Process
          1. Designing a Build Process
          2. J2EE Build Requirements
            1. Minimal Builds
            2. Minimal Deployments
          3. What Is Hot Deployment?
        3. Introducing Ant
        4. Minimal Builds with Ant
          1. The Importance of Build Dependencies
          2. Defining Build Dependencies in Ant
        5. Working with Subprojects
        6. Viewing Build Dependencies
        7. Standard Build Targets
        8. Project Organization
          1. Source Directory
          2. Lib Directory
          3. Build Directory
          4. Distribution Directory
        9. Integration with IDEs
        10. Extending Ant with Jython
          1. Creating a New Ant Task
          2. Compiling Jython Classes
          3. Testing the New Task
        11. Summary
          1. Additional Information
      2. 13. The Integrated Development Environment
        1. Why Use an IDE?
          1. IDE Core Features
        2. Introducing Eclipse
          1. What Is Eclipse?
          2. Installing and Running Eclipse
          3. The Eclipse Workspace
          4. The Eclipse Workbench Paradigm
          5. Extending the Workbench with Plug-in Tools
        3. IDE Features for Enterprise Development
          1. Code Wizards
          2. Editor Support for Multiple File Types
          3. Ant Integration
          4. Working with Code Generators
            1. Velocity Templates
            2. XDoclet
          5. Server Control and Application Deployment
          6. Modeling Support
          7. Database Access
        4. Debugging J2EE Applications with Eclipse
          1. Java Platform Debugger Architecture
            1. Local and Remote Debugging
            2. JVM Debug Configuration
          2. Debugging a J2EE Application
          3. Hot Swapping
          4. JSP Debugging
          5. Debugging Guidelines
            1. Check All New Code with the Debugger
            2. Set Conditional Breakpoints
            3. Use the Watch Functionality to Monitor Specific Variables
            4. Modify the State of Variables for Testing Purposes
            5. Explore the Code by Stepping Into and Out of Methods
        5. Summary
          1. Additional Information
      3. 14. Test-Driven Development
        1. Testing as a Development Paradigm
          1. The Benefits of Test-Driven Development
          2. The Cost of Test-Driven Development
        2. Introducing JUnit
          1. Running JUnit Tests with Eclipse
        3. Generating Unit Tests
          1. Generating Unit Tests with Eclipse
          2. Unit Tests and MDA
          3. Generating Test Cases with AndroMDA
        4. Testing from the Inside Out
          1. What Is a Mock?
          2. Working with Mocks
          3. Mock Flavors
          4. Dyna-Mocks to the Rescue
          5. Choosing Between Static and Dynamic Mocks
        5. Summary
          1. Additional Information
      4. 15. Efficient Quality Assurance
        1. Quality Assurance
          1. The Project Environment
          2. The Testing Process
          3. Testing for RAD Projects
        2. Automated Testing
          1. The J2EE Testing Challenge
          2. Test Automation Tools
        3. Functional Testing
        4. Introducing HttpUnit
          1. HttpUnit and JUnit
          2. Writing a Test with HttpUnit
        5. Load and Stress Testing
          1. Performance Concerns
        6. Introducing JMeter
          1. Testing MedRec with JMeter
          2. Creating a Thread Group
          3. The Configuration Elements
            1. The HTTP Request Defaults
            2. Creating a Cookie Manager
          4. Logic Controllers
            1. The Simple Controller
            2. Adding a Loop Controller
          5. Samplers
            1. Making a Login Request
            2. Submitting a Search Request
          6. Listeners
          7. Executing the Test Plan
          8. Analyzing the Results
            1. Aggregate Report Listener
            2. Graph Result Listener
        7. JMeter Guidelines
        8. Summary
          1. Additional Information
    11. A. Acronyms
    12. B. Bibliography

    Product information

    • Title: Rapid J2EE™ Development: An Adaptive Foundation for Enterprise Applications
    • Author(s): Alan Monnox
    • Release date: March 2005
    • Publisher(s): Pearson
    • ISBN: 0131472208