Introduction |
|
1 | (1) |
|
|
2 | (1) |
|
What Does This Book Cover? |
|
|
2 | (1) |
|
What This Book Does Not Cover |
|
|
3 | (1) |
|
What You Need to Use This Book |
|
|
3 | (1) |
|
|
4 | (1) |
|
Customer Support and Feedback |
|
|
5 | (4) |
|
|
5 | (1) |
|
|
6 | (1) |
|
|
6 | (3) |
|
Introduction to Design Patterns |
|
|
9 | (60) |
|
What is a Design Pattern? |
|
|
10 | (6) |
|
|
10 | (1) |
|
|
10 | (1) |
|
Other Catalogs and Resources |
|
|
11 | (1) |
|
Design Patterns and Visual Basic |
|
|
11 | (1) |
|
|
12 | (1) |
|
When Should we use Design Patterns? |
|
|
12 | (1) |
|
How a Design Pattern can Improve a Design |
|
|
13 | (1) |
|
The Fictional TakeHomePay Application |
|
|
13 | (3) |
|
|
16 | (48) |
|
|
17 | (1) |
|
The Singleton Design Pattern |
|
|
18 | (3) |
|
The Abstract Factory Design Pattern |
|
|
21 | (5) |
|
The Factory Method Design Pattern |
|
|
26 | (3) |
|
|
29 | (1) |
|
The Adapter and Facade Design Patterns |
|
|
29 | (5) |
|
The Bridge Design Pattern |
|
|
34 | (5) |
|
The Composite Design Pattern |
|
|
39 | (4) |
|
The Decorator Design Pattern |
|
|
43 | (6) |
|
|
49 | (2) |
|
|
51 | (1) |
|
The Observer Design Pattern |
|
|
52 | (3) |
|
|
55 | (5) |
|
The Strategy and Template Method Design Patterns |
|
|
60 | (4) |
|
Application of Design Patterns |
|
|
64 | (2) |
|
|
64 | (2) |
|
|
66 | (3) |
|
Design Patterns in the Data Tier |
|
|
69 | (48) |
|
Requirements of a Data Tier |
|
|
70 | (12) |
|
|
71 | (1) |
|
Analysing the Requirements |
|
|
71 | (1) |
|
|
72 | (1) |
|
A Simple but Inflexible Data-Tier Example |
|
|
72 | (2) |
|
A Slightly More Maintainable Example |
|
|
74 | (1) |
|
Creating a Flexible Data Access Framework |
|
|
75 | (1) |
|
|
75 | (1) |
|
The .NET Data Provider Objects |
|
|
76 | (1) |
|
The Design Patterns Analysis |
|
|
77 | (5) |
|
|
82 | (22) |
|
|
83 | (1) |
|
Building the Output Classes |
|
|
84 | (1) |
|
The Abstract Base Output Classes |
|
|
84 | (1) |
|
The Concrete Product Classes |
|
|
85 | (3) |
|
Building the Factory Classes |
|
|
88 | (1) |
|
The Abstract Factory Class |
|
|
88 | (1) |
|
The NWDSARequest Helper Class |
|
|
89 | (3) |
|
Managing Connection Strings |
|
|
92 | (3) |
|
The Concrete Factory Classes |
|
|
95 | (8) |
|
Compiling the Data Tier Application |
|
|
103 | (1) |
|
Testing the Data Tier Application |
|
|
104 | (10) |
|
A Simple Windows Test Application |
|
|
104 | (1) |
|
|
104 | (5) |
|
Testing the SQL Server .NET Data Provider |
|
|
109 | (1) |
|
Testing the OLE DB .NET Data Provider |
|
|
109 | (1) |
|
Testing the ODBC .NET Data Provider |
|
|
110 | (1) |
|
A Simple Web Test Application |
|
|
111 | (3) |
|
|
114 | (3) |
|
Design Patterns in the Middle Tier |
|
|
117 | (60) |
|
|
118 | (1) |
|
|
118 | (1) |
|
|
119 | (1) |
|
|
119 | (8) |
|
|
120 | (1) |
|
|
121 | (1) |
|
|
122 | (2) |
|
|
124 | (1) |
|
|
125 | (1) |
|
The Decorator Pattern Classes |
|
|
126 | (1) |
|
The Strategy Pattern Classes |
|
|
126 | (1) |
|
|
127 | (1) |
|
|
127 | (48) |
|
Setting up the Infrastructure |
|
|
128 | (1) |
|
Registering Inventory.dll |
|
|
128 | (1) |
|
|
129 | (1) |
|
Setting up the SQL Server Databases |
|
|
129 | (2) |
|
Creating a Visual Studio .NET Solution |
|
|
131 | (1) |
|
|
131 | (1) |
|
|
132 | (3) |
|
|
135 | (2) |
|
|
137 | (1) |
|
|
138 | (1) |
|
|
139 | (3) |
|
|
142 | (1) |
|
The ReceiveDocument Application |
|
|
142 | (11) |
|
The ProcessDocument Application |
|
|
153 | (1) |
|
Document Processing with the Decorator Pattern |
|
|
154 | (6) |
|
|
160 | (9) |
|
The Processing Manager - the OrderManager Class |
|
|
169 | (3) |
|
|
172 | (1) |
|
The SimpleQueueManager Class |
|
|
172 | (1) |
|
|
173 | (1) |
|
|
174 | (1) |
|
|
175 | (2) |
|
Design Patterns in the Presentation Tier |
|
|
177 | (78) |
|
The Problem with the Presentation Tier |
|
|
177 | (1) |
|
Introducing Model/View/Controller |
|
|
178 | (13) |
|
|
179 | (1) |
|
|
180 | (1) |
|
Decoupling the Model and the View |
|
|
181 | (1) |
|
Decoupling the View and the Controller |
|
|
181 | (1) |
|
The Design Patterns Used in MVC |
|
|
182 | (1) |
|
|
183 | (1) |
|
|
183 | (1) |
|
|
184 | (1) |
|
|
185 | (1) |
|
|
185 | (1) |
|
Running and Analysing the Application |
|
|
186 | (1) |
|
|
187 | (1) |
|
|
187 | (1) |
|
|
187 | (3) |
|
|
190 | (1) |
|
|
190 | (1) |
|
Event Handling and Delegates |
|
|
190 | (1) |
|
Multithreading and Asynchronous Programming |
|
|
191 | (1) |
|
Building an MVC Framework for .NET |
|
|
191 | (23) |
|
The MVC Framework Class Diagram |
|
|
192 | (1) |
|
A Simple MVC Class Diagram |
|
|
192 | (1) |
|
Incorporating the MVC Class Diagram into .NET |
|
|
193 | (8) |
|
The MVC Framework Class Schema |
|
|
201 | (3) |
|
Views Calling Other Views |
|
|
204 | (5) |
|
|
209 | (1) |
|
|
210 | (1) |
|
|
210 | (3) |
|
|
213 | (1) |
|
A Front End for Northwind Order Processing |
|
|
214 | (2) |
|
|
215 | (1) |
|
|
215 | (1) |
|
|
216 | (6) |
|
|
217 | (3) |
|
|
220 | (1) |
|
|
220 | (2) |
|
Concrete Views and Controllers |
|
|
222 | (30) |
|
NOPWin for the Sales Reps |
|
|
222 | (1) |
|
|
222 | (1) |
|
|
223 | (3) |
|
The OrdersController Class |
|
|
226 | (2) |
|
The OrdersControllerFactory Class |
|
|
228 | (1) |
|
|
228 | (2) |
|
The OrderController Abstract Class |
|
|
230 | (2) |
|
The NormalOrderController Class |
|
|
232 | (1) |
|
The SpecialOrderController Class |
|
|
232 | (1) |
|
The OrderControllerFactoryClass |
|
|
233 | (1) |
|
|
234 | (1) |
|
|
235 | (1) |
|
|
236 | (1) |
|
|
237 | (4) |
|
The OrdersController Class |
|
|
241 | (1) |
|
The ControllerFactoryWebBase Class |
|
|
242 | (1) |
|
The OrdersControllerFactory Class |
|
|
243 | (1) |
|
|
243 | (4) |
|
The OrderController Class |
|
|
247 | (2) |
|
The NormalOrderController Class |
|
|
249 | (1) |
|
The SpecialOrderController Class |
|
|
249 | (1) |
|
The OrderControllerFactory |
|
|
250 | (1) |
|
The Finished NOPWeb Application |
|
|
250 | (2) |
|
|
252 | (3) |
|
Between the Tiers: Design Patterns and .NET Remoting |
|
|
255 | (42) |
|
.NET Remoting -- A Primer |
|
|
256 | (2) |
|
Remoting Objects and the Host Server |
|
|
256 | (1) |
|
|
257 | (1) |
|
The Client, the Proxy, and the soapsuds.exe Utility |
|
|
257 | (1) |
|
The Configuration File, Default.cfg |
|
|
257 | (1) |
|
A Call Event Coordinator Example |
|
|
258 | (2) |
|
|
258 | (1) |
|
The Players in the System |
|
|
258 | (1) |
|
|
259 | (1) |
|
The Development Phases of our Application |
|
|
260 | (1) |
|
Phase 1 -- The Basic Application |
|
|
260 | (16) |
|
Collecting and Distributing Calls |
|
|
261 | (1) |
|
Recalling the Observer Pattern |
|
|
261 | (2) |
|
Taking Advantage of the Event and Delegate |
|
|
263 | (1) |
|
|
263 | (1) |
|
The Remote Notifier Object (EventCoordinator) and the Delegate |
|
|
264 | (3) |
|
The Remote CSR Server Object |
|
|
267 | (2) |
|
|
269 | (3) |
|
|
272 | (2) |
|
Running the Example Application |
|
|
274 | (1) |
|
A Note on the Proxy Pattern |
|
|
275 | (1) |
|
Phase 2 -- Asynchronous Call Handling |
|
|
276 | (5) |
|
The Asynchronous Programming Pattern |
|
|
276 | (1) |
|
Understanding the Pattern |
|
|
276 | (2) |
|
|
278 | (2) |
|
Building and Running the Example |
|
|
280 | (1) |
|
Phase 3 -- Flexible Policy Management |
|
|
281 | (13) |
|
Adjusting the Application Design |
|
|
281 | (1) |
|
Considering a Design Pattern Solution |
|
|
282 | (2) |
|
Deciding on the Decorators |
|
|
284 | (2) |
|
Amending the Representative Class Library |
|
|
286 | (1) |
|
The PolicyDecorator Class |
|
|
286 | (1) |
|
The IDPolicyDecorator Class |
|
|
287 | (1) |
|
The AreaPolicyDecorator Class |
|
|
288 | (1) |
|
The Configuration File, Default.cfg |
|
|
289 | (1) |
|
Building a Client Program |
|
|
290 | (2) |
|
The Configuration File, Default.cfg |
|
|
292 | (1) |
|
Building and Running the Example |
|
|
293 | (1) |
|
|
294 | (3) |
|
|
297 | (10) |
|
|
297 | (3) |
|
|
298 | (1) |
|
|
299 | (1) |
|
|
300 | (3) |
|
|
301 | (1) |
|
|
301 | (1) |
|
|
301 | (1) |
|
Poltergeists (aka Proliferation of Classes) |
|
|
302 | (1) |
|
|
302 | (1) |
|
|
302 | (1) |
|
Resources and Further Reading |
|
|
303 | (4) |
|
|
307 | |
|
A Typical Development Process |
|
|
308 | |
|
Project Stages and UML Tools |
|
|
308 | |
|
|
310 | |
|
|
310 | |
|
|
315 | |
|
The Includes (or Uses) Relationship |
|
|
315 | |
|
|
316 | |
|
|
316 | |
|
|
317 | |
|
Attributes and Operations |
|
|
320 | |
|
Aggregation and Composition |
|
|
321 | |
|
|
323 | |
|
When to use Class Diagrams |
|
|
323 | |
|
|
324 | |
|
Starting State and Final State |
|
|
325 | |
|
|
325 | |
|
|
326 | |
|
When to use Activity Diagrams |
|
|
326 | |
|
|
327 | |
|
|
327 | |
|
When to use Sequence Diagrams |
|
|
330 | |
|
|
330 | |
|
When to use State Diagrams |
|
|
331 | |
|
|
331 | |
|
|
332 | |
|
|
332 | |
|
When to use Physical Diagrams |
|
|
333 | |
|
|
334 | |