wiley - enterprise java with uml

457 379 0
wiley - enterprise java with uml

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

Enterprise Java™ with UML™ CT Arlington Wiley Computer Publishing John Wiley & Sons, Inc. NEW YORK • CHICHESTER • WEINHEIM • BRISBANE • SINGAPORE • TORONTO To my beautiful wife Anne, you were sooo worth the wait! Always and forever, To Bethany Carleen, our precious daughter, and my personal trainer. To Anne Burzawa, my best friend from cradle to grave. Publisher: Robert Ipsen Editor: Theresa Hudson Developmental Editor: Kathryn A. Malm Managing Editor: Angela Smith Text Design & Composition: Publishers' Design and Production Services, Inc. Designations used by companies to distinguish their products are often claimed as trademarks. In all instances where John Wiley & Sons, Inc., is aware of a claim, the product names appear in initial capital or ALL CAPITAL LETTERS. Readers, however, should contact the appropriate companies for more complete information regarding trademarks and registration. This book is printed on acid-free paper. © Copyright © 2001 by CT Arrington. All rights reserved. Published by John Wiley & Sons, Inc. Published simultaneously in Canada. No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 750-4744. Requests to the Publisher for permission should be addressed to the Permissions Department, John Wiley & Sons, Inc., 605 Third Avenue, New York, NY 10158-0012, (212) 850-6011, fax (212) 850-6008, E-Mail: PERMREQ @ WILEY.COM. This publication is designed to provide accurate and authoritative information in regard to the subject matter covered. It is sold with the understanding that the publisher is not engaged in professional services. If professional advice or other expert assistance is required, the services of a competent professional person should be sought- Library of Congress Cataloging-in-Publication Data: ISBN: 0-471-38680-4 Printed in the United States of America. 10 98765432 Contents OMG Press Advisory Board xvii OMG Press Books in Print xix About the OMG xxi Chapter 1 Introduction to Modeling Java with the UML 1 What Is Modeling? 2 Simplification 3 Varying Perspectives 3 Common Notation 4 UML 4 The Basics 4 Modeling Software Systems with the UML 13 The Customer's Perspective 13 The Developer's Perspective 14 Modeling Process 14 Requirements Gathering 15 Analysis 15 Technology Selection 15 Architecture 15 Design and Implementation 16 The Next Step 16 Chapter 2 Gathering Requirements with UML 17 Are You Ready? 18 What Are Good Requirements? 18 Find the Right People 19 Listen to the Stakeholders 20 Develop Accessible Requirements 21 Describe Detailed and Complete Requirements 24 III iv Contents Refactor the Use Case Model 27 Guidelines for Gathering Requirements 34 Focus on the Problem 34 Don't Give Up 35 Don't Go Too Far 35 Believe in the Process 36 How to Detect Poor Requirements 37 Path 1: Excessive Schedule Pressure 38 Path 2: No Clear Vision 39 Path 3: Premature Architecture and Design 40 The Next Step 40 Chapter 3 Gathering Requirements for the Timecard Application 41 Listen to the Stakeholders 42 Build a Use Case Diagram 44 Find the Actors 44 Find the Use Cases 45 Determine the Actor-to-Use-Case Relationships 47 Describe the Details 48 Guidelines for Describing the Details 48 Gathering More Requirements 58 Revising the Use Case Model 61 Revise the Use Case Diagram 61 Revising the Use Case Documentation 63 The Next Step 75 Chapter 4 A Brief Introduction to Object-Oriented Analysis with the UML 77 Are You Ready? 78 Solid Requirements 78 Prioritizing Use Cases 78 What Is Object-Oriented Analysis? 80 The Analysis Model 80 Relationship to Use Case Model SO Steps for Object-Oriented Analysis 81 Discover Candidate Objects 81 Guidelines for Discovering Objects 81 Process for Discovering Objects 83 Describe Behavior 90 Guidelines for Finding Behavior 90 Contents v A Process for Describing Behavior 92 Describe the Classes 95 Guidelines for Describing Classes 95 Process for Describing Classes 97 The Next Step 101 Chapter 5 Analysis Model for the Timecard Application 103 Prioritizing the Use Cases 103 The Ranking System 104 Evaluation of the Export Time Entries Use Case 107 Eva uation of the Create Charge Code Use Case 108 Eva uation of the Change Password Use Case 109 Eva uation of the Login Use Case 109 Eva uation of the Record Time Use Case 110 Eva uation of the Create Employee Use Case 111 Select Use Cases for the First Iteration 112 Discover Candidate Objects 112 Discover Entity Objects 113 Discover Boundary Objects 116 Discover Control Classes 118 Discover Lifecycle Classes 118 Describe Object Interactions 118 Add Tentative Behavior for Login 119 Build Sequence Diagrams for Login 119 Validate Sequences for Login 122 Sequence Diagrams and Class Diagrams for the Remaining Use Cases 124 Describe Classes 126 Find Relationships for Login 127 Find Relationships for Export Time Entries 128 Find Relationships for Record Time 129 The Next Step 131 Chapter 6 Describing the System for Technology Selection 133 Are You Ready? 134 Group Analysis Classes 134 Boundary (User Interface) 134 Boundary (System Interface) 136 Control, Entity, and Lifecycle 136 Describe Each Group 136 User Interface Complexity 137 vi Contents Deployment Constraints for User Interfaces 138 Number and Type of Users 140 Available Bandwidth 141 Types of System Interfaces 142 Performance and Scalability 143 Technology Requirements for the Timecard Application 144 Find Groups of Analysis Classes 144 User Interface Complexity 144 Deployment Constraints for User Interfaces 146 Number and Type of Users 147 Available Bandwidth 148 Types of System Interfaces 148 Performance and Scalability 148 The Next Step 152 Chapter 7 Evaluating Candidate Technologies for Boundary Classes 153 Technology Template 153 Swing 154 Gory Details 155 Strengths 165 Weaknesses 165 Compatible Technologies 165 Cost of Adoption 166 Suitability 167 Java Servlets 168 Gory Details 170 Strengths 172 Weaknesses 172 Compatible Technologies 172 Cost of Adoption 172 Suitability 173 XML 175 Gory Details 176 Strengths 178 Weaknesses 178 Compatible Technologies 178 Cost of Adoption 178 Suitability 179 Contents vii Technology Selections for the Timecard System 180 User Interface Classes 180 Conclusion 181 The Next Step 182 Chapter 8 Evaluating Candidate Technologies for Control and Entity Classes 183 RMI 183 Gory Details 184 Common Uses of RMI 188 Strengths 192 Weaknesses 192 Compatible Technologies 192 Cost of Adoption 192 JDBC 193 Gory Details 193 Strengths 196 Weaknesses 197 Compatible Technologies 198 Cost of Adoption 198 Suitability of RMI and JDBC 198 ETB 1.1 199 Gory Details 202 Strengths 205 Weaknesses 206 Compatible Technologies 206 Cost of Adoption 206 Suitability 207 Sampie Technology Selection 208 Technology Requirements 208 The Next Step 210 Chapter 9 Software Architecture 211 Are You Ready? 212 Clear Understanding of the Problem 212 Clear Understanding of the Technology 212 Goals for Software Architecture 213 Extensibility 213 Maintainability 213 viii Contents Reliability 214 Scalability 214 UML and Architecture 214 Packages 214 Package Dependency 217 Subsystems 219 Guidelines for Software Architecture 221 Cohesion 222 Coupling 222 Creating a Software Architecture 222 The Architect 222 A Process 223 Sample Architecture for the Timecard System 225 Set Goals 225 Group and Evaluate Classes 226 Show Technologies 233 Extract Subsystems 233 Evaluate against Guidelines and Goals 233 The Next Step 237 Chapter 10 Introduction to Design 239 What Is Design? 239 Are You Ready? 240 The Need for Design 240 Productivity and Morale 240 A Malleable Medium 241 Scheduling and Delegation 241 Design Patterns 241 Benefits 242 Use 243 Planning for Design 243 Establish Goals for the Entire Design 244 Establish Design Guidelines 245 Find Independent Design Efforts 246 Designing Packages or Subsystems 246 Design Efforts for the Timecard Application 247 The Next Step 248 Chapter 11 Design for the TimecardDomain and TimecardWorkflow 249 Contents IX Establish Goals for the Effort 250 Performance and Reliability 250 Reuse 250 Extensibility 250 Review Prior Steps 251 Review of the Analysis Model 251 Review Architectural Constraints 257 Design for Goals 258 Apply Design for Each Use Case 262 Design for the Login Use Case 262 Design for the Record Time Use Case 266 Design for the Export Time Entries Use Case 271 Evaluate the Design 273 Implementation 277 User Entity Bean 277 Timecard Entity Bean 283 LoginWorkflow Stateless Session Bean 292 RecordTimeWorkflow Stateful Session Bean 296 Supporting Classes 301 ChargeCodeHome 308 ChargeCodeWrapper.java 319 Node.java 320 The Next Step 321 Chapter 12 Design for HTML Production 323 Design Goals 324 Goal 1: Support Modular Construction of Views 324 Goal 2: Keep HTML Production Simple 324 Goal 3: Support Preferences 326 Goal 4: Extensibility and Encapsulation 326 Design to Goals 327 Design for Goal 1: Support Modular Construction of Views 327 Design for Goal 2: Keep HTML Production Simple 330 Design for Goal 3: Support Preferences 335 Design for Goal 4: Extensibility and Encapsulation 338 Filling in the Details 339 Implementation 346 IHtmlProducer.java 346 ComboBoxProducer.java 347 X Contents FormProducer.java 348 PageProducer.java 350 SubmitButtonProducer 351 TableProducer.java 352 TabularlnputFormProducer.java 354 TextFieldProducer.java 356 TextProducer.java 358 IConcreteProducer.java 359 ProducerFactory.java 360 FormProducerGeneric.java 364 PageProducerGeneric.java 366 TableProducerGeneric.java 368 TabularTnputFormProducerGeneric.java 369 The Next Step 371 Chapter 13 Design for the TimecardUl Package 373 Establish Design Goals 373 Extensibility 373 Testability 374 Review Prior Steps 374 Review Architectural Constraints 374 Review Analysis Model 375 Design to Goals 379 Design for Each Use Case 381 Create Design for the Login Use Case 381 Create Design for the Record Time Use Case 383 Implementation 387 LoginServlet.java 387 RecordTimeServlet.java 392 BaskServlet.java 397 The Next Step 399 Chapter 14 Design for Bill! ngSystem Interface 401 Identify Goals 401 Clarity 402 Performance and Reliability 402 Extensibility 402 Reuse Potential 402 Review of Analysis Model 402 Review of Architecture 402 [...]... interfaces, 2D and 3D graphics, and more Finally, Enterprise JavaBeans and Java 2 Enterprise Edition provide specifications for true cross-platform enterprise computing Many of the problems that have plagued enterprise developers for decades, such as object-to-relational persistence, object caching, data integrity, and resource management are being addressed with newfound vigor These specifications, and... software modeling with the UML, and demonstrates how developers can use UML throughout the software development process to create better enterprise Java systems and more livable enterprise Java projects The remainder of this chapter discusses software modeling in more detail and presents some object-oriented terminology and UML notation as a foundation for the rest of the book This is a book for Java developers... Multiplicity One object may have an association with a single object, with a certain number of objects, or with an unlimited number of objects Figure 1.8 shows several relationships Figure 1.7 Sample association with one-way navigability Introduction to Modeling lava with the UML Figure 1.8 Sample associations with multiplicity with the multiplicity determined In the UML, the multiplicity describes the object... types of relationships: • Dependency • Association Figure 1.2 The ToySoldier class in the UML » Enterprist Java with UML - Aggregation • Composition Dependency Dependency is the weakest relationship between objects An object depends on an object if it has a short-term relationship with the object During this short-lived relationship, the dependent object may call methods on the other object to obtain... Fortunately, Java provides a lot of support as we struggle to meet these demands First and perhaps foremost, Java is a small, tightly written object-oriented language with excellent support for exception handling and concurrency built in Of course, this language runs on a pi a tform-independent virtual machine that allows Java systems to run on everything from a PalmPilot to a Web browser to an AS400, with. .. understanding of UML notation to others Critically review a wide variety of UML software models Use UML to create a detailed understanding of the problem from the user's perspective • Use UML to visualize and document a balanced solution using the full suite of Java technologies • Use UML to describe other technologies and class libraries What Is Modeling? A model is a simplification with a purpose It... notation for modeling object-oriented software systems In fact, UML was created to end the confusion between competing notations Many of the best and brightest academics and practitioners in the field of object-oriented software development joined together in the mid- to late-1990s to create a common notation It is now the international standard for modeling object-oriented systems The UML is an open standard... Richard Mark Soley, Ph.D Chairman and Chief Executive Officer Object Management Group, Inc xvii Introduction to Modeling Java with the UML As Java completes its move from a novelty language to the language of choice for Webenabled enterprise computing, Java developers are faced with many opportunities as well as many challenges We must produce systems that scale as the underlying business grows and... "Every Person object is associated with an unspecified number of Car objects," and "every Car object is associated with an unspecified number of Person objects." It may help to think of this as a "knows-about-a" relationship, as in "each Person object knows about some Car objects." Figure 1.3 Sample dependency relationship Introduction to Modeling Java with the UML Figure 1.4 Sample association relationship... them, allow us to leverage a wealth of academic research and practical experience We are better equipped to develop enterprise systems than ever before 1 2 Enterprise Java with UML However, powerful tools do not guarantee success Before developers can harness the enormous power of enterprise Java technology, they need a clear understanding of the problem and a clear plan for the solution In order to develop . Inc. xvii Introduction to Modeling Java with the UML As Java completes its move from a novelty language to the language of choice for Web- enabled enterprise computing, Java developers are faced with many opportunities. develop enterprise sys- tems than ever before. 1 2 Enterprise Java with UML However, powerful tools do not guarantee success. Before developers can harness the enormous power of enterprise Java. modeling with the UML, and demonstrates how devel- opers can use UML throughout the software development process to create better enter- prise Java systems and more livable enterprise Java projects.

Ngày đăng: 28/04/2014, 15:46

Từ khóa liên quan

Tài liệu cùng người dùng

Tài liệu liên quan