Chapter 23. Improving with More Design Patterns

The first iteration of the application is complete. A fully functioning prototype has been created and is theoretically ready for bug testing. However, there are still things that I can change using the help of some more Design Patterns.

The first thing I want to look at is the Contact Import functionality. I made this particular portion of the application very coupled to the requirements. While this may seem acceptable in theory, requirements don't always stay as solid as we'd like them to be. It's possible to have the requirements change along the way to allow more types of contact imports. If the requirements don't change, it may be one of the soonest requested feature updates. Couple this with the foresight that I have that access to this application may be sold to different parties; I should have created this section of the application more abstract. I'm going to look through some Design Patterns that can assist me with this task.

The second area I'm going to look at is the view system. There should be a clear separation between the creation of objects and the displaying of the user interface. The contents for one particular view of the contract were difficult to create. I mistakenly allowed some object creation and data retrieval method calls to enter this view. I'll use a pattern from my arsenal to fix this issue as well.

Let's tackle the Contact Import functionality first.

Get Professional PHP Design Patterns now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.