Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Benjamin Eberlei:
Doctrine and SOLID
Feb 05, 2013 @ 17:09:33

Benjamin Eberlei has a new post to his site today answering a question he sometimes gets about using Doctrine2 in a SOLID context (more on SOLID development here) as it seems difficult to follow the Single Responsibility Principle with how the tool is used.

These problems are related to the inability to share behavioral code through aggregation and the complexity of state transformations. Combining both, your average entity with 5-15 fields can end up with hundrets or thousands lines of code. The solutions to both problems boil down to minimizing duplication and maximizing clarity.

He looks at two different kinds of objects Doctrine uses in its setup, the value objects and method objects, and "maximize clarity" on them by dividing them up into more functional-related objects, passed into each other via method injection.

tagged: doctrine value method objects clarity solid development principles

Link:

Devis Lucato's Blog:
Anonymous objects in PHP - Composition, Mocks, Refactoring
Nov 23, 2010 @ 19:17:53

In a new post to his blog Devis Lucato points out something he noticed when working with objects and anonymous functions/closures - they're not all as they seem.

Both solutions allow to instantiate an anonymous object with properties. They are used as value objects and have no other purpose than storing values, so no logic can be included and they don't come with methods. They can be used as function parameters instead of arrays, for instance. PHP 5.3.0 introduced anonymous functions and closures, so it is now possible to attach functions to these VOs (*). [...] The first thing to notice is that these properties are not methods but callable functions:

In his example, an anonymous function dynamically appended to an object doesn't have access to a property set on the object just one line before. There's a way around it with call_user_func, but it's not practical. His proposed solution is to create a type of Anonymous class that uses the __call method to catch the methods and translate them into calls to call_user_func_array automatically.

tagged: anonymous objects composition mocking refactoring

Link:

Rob Allen's Blog:
A review of "Learning PHP Data Objects"
May 05, 2008 @ 18:44:10

Rob Allen has posted a review of the Packt Publishing book "Learning PHP Data Objects" over on his blog today:

Packt Publishing recently sent me a couple of books to review. This post is about the second one I received, Learning PHP Data Objects by Dennis Popel. I was excited to receive this book as PDO underlies a lot of the Zend_Db_Adapter objects that I use in my day to day programming. It seemed like a good idea that I should know more about it.

He provides some good detail of what the book covers (chapter by chapter) as well as a summary including his recommendation for who should use the book and how they can best enjoy its contents.

tagged: learning data objects pdo review book packt

Link:

Zend Developer Zone:
Book Review: Learning PHP Data Objects
Dec 28, 2007 @ 13:58:00

The Zend Developer Zone has posted a review of Packt Publishing's "Learning PHP Data Objects" book writen up by Akash Mehta.

In Learning PHP Data Objects, the author Dennis Popel examines this new [database access] system and explains how to begin using PDO in development as a replacement for typical database drivers. The book is an excellent introduction to the data abstraction layer and also provides essential insight into the inner workings of database interaction with PHP.

Akash talks briefly about the history of PDO and what it can be used for first, then gets into the contents of the book (things like the intro chapters and the quality of the writing). The thing he thinks makes the bok stand out, though, is the examples and sample code that reflect both simple methods and more complex issues PDO developers might run into.

tagged: book review learning data objects pdo dennispopel packt book review learning data objects pdo dennispopel packt

Link:

Zend Developer Zone:
Book Review: Learning PHP Data Objects
Dec 28, 2007 @ 13:58:00

The Zend Developer Zone has posted a review of Packt Publishing's "Learning PHP Data Objects" book writen up by Akash Mehta.

In Learning PHP Data Objects, the author Dennis Popel examines this new [database access] system and explains how to begin using PDO in development as a replacement for typical database drivers. The book is an excellent introduction to the data abstraction layer and also provides essential insight into the inner workings of database interaction with PHP.

Akash talks briefly about the history of PDO and what it can be used for first, then gets into the contents of the book (things like the intro chapters and the quality of the writing). The thing he thinks makes the bok stand out, though, is the examples and sample code that reflect both simple methods and more complex issues PDO developers might run into.

tagged: book review learning data objects pdo dennispopel packt book review learning data objects pdo dennispopel packt

Link:

International PHP Magazine:
Poll Question: Which PHP Script Manages FAQs Effectively?
Nov 07, 2006 @ 15:04:00

The International PHP Magazine has posted the results of their latest reader poll for the week. The question they posed to visitors of their site asked about their favorite FAQ manager from those on the list:

  • phpMyFAQ
  • ODFaq
  • Lethal Penguin's FAQMasterFlex
  • All
  • None
The result was a resounding 60% for the first on the list - phpMyFAQ. Next down in ranking was the "None" option, making phpMyFAQ the undisputed champ for FAQ management in PHP (well, at least for this poll).

Be sure to check out this week's poll that asks which of the four options is the most common perspective regarding objects in PHP.

tagged: manage faq poll question phpmyfaq none common opinion objects manage faq poll question phpmyfaq none common opinion objects

Link:

International PHP Magazine:
Poll Question: Which PHP Script Manages FAQs Effectively?
Nov 07, 2006 @ 15:04:00

The International PHP Magazine has posted the results of their latest reader poll for the week. The question they posed to visitors of their site asked about their favorite FAQ manager from those on the list:

  • phpMyFAQ
  • ODFaq
  • Lethal Penguin's FAQMasterFlex
  • All
  • None
The result was a resounding 60% for the first on the list - phpMyFAQ. Next down in ranking was the "None" option, making phpMyFAQ the undisputed champ for FAQ management in PHP (well, at least for this poll).

Be sure to check out this week's poll that asks which of the four options is the most common perspective regarding objects in PHP.

tagged: manage faq poll question phpmyfaq none common opinion objects manage faq poll question phpmyfaq none common opinion objects

Link:

Zend Developer Zone:
Sebastian Bergmann on ZendCon and PHPUnit 3
Oct 19, 2006 @ 12:58:00

On the Zend Developer Zone site today, Cal Evans had a chance to talk with Sebastian Bergmann, the lead coder on the PHPUnit unit testing project for an interview:

Sebastian Bergmann works at eZ systems. In his spare time he wrote and maintains the PHPUnit project. (He's worked on other project but since that's what he’s talking about at ZendCon, that's what we'll talk about)

The interview is only a few questions long, but it's interesting to see how Sebastian's talk will be heading. There'll be talk of PHPUnit 3 (still in beta), mock objects, and its integration with CruiseControl. Check out the post for more of the questions.

tagged: phpunit testing unit zendcon2006 interview beta mock objects phpunit testing unit zendcon2006 interview beta mock objects

Link:

Zend Developer Zone:
Sebastian Bergmann on ZendCon and PHPUnit 3
Oct 19, 2006 @ 12:58:00

On the Zend Developer Zone site today, Cal Evans had a chance to talk with Sebastian Bergmann, the lead coder on the PHPUnit unit testing project for an interview:

Sebastian Bergmann works at eZ systems. In his spare time he wrote and maintains the PHPUnit project. (He's worked on other project but since that's what he’s talking about at ZendCon, that's what we'll talk about)

The interview is only a few questions long, but it's interesting to see how Sebastian's talk will be heading. There'll be talk of PHPUnit 3 (still in beta), mock objects, and its integration with CruiseControl. Check out the post for more of the questions.

tagged: phpunit testing unit zendcon2006 interview beta mock objects phpunit testing unit zendcon2006 interview beta mock objects

Link:

DevShed:
Controlling Online Forms with Builder Objects in PHP 5 (Part 2)
Oct 11, 2006 @ 19:49:00

DevShed is continuing their "using builder objects in PHP5" series today with this new article, a look at implementing the builder objects in a simple, common bit of functionality - forms.

Mastering some of the most popular design patterns with PHP 5 can be sometimes an overwhelming process that requires hard work and experience. However, if you want to tackle the challenge and expand your existing background on them, this article might eventually find a place on your quick reference list.

They start by defining the basic form element class, helping to build out the different elemnts like inputs, selects, and submits. They extend and implement this class with their example, making a complete form with working elements inside.

tagged: builder objects design pattern forms tutorial builder objects design pattern forms tutorial

Link:


Trending Topics: