News Feed
Jobs Feed
Sections




Recent Jobs

News Archive
feed this:

Giorgio Sironi's Blog:
The Repository pattern
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.

0 comments voice your opinion now!
repository design pattern tutorial



Keith Casey's Blog:
Book Review PHP Design Patterns by Jason Sweat
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).

0 comments voice your opinion now!
book review jasonsweat design pattern


Jim Plush's Blog:
Followup on rethinking Zend Models with DDD - Framework code included
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.

0 comments voice your opinion now!
pattern design domain model zendframework


Chris Jones' Blog:
New Look for the Underground PHP & Oracle Manual
July 14, 2009 @ 08:33:02

As Chris Jones mentions on his blog today, the "Underground PHP & Oracle Manual" has gotten a bit of a facelift:

Thanks to the Oracle Technology Network design team our very popular, free Underground PHP & Oracle Manual has had a makeover and gained a snazzy new front cover. Farewell to the photo of the underground car park door that used to greet me each night on the way out of the office.

The book not only has a new cover but it also has a new page where you can download the latest copy. (The contents of the book haven't changed since the end of last year, though.)

0 comments voice your opinion now!
design manual oracle underground


Tobias Schlitt's Blog:
Identity Map pattern
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.

0 comments voice your opinion now!
persistentobject ezcomponents design pattern identitymap


DevShed:
The mysqli Extension and the Active Record Pattern
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.

0 comments voice your opinion now!
extension mysqli activerecord design pattern tutorial


DevShed:
Refactoring the MySQL Abstraction Class with the Active Record Pattern
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".

0 comments voice your opinion now!
refactor abstraction class activerecord design pattern tutorial


DevShed:
Utilizing the LIMIT Clause with the Active Record Pattern
March 31, 2009 @ 12:58:35

DevShed continues their series on the Active Record pattern in PHP with this new article implementing the LIMIT statement on your abstraction class.

In its current version, it'll be able to accomplish only a few basic database operations tasks. Therefore, this fifth article of the series will be focused on enabling the class to fetch database rows by using the LIMIT clause.

They add the LIMIT clause as a part of its own function and its own SQL statement. You define the number of rows to fetch, the table to fetch it from and the offset to start from. The SQL is passed off to their fetchRow statement and the results are returned in an array.

0 comments voice your opinion now!
activerecord design pattern clause limit abstraction layer database


Federico Cargnelutti's Blog:
Domain-Driven Design (Series)
March 17, 2009 @ 10:22:57

Federico Cargnelutti has been posting a series of articles to his blog recently about domain-driven design, a method for organizing your code for maximum reuse between domains. He focuses on the "M" (model) in the MVC structure (model/view/controller) and how it can be separated out into a layer all its own - the domain layer. Here's the parts of his series so far:

0 comments voice your opinion now!
domaindrivendesign domain design series repository data access strategy


Noupe.com:
Beautiful Forms - Design, Style, & make it work with PHP & Ajax
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.

0 comments voice your opinion now!
form design style functional ajax javascript link tutorial



Community Events









Don't see your event here?
Let us know!


apache codeigniter release opinion version conference developer facebook podcast drupal job microsoft extension symfony wordpress sqlserver zendframework feature windows framework

All content copyright, 2010 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework