Agile Principles, Patterns, and Practices in C#
2006-09-23 17:37
471 查看
TOC
Section I: Agile Development 1
Chapter 1: Agile Practices 3
The Agile Alliance 4
Principles 8
Conclusion 10
Bibliography 11
Chapter 2: Overview of Extreme Programming 13
The Practices of Extreme Programming 14
Conclusion 22
Bibliography 22
Chapter 3: Planning 23
Initial Exploration 24
Release Planning 25
Iteration Planning 25
Defining “Done” 26
Task Planning 26
Iterating 27
Tracking 28
Conclusion 29
Bibliography 29
Chapter 4: Testing 31
Test-Driven Development 32
Acceptance Tests 36
Serendipitous Architecture 37
Conclusion 38
Bibliography 39
Chapter 5: Refactoring 41
A Simple Example of Refactoring: Generating Primes 42
Conclusion 53
Bibliography 54
Chapter 6: A Programming Episode 55
The Bowling Game 56
Conclusion 98
Overview of the Rules of Bowling 99
Section II: Agile Design 101
Chapter 7: What Is Agile Design? 103
Design Smells 104
Why Software Rots 107
The Copy Program 108
Conclusion 113
Bibliography 114
Chapter 8: The Single-Responsibility Principle (SRP) 115
Defining a Responsibility 117
Separating Coupled Responsibilities 119
Persistence 119
Conclusion 119
Bibliography 120
Chapter 9: The Open/Closed Principle (OCP) 121
Description of OCP 122
The Shape Application 124
Conclusion 132
Bibliography 133
Chapter 10: The Liskov Substitution Principle (LSP) 135
Violations of LSP 136
Factoring Instead of Deriving 148
Heuristics and Conventions 150
Conclusion 151
Bibliography 151
Chapter 11: The Dependency-Inversion Principle (DIP) 153
Layering 154
A Simple DIP Example 157
The Furnace Example 160
Conclusion 161
Bibliography 162
Chapter 12: The Interface Segregation Principle (ISP) 163
Interface Pollution 163
Separate Clients Mean Separate Interfaces 165
Class Interfaces versus Object Interfaces 166
The ATM User Interface Example 169
Conclusion 174
Bibliography 175
Chapter 13: Overview of UML for C# Programmers 177
Class Diagrams 180
Object Diagrams 182
Collaboration Diagrams 183
State Diagrams 184
Conclusion 185
Bibliography 185
Chapter 14: Working with Diagrams 187
Why Model? 187
Making Effective Use of UML 189
Iterative Refinement 194
When and How to Draw Diagrams 200
Conclusion 202
Chapter 15: State Diagrams 203
The Basics 204
Using FSM Diagrams 208
Conclusion 209
Chapter 16: Object Diagrams 211
A Snapshot in Time 212
Active Objects 213
Conclusion 217
Chapter 17: Use Cases 219
Writing Use Cases 220
Diagramming Use Cases 222
Conclusion 223
Bibliography 223
Chapter 18: Sequence Diagrams 225
The Basics 226
Advanced Concepts 232
Conclusion 241
Chapter 19: Class Diagrams 243
The Basics 244
An Example Class Diagram 247
The Details 249
Conclusion 258
Bibliography 258
Chapter 20: Heuristics and Coffee 259
The Mark IV Special Coffee Maker 260
OOverkill 279
Bibliography 292
Section III: The Payroll Case Study 293
Rudimentary Specification of the Payroll System 294
Exercise 295
Chapter 21: Command and Active Object: Versatility and Multitasking 299
Simple Commands 300
Transactions 302
Undo Method 304
Active Object 305
Conclusion 310
Bibliography 310
Chapter 22: Template Method and Strategy: Inheritance versus Delegation 311
Template Method 312
Strategy 319
Conclusion 324
Bibliography 324
Chapter 23: Facade and Mediator 325
Facade 325
Mediator 327
Conclusion 329
Bibliography 329
Chapter 24: Singleton and Monostate 331
Singleton 332
Monostate 336
Conclusion 343
Bibliography 343
Chapter 25: Null Object 345
Description 345
Conclusion 348
Bibliography 348
Chapter 26: The Payroll Case Study: Iteration 1 349
Rudimentary Specification 350
Analysis by Use Cases 351
Reflection: Finding the Underlying Abstractions 360
Conclusion 363
Bibliography 363
Chapter 27: The Payroll Case Study: Implementation 365
Transactions 366
Main Program 408
The Database 409
Conclusion 411
About This Chapter 411
Bibliography 412
Section IV: Packaging the Payroll System 413
Chapter 28: Principles of Package and Component Design 415
Packages and Components 416
Principles of Component Cohesion: Granularity 417
Principles of Component Coupling: Stability 420
Conclusion 435
Chapter 29: Factory 437
A Dependency Problem 440
Static versus Dynamic Typing 441
Substitutable Factories 442
Using Factories for Test Fixtures 443
Importance of Factories 444
Conclusion 445
Bibliography 445
Chapter 30: The Payroll Case Study: Package Analysis 447
Component Structure and Notation 448
Applying the Common Closure Principle (CCP) 450
Applying the Reuse/Release Equivalence Principle (REP) 452
Coupling and Encapsulation 454
Metrics 455
Applying the Metrics to the Payroll Application 457
The Final Packaging Structure 463
Conclusion 465
Bibliography 465
Chapter 31: Composite 467
Composite Commands 469
Multiplicity or No Multiplicity 470
Conclusion 470
Chapter 32: Observer: Evolving into a Pattern 471
The Digital Clock 472
The Observer Pattern 491
Conclusion 493
Bibliography 494
Chapter 33: Abstract Server, Adapter, and Bridge 495
Abstract Server 496
Adapter 498
Bridge 503
Conclusion 505
Bibliography 506
Chapter 34: Proxy and Gateway: Managing Third-Party APIs 507
Proxy 508
Databases, Middleware, and Other Third-Party Interfaces 526
Table Data Gateway 528
Using Other Patterns with Databases 539
Conclusion 541
Bibliography 541
Chapter 35: Visitor 543
VISITOR 544
Acyclic Visitor 548
Decorator 560
Extension Object 565
Conclusion 576
Bibliography 577
Chapter 36: State 579
Nested Switch/Case Statements 580
Transition Tables 584
The State Pattern 586
Classes of State Machine Application 598
Conclusion 602
Bibliography 602
Chapter 37: The Payroll Case Study: The Database 603
Building the Database 604
A Flaw in the Code Design 605
Adding an Employee 607
Transactions 618
Loading an Employee 623
What Remains? 636
Chapter 38: The Payroll User Interface: Model View Presenter 637
The Interface 639
Implementation 640
Building a Window 650
The Payroll Window 657
The Unveiling 669
Conclusion 670
Bibliography 670
Appendix A: A Satire of Two Companies 671
Rufus Inc.: Project Kickoff 671
Rupert Industries: Project Alpha 671
Appendix B: What Is Software? 687
Index 699
Section I: Agile Development 1
Chapter 1: Agile Practices 3
The Agile Alliance 4
Principles 8
Conclusion 10
Bibliography 11
Chapter 2: Overview of Extreme Programming 13
The Practices of Extreme Programming 14
Conclusion 22
Bibliography 22
Chapter 3: Planning 23
Initial Exploration 24
Release Planning 25
Iteration Planning 25
Defining “Done” 26
Task Planning 26
Iterating 27
Tracking 28
Conclusion 29
Bibliography 29
Chapter 4: Testing 31
Test-Driven Development 32
Acceptance Tests 36
Serendipitous Architecture 37
Conclusion 38
Bibliography 39
Chapter 5: Refactoring 41
A Simple Example of Refactoring: Generating Primes 42
Conclusion 53
Bibliography 54
Chapter 6: A Programming Episode 55
The Bowling Game 56
Conclusion 98
Overview of the Rules of Bowling 99
Section II: Agile Design 101
Chapter 7: What Is Agile Design? 103
Design Smells 104
Why Software Rots 107
The Copy Program 108
Conclusion 113
Bibliography 114
Chapter 8: The Single-Responsibility Principle (SRP) 115
Defining a Responsibility 117
Separating Coupled Responsibilities 119
Persistence 119
Conclusion 119
Bibliography 120
Chapter 9: The Open/Closed Principle (OCP) 121
Description of OCP 122
The Shape Application 124
Conclusion 132
Bibliography 133
Chapter 10: The Liskov Substitution Principle (LSP) 135
Violations of LSP 136
Factoring Instead of Deriving 148
Heuristics and Conventions 150
Conclusion 151
Bibliography 151
Chapter 11: The Dependency-Inversion Principle (DIP) 153
Layering 154
A Simple DIP Example 157
The Furnace Example 160
Conclusion 161
Bibliography 162
Chapter 12: The Interface Segregation Principle (ISP) 163
Interface Pollution 163
Separate Clients Mean Separate Interfaces 165
Class Interfaces versus Object Interfaces 166
The ATM User Interface Example 169
Conclusion 174
Bibliography 175
Chapter 13: Overview of UML for C# Programmers 177
Class Diagrams 180
Object Diagrams 182
Collaboration Diagrams 183
State Diagrams 184
Conclusion 185
Bibliography 185
Chapter 14: Working with Diagrams 187
Why Model? 187
Making Effective Use of UML 189
Iterative Refinement 194
When and How to Draw Diagrams 200
Conclusion 202
Chapter 15: State Diagrams 203
The Basics 204
Using FSM Diagrams 208
Conclusion 209
Chapter 16: Object Diagrams 211
A Snapshot in Time 212
Active Objects 213
Conclusion 217
Chapter 17: Use Cases 219
Writing Use Cases 220
Diagramming Use Cases 222
Conclusion 223
Bibliography 223
Chapter 18: Sequence Diagrams 225
The Basics 226
Advanced Concepts 232
Conclusion 241
Chapter 19: Class Diagrams 243
The Basics 244
An Example Class Diagram 247
The Details 249
Conclusion 258
Bibliography 258
Chapter 20: Heuristics and Coffee 259
The Mark IV Special Coffee Maker 260
OOverkill 279
Bibliography 292
Section III: The Payroll Case Study 293
Rudimentary Specification of the Payroll System 294
Exercise 295
Chapter 21: Command and Active Object: Versatility and Multitasking 299
Simple Commands 300
Transactions 302
Undo Method 304
Active Object 305
Conclusion 310
Bibliography 310
Chapter 22: Template Method and Strategy: Inheritance versus Delegation 311
Template Method 312
Strategy 319
Conclusion 324
Bibliography 324
Chapter 23: Facade and Mediator 325
Facade 325
Mediator 327
Conclusion 329
Bibliography 329
Chapter 24: Singleton and Monostate 331
Singleton 332
Monostate 336
Conclusion 343
Bibliography 343
Chapter 25: Null Object 345
Description 345
Conclusion 348
Bibliography 348
Chapter 26: The Payroll Case Study: Iteration 1 349
Rudimentary Specification 350
Analysis by Use Cases 351
Reflection: Finding the Underlying Abstractions 360
Conclusion 363
Bibliography 363
Chapter 27: The Payroll Case Study: Implementation 365
Transactions 366
Main Program 408
The Database 409
Conclusion 411
About This Chapter 411
Bibliography 412
Section IV: Packaging the Payroll System 413
Chapter 28: Principles of Package and Component Design 415
Packages and Components 416
Principles of Component Cohesion: Granularity 417
Principles of Component Coupling: Stability 420
Conclusion 435
Chapter 29: Factory 437
A Dependency Problem 440
Static versus Dynamic Typing 441
Substitutable Factories 442
Using Factories for Test Fixtures 443
Importance of Factories 444
Conclusion 445
Bibliography 445
Chapter 30: The Payroll Case Study: Package Analysis 447
Component Structure and Notation 448
Applying the Common Closure Principle (CCP) 450
Applying the Reuse/Release Equivalence Principle (REP) 452
Coupling and Encapsulation 454
Metrics 455
Applying the Metrics to the Payroll Application 457
The Final Packaging Structure 463
Conclusion 465
Bibliography 465
Chapter 31: Composite 467
Composite Commands 469
Multiplicity or No Multiplicity 470
Conclusion 470
Chapter 32: Observer: Evolving into a Pattern 471
The Digital Clock 472
The Observer Pattern 491
Conclusion 493
Bibliography 494
Chapter 33: Abstract Server, Adapter, and Bridge 495
Abstract Server 496
Adapter 498
Bridge 503
Conclusion 505
Bibliography 506
Chapter 34: Proxy and Gateway: Managing Third-Party APIs 507
Proxy 508
Databases, Middleware, and Other Third-Party Interfaces 526
Table Data Gateway 528
Using Other Patterns with Databases 539
Conclusion 541
Bibliography 541
Chapter 35: Visitor 543
VISITOR 544
Acyclic Visitor 548
Decorator 560
Extension Object 565
Conclusion 576
Bibliography 577
Chapter 36: State 579
Nested Switch/Case Statements 580
Transition Tables 584
The State Pattern 586
Classes of State Machine Application 598
Conclusion 602
Bibliography 602
Chapter 37: The Payroll Case Study: The Database 603
Building the Database 604
A Flaw in the Code Design 605
Adding an Employee 607
Transactions 618
Loading an Employee 623
What Remains? 636
Chapter 38: The Payroll User Interface: Model View Presenter 637
The Interface 639
Implementation 640
Building a Window 650
The Payroll Window 657
The Unveiling 669
Conclusion 670
Bibliography 670
Appendix A: A Satire of Two Companies 671
Rufus Inc.: Project Kickoff 671
Rupert Industries: Project Alpha 671
Appendix B: What Is Software? 687
Index 699
相关文章推荐
- Agile Principles, Patterns, and Practices in C#
- Agile Principles,Patterns,And Practices in C# 之OCP源代码
- Agile Principles,Patterns,And Practices in C# 之敏捷软件开发宣言
- 《Agile Principles, Patterns, and Practices in C#》(chap 1 - chap 10)读后感
- Agile Principles,Patterns,And Practices in C# 之Strategy Pattern
- Agile Principles,Patterns,And Practices in C# 之保龄球积分
- 期待已久的一本电子书出来了:Applying Domain-Driven Design and Patterns: With Examples in C# and .NET
- [Study Note] Patterns and Practices in NHibernate
- Data Structures And Algorithms With Object-Oriented+Design+Patterns in C#
- Applying Domain-Driven Design and Patterns: With Examples in C# and .NET
- Applying Domain-Driven Design and Patterns(ADDDP) With examples in C# and .NET
- Applying Domain-Driven Design and Patterns(ADDDP) With examples in C# and .NET
- Applying Domain-Driven Design and Patterns(ADDDP) With examples in C# and .NET
- 通过HttpHandler和属性用Javascript调用C#方法(Using a HttpHandler and Attributes to call C# methods in Javascript)
- Working with PDF files in C# using PdfBox and IKVM
- Thread and Sync In C# (C#中的线程与同步)
- List of Microsoft patterns and practices for Application Architecture and Design
- Command Patterns in C#
- Use HttpUtility and NameValueCollection in c# of Visual Studio 2010
- Secure Coding Best Practices for Memory Allocation in C and C++