Introduction |
|
xix | |
|
Part I: Object-Oriented Software Development Concepts |
|
|
1 | (98) |
|
Introduction to Object-Oriented Programming |
|
|
3 | (28) |
|
What Is Object-Oriented Programming? |
|
|
3 | (2) |
|
|
4 | (1) |
|
|
4 | (1) |
|
Understanding OOP Concepts |
|
|
5 | (23) |
|
|
6 | (1) |
|
|
6 | (9) |
|
|
15 | (9) |
|
|
24 | (3) |
|
|
27 | (1) |
|
|
28 | (1) |
|
|
29 | (2) |
|
Unified Modeling Language (UML) |
|
|
31 | (18) |
|
|
31 | (4) |
|
|
32 | (1) |
|
|
32 | (3) |
|
|
35 | (7) |
|
|
35 | (1) |
|
|
36 | (3) |
|
|
39 | (3) |
|
|
42 | (1) |
|
|
42 | (3) |
|
|
45 | (1) |
|
Component and Deployment Diagrams |
|
|
46 | (1) |
|
|
47 | (2) |
|
|
49 | (24) |
|
Creating the Contact Manager |
|
|
49 | (23) |
|
The Contact Manager UML Diagrams |
|
|
50 | (4) |
|
|
54 | (2) |
|
|
56 | (4) |
|
|
60 | (2) |
|
The Entity, Individual, and Organization Classes |
|
|
62 | (8) |
|
|
70 | (2) |
|
|
72 | (1) |
|
|
73 | (26) |
|
|
73 | (7) |
|
|
75 | (4) |
|
|
79 | (1) |
|
|
80 | (6) |
|
|
80 | (6) |
|
|
86 | (1) |
|
|
86 | (6) |
|
|
88 | (1) |
|
|
89 | (2) |
|
|
91 | (1) |
|
|
92 | (1) |
|
|
93 | (4) |
|
|
94 | (3) |
|
|
97 | (1) |
|
|
97 | (2) |
|
Part II: Creating a Reusable Object Toolkit I: Simple Utility Classes and Interfaces |
|
|
99 | (140) |
|
|
101 | (24) |
|
Purpose of the Collection Class |
|
|
101 | (1) |
|
Designing the Collection Class |
|
|
102 | (1) |
|
|
103 | (4) |
|
|
104 | (1) |
|
The getItem and removeltem Methods |
|
|
105 | (1) |
|
|
105 | (1) |
|
Using the Collection Class |
|
|
106 | (1) |
|
Implementing Lazy Instantiation |
|
|
107 | (9) |
|
|
108 | (4) |
|
The setLoadCallback Method in the Collection Class |
|
|
112 | (4) |
|
Using the Collection Class |
|
|
116 | (6) |
|
Improving the Collection Class |
|
|
122 | (1) |
|
|
123 | (2) |
|
|
125 | (8) |
|
|
125 | (4) |
|
The Collectionlterator Class |
|
|
127 | (2) |
|
The IteratorAggregate Interface |
|
|
129 | (1) |
|
Protecting the Iterator's Contents by Using the clone Operator |
|
|
130 | (2) |
|
|
132 | (1) |
|
|
133 | (24) |
|
|
133 | (13) |
|
When to Use GenericObject |
|
|
134 | (1) |
|
What GenericObject Allows You to Do |
|
|
134 | (1) |
|
Assessing Suitability for Implementation |
|
|
135 | (1) |
|
Typical GenericObject Implementation |
|
|
136 | (2) |
|
|
138 | (3) |
|
GenericObject Database Connectivity |
|
|
141 | (2) |
|
GenericObject Methods and Properties |
|
|
143 | (3) |
|
Benefits of GenericObject |
|
|
146 | (1) |
|
The GenericObjectCollection Class |
|
|
146 | (10) |
|
Traditional Implementation |
|
|
147 | (1) |
|
Where the Traditional Implementation Fails |
|
|
148 | (1) |
|
Principles behind GenericObjectCollection |
|
|
149 | (1) |
|
|
149 | (3) |
|
Typical GenericObjectCollection Implementation |
|
|
152 | (1) |
|
|
153 | (1) |
|
|
153 | (2) |
|
GenericObjectCollection Summary |
|
|
155 | (1) |
|
|
156 | (1) |
|
Database Abstraction Layers |
|
|
157 | (22) |
|
What Is a Database Abstraction Layer? |
|
|
158 | (1) |
|
|
158 | (6) |
|
|
158 | (1) |
|
Establishing a Connection |
|
|
159 | (1) |
|
|
159 | (1) |
|
|
160 | (2) |
|
|
162 | (2) |
|
|
164 | (6) |
|
Connecting to a Database Using DB |
|
|
165 | (1) |
|
|
166 | (2) |
|
|
168 | (2) |
|
|
170 | (1) |
|
The Complete Database Abstraction Layer |
|
|
170 | (8) |
|
|
174 | (1) |
|
The Singleton Design Pattern |
|
|
175 | (3) |
|
|
178 | (1) |
|
|
179 | (8) |
|
Factory Method Design Pattern |
|
|
179 | (1) |
|
Factory Interface Example |
|
|
180 | (4) |
|
|
180 | (1) |
|
The Factory Interface Approach |
|
|
181 | (1) |
|
Using the Factory Interface in Database Abstraction |
|
|
182 | (2) |
|
|
184 | (1) |
|
Leveraging Existing Classes |
|
|
185 | (1) |
|
|
186 | (1) |
|
|
187 | (14) |
|
|
187 | (1) |
|
Using OOP to Handle Events |
|
|
188 | (10) |
|
Designing an event-driven solution |
|
|
189 | (2) |
|
Implementing the solution |
|
|
191 | (4) |
|
|
195 | (3) |
|
|
198 | (1) |
|
|
198 | (3) |
|
|
201 | (22) |
|
Creating a Logging Mechanism |
|
|
201 | (16) |
|
|
201 | (1) |
|
Example File System Layout |
|
|
202 | (1) |
|
|
203 | (4) |
|
Extending the Logger Class |
|
|
207 | (10) |
|
Creating a Debugging Mechanism |
|
|
217 | (4) |
|
|
221 | (2) |
|
|
223 | (16) |
|
|
223 | (4) |
|
|
224 | (3) |
|
|
227 | (8) |
|
|
230 | (4) |
|
Exception Handling in the Soap Client |
|
|
234 | (1) |
|
|
235 | (2) |
|
|
237 | (2) |
|
Part III: Creating a Reusable Object Toolkit II: Complex (Though Not Complicated) Utilities |
|
|
239 | (122) |
|
Model, View, Controller (MVC) |
|
|
241 | (36) |
|
|
241 | (4) |
|
|
242 | (1) |
|
|
242 | (1) |
|
|
243 | (1) |
|
|
243 | (1) |
|
|
243 | (1) |
|
|
243 | (2) |
|
|
245 | (20) |
|
|
246 | (12) |
|
|
258 | (7) |
|
|
265 | (1) |
|
|
265 | (10) |
|
Recapping Native PHP Templating |
|
|
266 | (1) |
|
The Pitfalls of Native Templating |
|
|
266 | (1) |
|
True Templating with Smarty Templates |
|
|
266 | (1) |
|
|
267 | (1) |
|
|
268 | (5) |
|
|
273 | (2) |
|
When to Use Smarty vs. Traditional Templating |
|
|
275 | (1) |
|
|
275 | (2) |
|
|
277 | (24) |
|
|
277 | (3) |
|
Reasons to Communicate with Users |
|
|
278 | (2) |
|
Think Outside the Web Browser |
|
|
280 | (1) |
|
|
280 | (1) |
|
|
280 | (1) |
|
Not all communications have |
|
|
280 | (1) |
|
|
281 | (1) |
|
Communication As a Class Hierarchy |
|
|
281 | (5) |
|
The Recipient Class: A quick Test of OOP-Like Thinking |
|
|
281 | (4) |
|
|
285 | (1) |
|
|
286 | (12) |
|
|
287 | (3) |
|
Getting the Message Across |
|
|
290 | (6) |
|
Being Smart with Templates |
|
|
296 | (2) |
|
|
298 | (1) |
|
Other Communication Subclasses |
|
|
298 | (1) |
|
|
298 | (1) |
|
|
299 | (1) |
|
|
299 | (2) |
|
Sessions and Authentication |
|
|
301 | (28) |
|
|
301 | (11) |
|
A Brief Recap on How HTTP Works |
|
|
302 | (2) |
|
|
304 | (1) |
|
Perpetuation of a Session |
|
|
304 | (3) |
|
|
307 | (5) |
|
How PHP Implements Sessions |
|
|
312 | (4) |
|
|
312 | (3) |
|
Limitations of Basic PHP Sessions |
|
|
315 | (1) |
|
Creating an Authentication Class |
|
|
316 | (12) |
|
Connecting PHP Session Management to a Database |
|
|
316 | (1) |
|
Introducing the UserSession Class |
|
|
317 | (1) |
|
|
317 | (1) |
|
The Code: usersession.phpm |
|
|
318 | (4) |
|
The Code: Testing the UserSession Class |
|
|
322 | (4) |
|
How It Works: The UserSession Class |
|
|
326 | (2) |
|
|
328 | (1) |
|
|
328 | (1) |
|
|
329 | (16) |
|
Methodology and Terminology |
|
|
329 | (3) |
|
Designing the Interface of Your Class |
|
|
330 | (1) |
|
Creating a Test Suite for Your Class |
|
|
331 | (1) |
|
Writing the Implementation of Your Class |
|
|
332 | (1) |
|
|
332 | (1) |
|
|
332 | (1) |
|
|
333 | (1) |
|
|
333 | (4) |
|
|
333 | (3) |
|
|
336 | (1) |
|
|
337 | (1) |
|
|
337 | (1) |
|
|
337 | (1) |
|
Demonstrable Quality Assurance |
|
|
338 | (1) |
|
Reducing the Burden of Functional Testing |
|
|
338 | (1) |
|
|
338 | (5) |
|
|
343 | (2) |
|
Finite State Machine and Custom Configuration Files |
|
|
345 | (16) |
|
Introducing the Finite State Machine |
|
|
346 | (8) |
|
A Simple FSM: The RPN Calculator |
|
|
346 | (2) |
|
Theoretical Implementation of FSMs |
|
|
348 | (1) |
|
|
348 | (2) |
|
Disassembling the RPN Calculator Example |
|
|
350 | (3) |
|
Real-World Examples of FSMs |
|
|
353 | (1) |
|
Custom Configuration Files |
|
|
354 | (5) |
|
|
354 | (1) |
|
|
355 | (1) |
|
|
355 | (2) |
|
|
357 | (1) |
|
Configuration File Best Practice |
|
|
358 | (1) |
|
|
359 | (2) |
|
Part IV: Test Case: Sales Force Automation |
|
|
361 | (208) |
|
|
363 | (8) |
|
|
363 | (1) |
|
The Widget World Landscape |
|
|
364 | (3) |
|
|
365 | (1) |
|
|
366 | (1) |
|
|
366 | (1) |
|
|
366 | (1) |
|
Is It Really about Technology? |
|
|
366 | (1) |
|
|
367 | (3) |
|
What Does This Mean to Me? |
|
|
368 | (2) |
|
|
370 | (1) |
|
|
370 | (1) |
|
Project Management Methodologies |
|
|
371 | (20) |
|
|
371 | (3) |
|
Why Is the Project Happening? |
|
|
372 | (1) |
|
|
372 | (1) |
|
What Is the History of the Project? |
|
|
373 | (1) |
|
What Are the Anticipated Prerequisites of the Project? |
|
|
374 | (1) |
|
Receiving the Formal Brief |
|
|
374 | (8) |
|
|
375 | (1) |
|
|
376 | (1) |
|
|
377 | (1) |
|
|
378 | (2) |
|
|
380 | (1) |
|
|
380 | (1) |
|
|
381 | (1) |
|
|
381 | (1) |
|
|
381 | (1) |
|
|
382 | (1) |
|
|
382 | (4) |
|
|
382 | (1) |
|
Pitches versus Specifications |
|
|
383 | (1) |
|
Who to Involve When Pitching |
|
|
383 | (1) |
|
When to Go the Extra Mile |
|
|
384 | (1) |
|
|
384 | (1) |
|
|
385 | (1) |
|
|
386 | (3) |
|
|
386 | (1) |
|
|
387 | (1) |
|
|
387 | (1) |
|
Software Architects and Engineers |
|
|
388 | (1) |
|
|
388 | (1) |
|
|
388 | (1) |
|
|
388 | (1) |
|
|
389 | (1) |
|
|
389 | (1) |
|
|
389 | (1) |
|
|
389 | (2) |
|
|
391 | (14) |
|
|
391 | (3) |
|
|
391 | (1) |
|
|
392 | (1) |
|
|
393 | (1) |
|
|
394 | (5) |
|
|
394 | (2) |
|
|
396 | (2) |
|
|
398 | (1) |
|
|
398 | (1) |
|
|
399 | (1) |
|
Programming Methodologies and Practices |
|
|
399 | (3) |
|
|
399 | (1) |
|
|
400 | (2) |
|
|
402 | (2) |
|
|
402 | (1) |
|
Specification Changes That Arise after Sign-Off |
|
|
403 | (1) |
|
Disputes Arising from Differences in Interpretation |
|
|
403 | (1) |
|
Bugs Reported by the Client |
|
|
403 | (1) |
|
|
404 | (1) |
|
|
405 | (12) |
|
What Is Systems Architecture? |
|
|
405 | (2) |
|
|
405 | (1) |
|
|
406 | (1) |
|
Effectively Translating Requirements |
|
|
407 | (2) |
|
Hosting, Connectivity, Servers, and Network |
|
|
407 | (1) |
|
Redundancy and Resilience |
|
|
408 | (1) |
|
|
408 | (1) |
|
|
408 | (1) |
|
Designing the Environment |
|
|
409 | (6) |
|
|
409 | (1) |
|
|
409 | (2) |
|
|
411 | (2) |
|
|
413 | (1) |
|
|
414 | (1) |
|
|
414 | (1) |
|
|
414 | (1) |
|
|
415 | (2) |
|
Assembling the Sales Force Automation Toolkit |
|
|
417 | (96) |
|
Starting the Project: Monday |
|
|
417 | (10) |
|
|
418 | (2) |
|
|
420 | (6) |
|
|
426 | (1) |
|
|
427 | (24) |
|
Outlining Details of Story 9 |
|
|
427 | (1) |
|
|
428 | (1) |
|
|
429 | (7) |
|
Creating the login screen |
|
|
436 | (4) |
|
|
440 | (10) |
|
|
450 | (1) |
|
|
451 | (8) |
|
|
452 | (7) |
|
|
459 | (9) |
|
Story 14: Changing the Week Recalls a Previous Week |
|
|
459 | (1) |
|
Story 15: Per-Week Items on the Customer Contact Report |
|
|
460 | (8) |
|
|
468 | (24) |
|
|
471 | (2) |
|
|
473 | (3) |
|
|
476 | (1) |
|
More Travel Expense Week Tests |
|
|
477 | (3) |
|
Satisifying the Travel Expense Week Tests |
|
|
480 | (12) |
|
The Finalized Travel Expense Report |
|
|
492 | (14) |
|
|
506 | (5) |
|
|
511 | (2) |
|
|
513 | (18) |
|
|
513 | (5) |
|
|
514 | (1) |
|
|
515 | (1) |
|
Measurable and Quantifiable Quality |
|
|
515 | (3) |
|
|
518 | (3) |
|
|
518 | (1) |
|
|
519 | (1) |
|
|
520 | (1) |
|
|
520 | (1) |
|
|
521 | (8) |
|
Effective Fault Management Using Mantis |
|
|
522 | (7) |
|
Getting the Most Out of Mantis |
|
|
529 | (1) |
|
|
529 | (2) |
|
|
531 | |
|
Devising Development Environments |
|
|
531 | (5) |
|
The Studio Development Environment |
|
|
531 | (1) |
|
The Studio Staging Environment |
|
|
532 | (1) |
|
The Live Staging Environment |
|
|
533 | (1) |
|
The Live Production Environment |
|
|
534 | (1) |
|
|
534 | (2) |
|
|
536 | (5) |
|
Automated Version Control Repository Extraction |
|
|
537 | (1) |
|
|
538 | (2) |
|
Keeping Servers in Sync with rsync |
|
|
540 | (1) |
|
|
541 | |
|
Designing and Developing a Robust Reporting Platform |
|
|
1 | (564) |
|
Introduction to Working Data |
|
|
1 | (6) |
|
Understanding Your Client's Needs |
|
|
2 | (1) |
|
|
2 | (1) |
|
|
3 | (1) |
|
|
4 | (3) |
|
Report Generation Architecture |
|
|
7 | (15) |
|
|
9 | (1) |
|
|
10 | (1) |
|
|
11 | (4) |
|
The Report Processor Script |
|
|
15 | (1) |
|
|
16 | (1) |
|
The Report Handler Scripts |
|
|
17 | (1) |
|
|
18 | (1) |
|
The Report Translator Scripts |
|
|
19 | (2) |
|
Example Usage of the Reports Engine |
|
|
21 | (1) |
|
|
21 | (1) |
|
|
22 | (543) |
|
Where Do You Go from Here? |
|
|
565 | (4) |
|
|
565 | (1) |
|
Your Career As a Developer |
|
|
566 | (1) |
|
More Than Web Development Skills |
|
|
566 | (1) |
|
|
566 | (1) |
|
|
567 | (1) |
|
|
567 | (1) |
|
|
567 | (2) |
Appendix A: Why Version Control Is a Good Thing |
|
569 | (14) |
Appendix B: PHP IDEs |
|
583 | (16) |
Appendix C: Performance Tuning PHP |
|
599 | (10) |
Appendix D: Best Practice PHP Installation |
|
609 | (12) |
Index |
|
621 | |