You are previewing Aspect-Oriented Software Development with Use Cases.
O'Reilly logo
Aspect-Oriented Software Development with Use Cases

Book Description

“A refreshingly new approach toward improving use-case modeling by fortifying it with aspect orientation.”

Ramnivas Laddad, author of AspectJ in Action

“Since the 1980s, use cases have been a way to bring users into software design, but translating use cases into software has been an art, at best, because user goods often don’t respect code boundaries. Now that aspect-oriented programming (AOP) can express crosscutting concerns directly in code, the man who developed use cases has proposed step-by-step methods for recognizing crosscutting concerns in use cases and writing the code in separate modules. If these methods are at all fruitful in your design and development practice, they will make a big difference in software quality for developers and users alike.

Wes Isberg, AspectJ team member

“This book not only provides ideas and examples of what aspect-oriented software development is but how it can be utilized in a real development project.”

MichaelWard, ThoughtWorks, Inc.

“No system has ever been designed from scratch perfectly; every system is composed of features layered in top of features that accumulate over time. Conventional design techniques do not handle this well, and over time the integrity of most systems degrades as a result. For the first time, here is a set of techniques that facilitates composition of behavior that not only allows systems to be defined in terms of layered functionality but composition is at the very heart of the approach. This book is an important advance in modern methodology and is certain to influence the direction of software engineering in the next decade, just as Object-Oriented Software Engineering influenced the last.”

Kurt Bittner, IBM Corporation

“Use cases are an excellent means to capture system requirements and drive a user-centric view of system development and testing. This book offers a comprehensive guide on explicit use-case-driven development from early requirements modeling to design and implementation. It provides a simple yet rich set of guidelines to realize use-case models using aspect-oriented design and programming. It is a valuable resource to researchers and practitioners alike.”

Dr. Awais Rashid, Lancaster University, U.K., and author of Aspect-Oriented Database Systems

“AOSD is important technology that will help developers produce better systems. Unfortunately, it has not been obvious how to integrate AOSD across a project’s lifecycle. This book shatters that barrier, providing concrete examples on how to use AOSD from requirements analysis through testing.”

Charles B. Haley, research fellow, The Open University, U.K.

Aspect-oriented programming (AOP) is a revolutionary new way to think about software engineering. AOP was introduced to address crosscutting concerns such as security, logging, persistence, debugging, tracing, distribution, performance monitoring, and exception handling in a more effective manner. Unlike conventional development techniques, which scatter the implementation of each concern into multiple classes, aspect-oriented programming localizes them.

Aspect-oriented software development (AOSD) uses this approach to create a better modularity for functional and nonfunctional requirements, platform specifics, and more, allowing you to build more understandable systems that are easier to configure and extend to meet the evolving needs of stakeholders.

In this highly anticipated new book, Ivar Jacobson and Pan-Wei Ng demonstrate how to apply use cases—a mature and systematic approach to focusing on stakeholder concerns—and aspect-orientation in building robust and extensible systems. Throughout the book, the authors employ a single, real-world example of a hotel management information system to make the described theories and practices concrete and understandable.

The authors show how to identify, design, implement, test, and refactor use-case modules, as well as extend them. They also demonstrate how to design use-case modules with the Unified Modeling Language (UML)—emphasizing enhancements made in UML 2.0—and how to achieve use-case modularity using aspect technologies, notably AspectJ.

Key topics include

  • Making the case for use cases and aspects

  • Capturing and modeling concerns with use cases

  • Keeping concerns separate with use-case modules

  • Modeling use-cases slices and aspects using the newest extensions to the UML notation

  • Applying use cases and aspects in projects

  • Whatever your level of experience with aspect-oriented programming, Aspect-Oriented Software Development with Use Cases will teach you how to develop better software by embracing the paradigm shift to AOSD.



    Table of Contents

    1. Copyright
    2. Praise for Aspect-Oriented Software Development with Use Cases
      1. The Addison-Wesley Object Technology Series
      2. The Component Software Series
    3. Preface
      1. What Is Aspect-Oriented Programming?
      2. What Is Aspect-Oriented Software Development?
      3. AOSD with Use Cases
      4. What This Book Is
      5. What This Book Is Not
      6. What You Need Before Reading This Book
      7. How to Read This Book
        1. Part I, The Case for Use Cases and Aspects
        2. Part II, Modeling and Capturing Concerns with Use Cases
        3. Part III, Keeping Concerns Separate with Use Case Modules
        4. Part IV, Establishing an Architecture Based on Use Cases and Aspects
        5. Part V, Applying Use Cases and Aspects in a Project
      8. How This Book Came About
        1. In the Beginning By Ivar
        2. Working Together By Pan-Wei
    4. Acknowledgments
    5. I. The Case for Use Cases and Aspects
      1. 1. Problem to Attack
        1. 1.1. The Use of Components Today
          1. 1.1.1. Building a System with Components
          2. 1.1.2. Benefits of Components
        2. 1.2. Limitation of Components
          1. 1.2.1. Inability to Keep Peers Separate
            1. Tangling
            2. Scattering
          2. 1.2.2. Inability to Keep Extensions Separate
        3. 1.3. Approaching a Solution
          1. Concern Separation Technique
          2. Concern Composition Mechanism
          3. 1.3.1. Early Support for Extensions
          4. 1.3.2. Support for Extensions in UML
        4. 1.4. Keeping Concerns Separate
      2. 2. Attacking the Problem with Aspects
        1. 2.1. Approaching a Solution with Aspects
        2. 2.2. Keeping Peers Separate with Aspects
        3. 2.3. Keeping Extensions Separate with Aspects
          1. Handle Waiting List
          2. Check Authorization
        4. 2.4. Need for Methodological Guidance
      3. 3. Today with Use Cases
        1. 3.1. Use Cases in Brief
        2. 3.2. Use-Case-Driven Development
        3. 3.3. Roles and Benefits of Use Cases
        4. 3.4. Gaps in the Use-Case Technique
        5. 3.5. Bridging the Gaps with Aspects
      4. 4. Tomorrow with Use-Case Modules
        1. 4.1. Building Systems in Overlays with Use-Case Slices
        2. 4.2. Keeping Peer Use Cases Separate
        3. 4.3. Keeping Extension Use Cases Separate
          1. Extension Points in UML
          2. Join Points and Pointcuts in AOP
        4. 4.4. Developing with Use-Case Modules
          1. Parallel Development with Use-Case Modules
          2. Develop Incrementally with Use-Case Modules
          3. Architecture Unifies Use-Case Modules
    6. II. Modeling and Capturing Concerns with Use Cases
      1. 5. Modeling Concerns with Use Cases
        1. 5.1. Use-Case Modeling
        2. 5.2. Use-Case Instances and Flows of Events
        3. 5.3. Describing Use Cases
          1. Multiple Basic Flows
          2. Referencing Subflows
        4. 5.4. Visualizing Use-Case Flows
        5. 5.5. Summary and Highlights
      2. 6. Structuring Use Cases
        1. 6.1. Use-Case Relationships
        2. 6.2. Use-Case Extend Relationship
          1. Extension Points
          2. Extension Pointcuts
          3. Extension Flow Declaration
          4. Extension Pointcut
        3. 6.3. Use-Case Include Relationship
          1. Inclusions and Extensions
        4. 6.4. Use-Case Generalization
          1. Generalization and Extensions
          2. Generalizations and Inclusions
        5. 6.5. Utility Use Cases
        6. 6.6. Summary and Highlights
      3. 7. Capturing Concerns with Use Cases
        1. 7.1. Understanding Stakeholder Concerns
          1. 7.1.1. Understanding the Problem Domain
          2. 7.1.2. Eliciting System Features
          3. 7.1.3. Dealing with Functional and Nonfunctional Requirements
        2. 7.2. Capturing Application Use Cases
          1. 7.2.1. Identifying Use-Case Variability
          2. 7.2.2. Handling Use-Case Variability
          3. 7.2.3. Dealing with Extension Use Cases
        3. 7.3. Capturing Infrastructure Use Cases
          1. 7.3.1. The Perform Transaction Use Case
          2. 7.3.2. Structuring Infrastructure Use Cases
          3. 7.3.3. Describing Infrastructure Use Cases
          4. 7.3.4. Dealing with Systemwide Concerns
        4. 7.4. Summary and Highlights
    7. III. Keeping Concerns Separate with Use-Case Modules
      1. 8. Keeping Peer Use-Case Realizations Separate with Aspects
        1. 8.1. Realizing Peer Use Cases
          1. 8.1.1. Collaborations
          2. 8.1.2. Realizing a Use Case
          3. 8.1.3. Overlap between Peer Use-Case Realizations
        2. 8.2. Keeping Use-Case Specifics Separate
          1. 8.2.1. Composing Use-Case-Specific Classes
          2. 8.2.2. Composing Use-Case-Specific Class Extensions
          3. 8.2.3. Collaborations in Use-Case Slices
        3. 8.3. Dealing with Overlap
          1. 8.3.1. Included Use-Case Slice
            1. Collaborations
            2. Classes
            3. Extensions
          2. 8.3.2. Generalized Use-Case Slice
            1. Collaboration
            2. Classes
            3. Features
          3. 8.3.3. Non-Use-Case-Specific Slice
        4. 8.4. Summary and Highlights
      2. 9. Keeping Extensions Separate with Pointcuts
        1. 9.1. Realizing Extension Use Cases
        2. 9.2. Keeping Modularity of Extension Use-Case Realizations
          1. 9.2.1. Operation Extensions
            1. Structural and Behavioral Context
            2. Operation Extension Declaration
          2. 9.2.2. Pointcuts
        3. 9.3. Parameterizing Pointcuts
          1. 9.3.1. Identifying Parameters
          2. 9.3.2. Defining Parameters
          3. 9.3.3. Parameterizing Pointcuts in AOP
        4. 9.4. Generalizing Extension Use-Case Realizations
        5. 9.5. Templating Use-Case Slices
        6. 9.6. Summary and Highlights
      3. 10. Building Systems with Use-Case Modules
        1. 10.1. A System Comprises Models
        2. 10.2. Use-Case Model
        3. 10.3. Analysis Model
          1. 10.3.1. Language of Analysis
            1. Boundary
            2. Control
            3. Entity
          2. 10.3.2. Conducting Analysis
        4. 10.4. Design and Implementation Models
          1. 10.4.1. Language of Design and Implementation
          2. 10.4.2. Conducting Design and Implementation
        5. 10.5. Use-Case Modules Cut Across Models
          1. 10.5.1. Preserving the Structure of the Use-Case Model
          2. 10.5.2. A Use-Case Module Contains Use-Case Slices
          3. 10.5.3. Use-Case Module Relationships
        6. 10.6. Composing and Configuring Use-Case Modules
        7. 10.7. Summary and Highlights
    8. IV. Establishing an Architecture Based on Use Cases and Aspects
      1. 11. Road to a Resilient Architecture
        1. 11.1. What Is Architecture?
        2. 11.2. What Is a Good Architecture?
          1. Separating Functional Requirements
          2. Separating Nonfunctional from Functional Requirements
          3. Separating Platform Specifics
          4. Separating Tests from the Units Being Tested
        3. 11.3. Steps to Establish an Architecture Baseline
          1. Architecture Baseline
          2. Use Cases Drive the Architecture Baseline
          3. Establish the Architecture Baseline Iteratively
        4. 11.4. Begin with a Platform-Independent Structure
          1. 11.4.1. Element Structure
            1. Layers
            2. Application Layer
            3. Domain layer
          2. 11.4.2. Use-Case Structure
        5. 11.5. Overlay Platform Specifics on Top
          1. 11.5.1. Choosing the Platform
          2. 11.5.2. Keeping Platform Specifics Separate
        6. 11.6. Summary and Highlights
      2. 12. Separating Functional Requirements with Application Peer Use Cases
        1. 12.1. Analyzing Application Use Cases
          1. 12.1.1. Identifying Classes
          2. 12.1.2. Allocating Use-Case Behavior to Classes
            1. Using a Communication Diagram
            2. Interaction Diagram
            3. Class Diagrams
            4. Analyzing Multiple Use Cases
        2. 12.2. Keeping Application Use Cases Separate
          1. 12.2.1. Element Structure
          2. 12.2.2. Use-Case Structure
            1. Non-Use-Case-Specific Slices
            2. Use-Case Slices
        3. 12.3. Designing Application Use Cases
          1. 12.3.1. Identifying Design Elements
            1. Identifying Design Elements from Analysis Elements
            2. New Design Elements
          2. 12.3.2. Identifying Components and Interfaces
        4. 12.4. Refining Design Elements
          1. 12.4.1. Keeping Class Extensions Separate
            1. Ignore
            2. Aspect
            3. Control Class
            4. Adapter Class
          2. 12.4.2. Keeping Operation Extensions Separate
            1. Summation
            2. Selection
          3. 12.4.3. Keeping State Transitions Separate
        5. 12.5. Summary and Highlights
      3. 13. Separating Functional Requirements with Application-Extension Use Cases
        1. 13.1. Analyzing Application-Extension Use Cases
          1. 13.1.1. Identifying Classes
          2. 13.1.2. Identifying Pointcuts
            1. Identifying the Structural Context
            2. Room.updateAvailability
            3. Operations in Reserve Room Handler and Reserve Room Form
          3. 13.1.3. Allocating Use-Case Behavior to Classes
            1. Behavioral Context
            2. Describe Class Responsibilities
        2. 13.2. Keeping Application-Extension Use Cases Separate
          1. 13.2.1. Structuring Alternate Flows
          2. 13.2.2. Keeping Alternate Flows Separate
        3. 13.3. Designing Application-Extension Use Cases
          1. 13.3.1. Designing Operation Extensions
          2. 13.3.2. Identifying Component Interfaces from Use-Case Extensions
          3. 13.3.3. Dealing with Multiple Extensions to a Use Case
          4. 13.3.4. Extending Multiple Use Cases
        4. 13.4. Dealing with Changes in the Base
          1. 13.4.1. Applying Reflection
          2. 13.4.2. Applying Design Patterns
          3. 13.4.3. Applying Adaptive Programming
        5. 13.5. Summary and Highlights
      4. 14. Separating Nonfunctional Requirements with Infrastructure Use Cases
        1. 14.1. Analyzing an Infrastructure Use Case
          1. 14.1.1. Identifying Classes
          2. 14.1.2. Identifying Pointcuts
            1. Operation Extension
            2. Structural Context
            3. Behavioral Context
          3. 14.1.3. Allocating Use-Case Behavior to Classes
            1. Describing Class Responsibilities
        2. 14.2. Keeping Infrastructure Use Cases Separate
          1. Refining the Element Structure
          2. Keeping Infrastructure Separate in Use-Case Slices
        3. 14.3. Designing Infrastructure Use Cases
          1. 14.3.1. Applying the Infrastructure Use-Case Slice with Aspects
          2. 14.3.2. Applying the Infrastructure Use-Case Slice with Filters
          3. 14.3.3. Identifying Components in the Infrastructure Layer
        4. 14.4. Dealing with Multiple Infrastructure Use Cases
          1. Multiple Extensions at a Single Execution Point
          2. Extension of Extension
          3. Separate Extensions
          4. Handling Variations in the Application Use Cases
        5. 14.5. Summary and Highlights
      5. 15. Separating Platform Specifics with Platform-Specific Use-Case Slices
        1. 15.1. Keeping Platform Specifics Separate
          1. 15.1.1. Three-Tier Systems
            1. Presentation Tier
            2. Business Tier
            3. Integration Tier
          2. 15.1.2. Tier Packages
          3. 15.1.3. Modeling Tiers with Infrastructure Use Cases
        2. 15.2. Overlaying User Interfaces
          1. 15.2.1. Minimal Use-Case Design without Presentation Specifics
          2. 15.2.2. A Web Presentation Mechanism in J2EE
          3. 15.2.3. Designing the Presentation Mechanism
            1. Minimal Use-Case Design Slice
            2. Presentation Slice
            3. Use-Case Presentation Slice
          4. 15.2.4. Applying the Presentation Mechanism
        3. 15.3. Overlaying Distribution
          1. 15.3.1. Minimal Use-Case Design without Distribution
          2. 15.3.2. An EJB Distribution Mechanism
            1. Creating an Instance of 〈BusinessService〉
            2. Making a Call to a 〈BusinessService〉 Instance
          3. 15.3.3. Designing the Distribution Mechanism
            1. Minimal Use-Case Design Slice
            2. Distribution Slice
            3. Use-case Distribution Slice
          4. 15.3.4. Applying the Distribution Mechanism
        4. 15.4. Overlaying Persistency
          1. 15.4.1. Minimal Use-Case Design without Persistence
          2. 15.4.2. A Relational Persistency Mechanism in J2EE
          3. 15.4.3. Designing Persistency Mechanism
            1. Minimal Use-Case Design Slice
            2. Entity-Persistence Slice
            3. Persistence Slice
            4. Use-Case Persistence Slice
          4. 15.4.4. Applying the Persistency Mechanism
        5. 15.5. Preserving the Use-Case Structure
        6. 15.6. Summary and Highlights
      6. 16. Separating Tests with Use-Case Test Slices
        1. 16.1. Test-First Approach
        2. 16.2. Identifying Test Cases from Use Cases
          1. 16.2.1. Identifying Test Cases from Use-Case Flows
          2. 16.2.2. Identifying Test Cases from Use-Case Variables
          3. 16.2.3. Identifying Test Cases across Multiple Application Use Cases
          4. 16.2.4. Identifying Test Cases for the Infrastructure and the Platform Specifics
          5. 16.2.5. Identifying Performance Test Cases
        3. 16.3. Identifying Elements to Be Tested
        4. 16.4. Designing and Implementing Tests
          1. Control
          2. Instrumentation
          3. 16.4.1. Designing a Test Infrastructure
            1. Use-Case Design Slice
            2. Test Infrastructure Slice
            3. Test-Case Slice
          4. 16.4.2. Designing a Test Case
        5. 16.5. Summary and Highlights
      7. 17. Evaluating the Architecture
        1. 17.1. Putting It Together
          1. Application Peer Use Cases (Chapter 12, “Separating Functional Requirements with Application Peer Use Cases”)
          2. Application-Extension Use Cases (Chapter 13, “Separating Functional Requirements with Application-Extension Use Cases”)
          3. Infrastructure Use Cases (Chapter 14, “Separating Nonfunctional Requirements with Infrastructure Use Cases”)
          4. Platform-Specific Extension Use Case (Chapter 15, “Separating Platform Specifics with Platform-Specific Use-Case Slices”)
          5. Test Cases (Chapter 16, “Separating Tests with Use-Case Test Slices”)
        2. 17.2. Evaluating Separation of Concerns
          1. 17.2.1. Evaluating Design Elements
          2. 17.2.2. Evaluating Design Packages
          3. 17.2.3. Evaluating Use-Case Structures
          4. 17.2.4. Automating the Evaluation
          5. 17.2.5. Enforcing the Separation of Concerns
        3. 17.3. Evaluating and Achieving Systemwide Concerns
          1. 17.3.1. Evaluating and Achieving Maintainability
          2. 17.3.2. Evaluating and Achieving Extensibility
          3. 17.3.3. Evaluating and Achieving Portability
          4. 17.3.4. Evaluating and Achieving Reusability
          5. 17.3.5. Evaluating and Achieving Performance and Reliability
        4. 17.4. Summary and Highlights
      8. 18. Describing the Architecture
        1. 18.1. Architecture Description Comprises Architectural Views
        2. 18.2. Architectural View of the Use-Case Model
        3. 18.3. Architectural View of the Analysis Model
          1. 18.3.1. Architecturally Significant Analysis Elements
          2. 18.3.2. Architecturally Significant Use-Case Analysis Slices
        4. 18.4. Architectural View of the Design Model
          1. 18.4.1. Architecturally Significant Deployment Elements
          2. 18.4.2. Architecturally Significant Process Elements
          3. 18.4.3. Architecturally Significant Design Elements
          4. 18.4.4. Architecturally Significant Use-Case Design Slices
        5. 18.5. Summary and Highlights
    9. V. Applying Use Cases and Aspects in a Project
      1. 19. Running a Project
        1. 19.1. Iterative Development
          1. 19.1.1. Phases in a Project
          2. 19.1.2. Activities in an Iteration
        2. 19.2. Estimating Development Effort
          1. 19.2.1. Estimation at the Beginning of a Project
          2. 19.2.2. Refining the Estimates
        3. 19.3. Planning and Controlling the Project
          1. 19.3.1. Estimating Project Delays
          2. 19.3.2. Keeping the Project on Track
        4. 19.4. Productivity Gains by Keeping Concerns Separate
        5. 19.5. Summary and Highlights
      2. 20. Tailoring the Approach
        1. 20.1. Achieving the Right Balance
        2. 20.2. Selecting Disciplines to Apply
          1. Use-Case Modeling and Analysis
          2. Design and Implementation
          3. Testing
        3. 20.3. Adopting at Different Phases of a Project
        4. 20.4. Summary and Highlights
      3. 21. Aspects and Beyond
        1. 21.1. Building a System in Extensions
        2. 21.2. Balancing Best Practices
          1. Use-Case-Driven
          2. Architecture-Centric
          3. Tailoring the Approach
          4. Develop Iteratively
        3. 21.3. The Road Ahead
    10. A. Modeling Aspects and Use-Case Slices in UML
      1. A.1. Modeling Intertype Declarations with Class Extensions
        1. Overlay Semantics
        2. AspectJ Mapping
      2. A.2. Modeling Advices with Operation Extensions
        1. Overlay Semantics
        2. AspectJ Mapping
        3. A.2.1. Semantics of Before and After
        4. A.2.2. Semantics of Around
      3. A.3. Modeling Pointcuts
        1. Overlay Semantics
        2. AspectJ Mapping
      4. A.4. Modeling Use-Case Slices
    11. B. Notation Guide
      1. B.1. Package
        1. Notation
        2. Usage
          1. Layers
          2. Tier Packages
          3. Model
        3. Relationships Between Packages
      2. B.2. Actors and Use Cases
        1. Notation
        2. Usage
        3. Relationships Between Use Cases
      3. B.3. Classes and Instances
        1. Notation
        2. Usage
        3. Relationships Between Classes
      4. B.4. Components and Interfaces
        1. Notation
        2. Usage
      5. B.5 Processes and Nodes
        1. Notation
        2. Usage
    12. References
    13. Glossary