 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
Giorgio Sironi's Blog: The Repository pattern
by Chris Cornutt November 03, 2009 @ 09:49:35
Giorgio Sironi has recently posted a look at one of the more popular design patterns - the Repository pattern. He talks about how it can be used for two things: to create a collection of objects and the reuse of queries and their results.
A common infrastructure problem of an object-oriented application is how to deal with persistence and retrieval of objects. The most common way to obtain references to entities (for example, instances of the User, Group and Post class of a domain) is through navigation from another entity. [...] A Repository implementation provides the illusion of having an in-memory collection available, where all the objects of a certain class are kept
He gives an example of a method that grabs user information and encapsulate the database access for it so that it's not required to hit it for every run through their unit tests. He shows how to set up the interface for a GroupRepository and how to implement it in the test.
voice your opinion now!
repository design pattern tutorial
Keith Casey's Blog: Book Review PHP Design Patterns by Jason Sweat
by Chris Cornutt October 16, 2009 @ 08:30:03
Keith Casey has posted a review of the php|architect book "PHP Design Patterns" by Jason Sweat to his blog today.
Diving into the book itself, Jason covers 16 Design Patterns. He covers the basic ones like the dreaded and horribly abused and misused Singleton to the more advanced Active Record and Table Data Gateway. While he covers all of them to a good depth, there are a number that deserve special mention.
These "mentionables" include the Strategy, Observer and Mock Object patterns - all three Jason covers well with some good examples included. Overall, he found the book good, but needing some work in some areas (like in updated code samples).
voice your opinion now!
book review jasonsweat design pattern
Jim Plush's Blog: Followup on rethinking Zend Models with DDD - Framework code included
by Chris Cornutt July 17, 2009 @ 10:50:57
Following up on a previous post of his concerning a bit of different thinking around models in Zend Framework applications, Jim Plush is back with this new post about some decisions he's made.
As a follow up to my previous post I'm going to post some live examples of model layer with Zend framework based on Domain Driven Design concepts. I've spent the past few days studying up on domain driven design as well as a lot of Martin Fowler's work in relation to domain modeling and I think I have at least some code to start with that could get some conversations rolling.
Because of the lack of a standardized model layer in the Zend Framework, multiple methods for creating and using them are possible. Jim has created some examples with the Domain pattern to make a basic User class. His example shows how to create a User instance and run several methods on it (like getNickname, setNickname) and how you could pass it into an example web service as a complete object.
voice your opinion now!
pattern design domain model zendframework
Tobias Schlitt's Blog: Identity Map pattern
by Chris Cornutt April 22, 2009 @ 10:21:57
Tobias Schlitt has written up a new post looking at the identity pattern (an Enterprise application design pattern) and an implementation of Identity Map in the eZ Components framework.
The pattern affects the data access layer of an application and helps to avoid inconsistencies in data objects of your application. [...] In this article I want to give you a rough overview on the pattern itself and show you how you can test and use the functionality of PersistentObject.
The identity map pattern allows you to store/fetch objects across execution instances to reduce the overhead of recreating those objects every time. Tobias shows off the PersistentObject component as an example of it in action. It can create an identity map and store values (like session information in their example) and even includes methods to grab related objects as defined by calls to addRelatedObject.
voice your opinion now!
persistentobject ezcomponents design pattern identitymap
DevShed: The mysqli Extension and the Active Record Pattern
by Chris Cornutt April 15, 2009 @ 10:27:56
DevShed.com has posted the seventh article in their series looking at the Active Record design pattern in PHP applications. In this latest tutorial they show how to replace the older MySQL client libraries and use the newer mysqli client instead.
Well, as you'll surely recall, I built this class by using the old MySQL library included with the PHP distribution, which is good and efficient. But it's worth making the effort to see how this sample class can be rewritten by using the newer, revamped "mysqli" extension. Thus, this last episode will be dedicated exclusively to doing this, so you can have at your disposal an enhanced versions of the class.
For most of the code, you won't see too much of a change - the methods are named similarly and the results are references differently, but you shouldn't have to make too much of a change.
voice your opinion now!
extension mysqli activerecord design pattern tutorial
DevShed: Refactoring the MySQL Abstraction Class with the Active Record Pattern
by Chris Cornutt April 08, 2009 @ 07:56:18
DevShed has the latest article in their tutorial series looking at the Active Record design pattern posted today. This time they focus on a bit of refactoring to make their MySQL abstraction class a bit easier to use and work better.
As I stated in the end of the [previous] tutorial, however, some methods of this sample class implement redundant business logic, and as a consequence it's necessary to refactor them to fix this issue in a quick and simple manner. Thus, in the next few lines I'll be explaining how to accomplish this process progressively, and as always, accompanied by the corresponding code samples.
They change up some of the CRUD (Create, Read, Update, Delete) functions by dynamically constructing the SQL and updating the fetch functions to allow for more modifiers like "LIKE" or "LIMIT".
voice your opinion now!
refactor abstraction class activerecord design pattern tutorial
Noupe.com: Beautiful Forms - Design, Style, & make it work with PHP & Ajax
by Chris Cornutt March 10, 2009 @ 07:57:29
In this new article from Noupe.com they link to several resources that can help you make your site's forms a bit "more beautiful" by combining PHP and Ajax (and Javascript).
Forms needs a solid visual structure, a profound hierarchy of form elements (Fields and Labels), powerful techniques and Functionality (AJAX) to make the form look and work creatively. [...] Today we wanted to share with you some great steps to get the perfect form: we will go through designing and usability you need to keep in mind, styling your form, spicing it up with some nice javascript effects, validating user's input and finally getting it to work using PHP and Ajax.
Some of the links include:
Most of the article links also include links to demos of the tutorial/application in action.
voice your opinion now!
form design style functional ajax javascript link tutorial
|
Community Events
Don't see your event here? Let us know!
|