In this penultimate part of the series on the data mapper design pattern, I demonstrate how to provide the UserMapper class we’ve previously created with the ability to delete users from its associated MySQL table.
– Superbly described in Martin Fowler’s book Patterns of Enterprise Application Architecture, Data Mapper is a powerful database access pattern aimed at keeping domain objects isolated from the underlying storage mechanism (in most cases a relational database). This permits developers to build multi…
Archive for March, 2010
Finishing a Data Mapper Class for the Data Mapper Design Pattern
5-For-1 Deal Is Back With a Kindle & iPhone Twist
Our 5-for-1 sales last year were so popular, we thought we’d bring the concept back — but this time with a Kindle and iPhone twist!
Yes, our books are now Kindle, iPhone, iPad ready! But you can only get your hands on these hot new portable formats as part of this sale.
Related Posts
Implementing the Countable SPL Interface
In this third part of a seven-part series on the Iterator, Countable and ArrayAccess SPL interfaces, I give the MySQLi_ResultWrapper class developed in the previous part the capability of counting the number of rows contained in a given result set. I’ll do that by implementing the count() method declared by the Countable interface. Doing this will make it possible to use an instance of the class to traverse data sets and count records as if they were plain PHP arrays, which is quite appealing to client code that works with the classs API.
– As you possibly know, the Standard PHP Library (also know simply by its acronym, SPL) is comprised of a powerful set of functions, classes and interfaces that permit developers to address problems that occur frequently during the development of web programs. Ranging from autoloading classes on deman…
CSS3 Generators Write All that Pesky Code for You
Playing around with CSS3 is fun, but remembering all those experimental properties with their vendor prefixes, and which browser supports which property is a real bummer. But never fear, CSS3 code generators have it covered. Recently, I’ve found three useful ones.
Related Posts
phpRiot.com: Implementing a WebDAV filesystem with PHP and SabreDAV
On phpRiot.com there’s a new tutorial that will walk you through the creation of a WebDAV file system based on PHP and the SabreDAV library.
We are going to create a simple web drive that stores its files in a directory on the web server. By the end you will be able to effectively map this directory to your local computer and update files using your native operating system. Put simply, WebDAV (Web-based Distributed Authoring and Versioning) is an extension of HTTP that allows you to manage files on a remote web server. It allows you to think of files and directories on a web site as though they are local files on your computer.
Over the course of the next few pages they introduce DAV, set up your webserver to handle the requests and creates a sample script you can have set up quickly and get working. They also mention some of the additional things like locking, authentication, and working with plugins.
PHPBuilder.com: ExpressionEngine Enhances PHP Content Management with Framework Flexibility
In a new post to PHPBuilder.com today Jason Gilmore takes a look at a popular content management system from EllisLab called ExpressionEngine. He gives an overview of what it is and what it has to offer over some other CMSes out there.
Indeed, I concluded that no solution effectively offered both the fundamental features of a content management system and the flexibility of a web framework. However , after working with ExpressionEngine (one of the systems I recently highlighted in my article “The Top Five PHP Content Management Systems“), my opinion on this matter has fundamentally changed.
He mentions the hundreds of features included in ExpressionEngine, how it handles content management, templates and includes a powerful member/user management system. He also talk briefly about the plugin system with over 140 offerings currently available and more and more being added all the time.
Reflecting Abstract Classes and Interface Implementers with the Reflection API
In this sixth part of a seven-part series, I explain how to use the power of reflection to find out if a class has been defined abstract and final, and if it implements a specified interface. Performing all of these tasks is a straightforward process, so you shouldnt have major problems using these reflection methods within your own PHP applications.
– When it comes to highlighting the most remarkable features incorporated into PHP 5 a few years ago, undoubtedly its enhanced object model, along with the support for native exceptions and interfaces, are the first things that come to mind. However, as you may have heard, the language also comes wi…
Community News: Latest PEAR Releases for 03.29.2010
Latest PEAR Releases:
Mozilla Cancels Firefox Development on Windows Mobile
Mozilla has stopped all browser development on the Windows Mobile platform following Microsoft’s decision to restrict third-party access to the native hardware. Could this be the beginning of the end for Fennec?
Related Posts
Brandon Savage’s Blog: The Registry Pattern Reexamined
Brandon Savage takes another look at a popular design pattern – the registry pattern – and how he’s changed his thinking on its use a bit on how (or if) it should be used in your applications.
Last July, I wrote about the registry pattern and some of its advantages. These advantages include the ability to access objects across different areas of your application, and the storage of objects for later retrieval. [...] For me, over the last few months, I’ve discovered two reasons why I advise against the Registry Pattern: first and foremost, it discourages unit testing, and secondly, it discourages good design.
He goes on to elaborate on why these to things could be so detrimental to your code including the problems it can cause in tests being a point of failure and that it can make you application sloppy by giving you an unpoliced “bucket” to drop things in without any context to where they fit in the site.
So what’s his suggestion to replace this bit of functionality and make things both easy to test and simpler to keep structured? Dependency injection.
















































Recent Comments