<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Mon, 21 May 2012 07:49:10 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[PHPMaster.com: Handling Collections of Aggregate Roots - the Repository Pattern]]></title>
      <guid>http://www.phpdeveloper.org/news/17969</guid>
      <link>http://www.phpdeveloper.org/news/17969</link>
      <description><![CDATA[<p>
On PHPMaster.com today they have a new tutorial focusing on <a href="http://phpmaster.com/handling-collections-of-aggregate-roots/">using the Repository</a> (a part of the <a href="http://en.wikipedia.org/wiki/Domain-driven_design">domain driven design</a> architecture) to enhance your model's current functionality.
</p>
<blockquote>
Unlike mappers, though, which are part of the infrastructure, a repository characterizes itself as speaking the model's language, as it's intimately bound to it. And because of its implicit dependency on the mappers, it preserves the persistence ignorance as well, therefore providing a higher level of data abstraction, much closer to the domain objects.
</blockquote>
<p>
Included in the tutorial is the full code you'll need to create a simple UserInterface class and a User model that extends it. He also makes a UserCollection class to handle working with multiple User objects and a UserMapper to handle the actual data source fetching. Finally, he implements the Repository on top of this base structure showing how it lays on top of everything via the UserMapperInterface instance. At the end some example code showing it in use is also included - making the PDO connection, creating the UserRepository and fetching by a few different data types (email, name and role).
</p>]]></description>
      <pubDate>Thu, 17 May 2012 08:44:37 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Web Mozarts: Symfony2 Form Architecture]]></title>
      <guid>http://www.phpdeveloper.org/news/17639</guid>
      <link>http://www.phpdeveloper.org/news/17639</link>
      <description><![CDATA[<p>
In <a href="http://webmozarts.com/2012/03/06/symfony2-form-architecture/">this new post</a> to the Web Mozarts site, <i>Bernhard</i> talks about the architecture behind the current Symfony2 forms implementation and how it handles the requests your forms make.
</p>
<blockquote>
<a href="http://symfony.com/">Symfony2</a> features a brand-new <a href="https://github.com/symfony/Form">Form component</a> that, to my knowledge, supersedes most existing PHP form libraries in functionality and extensibility (not counting the still lacking, native JavaScript support). [...] The purpose of this post is to demonstrate that the Symfony2 Form component is perfectly suited for this requirement. Symfony2-specific functionality can be unplugged, leaving only the raw core dealing with form processing and abstraction.
</blockquote>
<p>
The post is broken up into several different sections, each detailing a different aspect of this Forms functionality:
</p>
<ul>
<li>It's influences from other frameworks
<li>Key aspects it provides
<li>Abstraction (reusable code)
<li>Extensibility
<li>Compositionality
<li>Separation of Concerns
<li>Model Binding
<li>Dynamic Behavior
</ul>
<p>
Both a <a href="http://webmozarts.com/wp-content/uploads/2012/03/high-level-architecture.png">high-level architecture</a> and <a href="http://webmozarts.com/wp-content/uploads/2012/03/class-diagram2.png">low-level architecture</a> are provided, showing you the internal flow behind the form handling. You can find out more about this component <a href="http://symfony.com/doc/current/book/forms.html">in the Symfony manual</a> or peek into <a href="https://github.com/symfony/Form">the code on github</a>.
</p>]]></description>
      <pubDate>Wed, 07 Mar 2012 11:13:31 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Pim Elshoff's Blog: Dependency management]]></title>
      <guid>http://www.phpdeveloper.org/news/17540</guid>
      <link>http://www.phpdeveloper.org/news/17540</link>
      <description><![CDATA[<p>
<i>Pim Elshoff</i> has a recent post to his blog about <a href="http://www.pelshoff.com/2012/02/dependency-management">dependency injection in PHP applications</a> and some of the good and bad things about implementing it. He includes examples of a few different types of "injection" ranging from using globals to an actual dependency injection container.
</p>
<blockquote>
This article describes common pains and symptoms of bad dependency management and common techniques for dealing with project-wide dependencies. [...] For the purpose of this article I am talking about classes using other classes. To manage your softwares dependencies then becomes designing your software architecture such that the depencies are good. The following sections will talk about what's bad, with good being the absense of bad.
</blockquote>
<p>
In his "problems" section he includes things like "it's easy to do wrong", "it's hard to get rid of", the "low rate of reuse in bad DI" and how bad DI can make for "untestable software". He points to a few packages (including <a href="http://pdepend.org/">PHP_Depend</a>) that can be used to determine your dependency levels. His methods for "injection" include using the global scope (so bad), using injection in a constructor/setter, making a service locator (registry) and using a full-blown dependency injection container.
</p>
<blockquote>
All techniques, tricks and gimmicks aside, managing dependencies is more about actual design than abstract design patterns. You yourself are responsible for keeping the number of dependencies as low as possible and designing your system such that access to dependencies is provided in a sane, understandable manner.
</blockquote>]]></description>
      <pubDate>Tue, 14 Feb 2012 12:04:18 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Stefan Koopmanshcap's Blog: Installing the Geoip PECL package for Zend Server on OSX]]></title>
      <guid>http://www.phpdeveloper.org/news/17385</guid>
      <link>http://www.phpdeveloper.org/news/17385</link>
      <description><![CDATA[<p>
In <a href="http://www.leftontheweb.com/message/Installing_the_Geoip_PECL_package_for_Zend_Server_on_OSX">this recent post</a> to his blog <i>Stefan Koopmanschap</i> shares some of the troubles (and a solution) when he was dealing with getting the Geoip PECL extension installed on his Zend Server setup in OSX.
</p>
<blockquote>
Today I needed to get a client application up and running on my local system. This application uses the Geoip PECL package, so I needed to get this up and running. This turned out to be slightly more difficult than just a PECL install, as you're missing some libraries by default, so here is my log of things to do to get it up and running.
</blockquote>
<p>
He gives the complete list of steps his followed including <a href="http://re2c.org/">downloading the source</a> and his way around this "System could not load this extension" issue. The trick was to recompile the source with the correct architecture. By default his extension was built with i386 instead of 64-bit but updating some of the CFLAGS settings (and a few other environment variables) got things compiling correctly. 
</p>]]></description>
      <pubDate>Thu, 12 Jan 2012 11:09:56 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Sankuru Blog: A pluggable compiler and virtual machine in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/17371</guid>
      <link>http://www.phpdeveloper.org/news/17371</link>
      <description><![CDATA[<p>
On the Sankuru blog today the next post in the series about creating a compiler in PHP has been posted. In <a href="http://sankuru.biz/blog/14-a-pluggable-compiler-and-virtual-machine-in-php-dogfood-yourself-with-your-own-plugins">this latest tutorial</a> he shows how to set up a plugin architecture for the compiler that allows you to quickly and easily extend it beyond its base functionality.
</p>
<blockquote>
A plugin architecture allows multiple developers to work on the same application and let yet another person assemble their work later on. It allows the plugin developer to understand just his plugin API without having to understand all the details of the entire application.
</blockquote>
<p>
He describes a few platforms that already have the concept of plugins including <a href="http://joomla.org/">Joomla</a>, <a href="http://www.mediawiki.org/">Mediawiki</a> and <a href="http://www.sugarcrm.com/crm/">SugarCRM</a>. He explains what a plugin architecture should be and what it shouldn't be. All of this is his first steps towards building a plugin-enabled compiler and virtual machine in PHP.
</p>]]></description>
      <pubDate>Tue, 10 Jan 2012 11:53:15 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Reddit.com: Should I be doing just about everything using REST?]]></title>
      <guid>http://www.phpdeveloper.org/news/17225</guid>
      <link>http://www.phpdeveloper.org/news/17225</link>
      <description><![CDATA[<p>
In <a href="http://www.reddit.com/r/PHP/comments/n1pyn/should_i_be_doing_just_about_everything_using_rest/">this new post</a> to Reddit.com, the question is asked "Should I be doing just about everything using REST?" - wondering if their new applications should all sit on top of a web service for their functionality.
</p>
<blockquote>
I'm pretty new to server-side programming, and actually started out with Python/mod-wsgi. From the ground up, mod-wsgi made a lot of sense. The server gets a request, you route the request. It feels like that's where I should start, so that's pretty much what I'm trying to create with PHP (a REST router - for learning purposes, I know frameworks exist). I'm trying to think of a situation where I wouldn't use a REST interface, but I can't seem to think of one (even for simple cases). Would it be safe to say that using REST is a pretty safe bet, most of the time?
</blockquote>
<p>
There's some good discussion and answers to his question touching on things like Service Oriented Architectures, some implications of having a web service power an entire application (or applications) and 
 a few comments with some personal experience.
</p>
<p>A comment about SOA sums it up well:</p>
<blockquote>
You learn to write for your platform in the way developers/partners will have to, so you produce a good quality usable API which encourages development and consumption of your platform.
</blockquote>]]></description>
      <pubDate>Wed, 07 Dec 2011 12:41:38 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Ibuildings techPortal: Architecture Patterns: Domain Model and Friends]]></title>
      <guid>http://www.phpdeveloper.org/news/17062</guid>
      <link>http://www.phpdeveloper.org/news/17062</link>
      <description><![CDATA[<p>
On the Ibuildings techPortal today there's a new post from <i>Robert Raszczynski</i> about <a href="http://techportal.ibuildings.com/2011/10/31/architecture-patterns-domain-model-and-friends/">domain modeling</a> and how a good knowledge of it can help your application's architecture.
</p>
<blockquote>
Architectural and design patterns help software architects to break systems in to smaller, more maintainable sections organised by their functionality and usage. [...] There are three major layers in software architecture: presentation, domain and data source. [...] Now that we know what types of layers we can find in software architecture, let's have a look at how we can organize domain logic and data sources layers.
</blockquote>
<p>
He looks at three patterns that can help organize your domain logic - a transactional script (one file that does one thing), a table module (logic lives in the tables) and his focus, the domain model. He shows (via a graph) how the domain logic approach can cut through some of the effort it could take to improve on the other two. He gives a two suggestions of how to access the data in your domain layer - a Gateway or a Data Mapper. To reinforce the ideas he's presented, he includes some code snippets of a basic domain model for a Store, Customer and Product and uses them in both Gateway and Data Mapper examples.
</p>]]></description>
      <pubDate>Mon, 31 Oct 2011 11:26:09 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Padraic Brady's Blog: How Would You Engineer A PEAR2/Pyrus Distribution Architecture?]]></title>
      <guid>http://www.phpdeveloper.org/news/16496</guid>
      <link>http://www.phpdeveloper.org/news/16496</link>
      <description><![CDATA[<p>
<i>Padraic Brady</i> has a new post to his blog asking you, the reader, for your suggestions on <a href="http://blog.astrumfutura.com/2011/06/how-would-you-engineer-a-pear2pyrus-distribution-architecture/">how to architect a distribution system</a> for the PEAR2/Pyrus components.
</p>
<blockquote>
With the idea of PEAR2 and Pyrus, I had hoped to see a renewal - the advancement of a PEAR architecture for the 21st Century. Instead, and this is just my opinion, PEAR2/Pyrus were a relatively simple iteration on a very old theme. [...] If the PEAR ecosystem has a failing, it is one of staggered evolution. Over time it has picked up additional features tacked on top of a base model.
</blockquote>
<p>
He breaks up his thoughts on the future of PEAR2/Pyrus distribution into a few different topics - the issues he sees surrounding packaging  (like static packaging definitions), suggestions for a dynamic channel aggregation system and overall usage of the PEAR system.
</p>]]></description>
      <pubDate>Tue, 21 Jun 2011 09:12:42 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Paul Jones' Blog: Include-Based vs Class-Based Architecture]]></title>
      <guid>http://www.phpdeveloper.org/news/16037</guid>
      <link>http://www.phpdeveloper.org/news/16037</link>
      <description><![CDATA[<p>
<i>Paul Jones</i> has a new post to his blog looking at two approaches to building applications in PHP - either using an <a href="http://paul-m-jones.com/archives/1763">include-based of class-based architecture</a>, briefly looking at the advantages and disadvantages of each.
</p>
<blockquote>
This is a topic I describe at length in my <a href="http://paul-m-jones.com/public/organizing-php-projects.pdf">Organizing</a> [Your PHP Projects] talk, but I would like to give the idea a home on my blog for easy reference.
</blockquote>
<p>
He talks about the typical structure of a PHP application - at least where most start out - being the "include" method. He talks about the progression it usually makes into functions and classes and then, eventually, a jump in concept to the "class" method similar to what several popular frameworks have gone with.
</p>
<blockquote>
The difference is that no program logic is executed at loading time with a class file. Loading the class file makes it available for use, but the programmer has to instantiate it and then call methods on it for anything else to happen.
</blockquote>]]></description>
      <pubDate>Mon, 14 Mar 2011 09:14:21 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Daniel Cousineau' Blog: A Lesson in Good Architecture]]></title>
      <guid>http://www.phpdeveloper.org/news/15831</guid>
      <link>http://www.phpdeveloper.org/news/15831</link>
      <description><![CDATA[<p>
In <a href="http://www.toosweettobesour.com/2011/01/29/a-lesson-in-good-architecture/">his latest post</a> <i>Daniel Cousineau</i> talks about a good architecture decision (involving the <a href="http://framework.zend.com">Zend Framework<a>) that allowed his company to stop on a dime and shift CDNs.
</p>
<blockquote>
Only a few hours before our event and our CDN was failing probably 80% of the SSL handshakes for our requests to publish files. There is no need to name names as it was a difficult and obscure bug to diagnose in an extremely short amount of time. We needed to get it working, our CDN provider wasn't going to be able to resolve the problem in the extremely short timeframe we required, so the decision was clear: we needed to switch providers for the new content.
</blockquote>
<p>
Normally such a switch would take quite a while (2 weeks by his estimate) but because of their use of a Zend Framework-based setup and the API libraries that they'd written for it, the switch over was as easy as creating a new FileStore abstraction for the new CDN and changing some configuration settings. Thanks to the implementation of the Adapter pattern, his company was able to make a big change in a matter of minutes, saving them and their content.
</p>
<blockquote>
So let this be a lesson to us all. Abstraction and design patterns sometimes feel like an "enterprisey overcomplication" but they aren't there for everyday needs. [...] So suck it up, use them, and thank yourself when you find yourself in such a situation.
</blockquote>]]></description>
      <pubDate>Mon, 31 Jan 2011 11:14:40 -0600</pubDate>
    </item>
  </channel>
</rss>

