<?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>Tue, 21 May 2013 07:20:22 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Dave Marshall: Silex Route Helpers for a Cleaner Architecture]]></title>
      <guid>http://www.phpdeveloper.org/news/18808</guid>
      <link>http://www.phpdeveloper.org/news/18808</link>
      <description><![CDATA[<p>
In a <a href="http://phpdeveloper.org/news/18549">previous post</a> of his <i>Dave Marshall</i> talked about using controllers as "services" in a Silex-based application. In <a href="http://davedevelopment.co.uk/2012/11/27/silex-route-helpers-for-a-cleaner-architecture.html">this new post</a> he takes it a step further and shows you how to use route helpers to make working with those controllers even simpler.
</p>
<blockquote>
Supposing we want to render some HTML, do we want to inject the template engine in to the controller? Should the controller be responsible for knowing how to render the template? I'm not sure, but if I can have it not do it with minimal fuss, I think I'd rather it not. The full stack framework has the <a href="http://symfony.com/doc/2.0/bundles/SensioFrameworkExtraBundle/annotations/view.html">@Template</a> annotation, which allows developers to assign a template to a controller and then simply return an array. If they can do it in the full stack framework, we can do it in Silex.
</blockquote>
<p>
He includes the code for an example of a 404 handling page that uses the "convert" method to configure a route (path to a controller) for the currently matched route. He also shows the creation of a simple "CustomRoute" class and a "TemplateRenderingListener" to make it simpler to customize the handling and output of the request, all injected into the application's DI for later use.
</p>]]></description>
      <pubDate>Tue, 27 Nov 2012 10:57:16 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Reddit.com: Thoughts on API centric architecture]]></title>
      <guid>http://www.phpdeveloper.org/news/18465</guid>
      <link>http://www.phpdeveloper.org/news/18465</link>
      <description><![CDATA[<p>
On Reddit.com there's a recent post talking about an <a href="http://www.reddit.com/r/PHP/comments/zmzh7/thoughts_on_api_centric_architecture/">API-centric architecture</a> that would separate out business logic from user logic.
</p>
<blockquote>
I'm in a fairly unique position of being able to refactor an existing site that gets a moderate amount of traffic (~10k per day). Technically speaking, it probably does not NEED to be rebuilt from ground up, but as this is somewhat of a hobby project for me, I am choosing to rebuild it because I think there are significant long term benefits and because of the learning experience it affords me. [...] The solution that I've come up with, so far, is to create a single library whose sole responsibility is to handle system / business level interactions that occur. This API is completely segregated from any consumer facing frontend and de-coupled from any particular framework implementation.
</blockquote>
<p>
Comments on the post are mostly supportive - they're in favor of the API-for-business-logic approach, but some <a href="http://www.reddit.com/r/PHP/comments/zmzh7/thoughts_on_api_centric_architecture/">recommend other methods</a> than the single library attack. There's suggestions of using current frameworks to handle some of the "dirty work" involved in setting up the API and a mention of focusing on performance as well as functionality.
</p>]]></description>
      <pubDate>Tue, 11 Sep 2012 09:17:50 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Anthony Ferrara: N-Tier Architecture - An Introduction]]></title>
      <guid>http://www.phpdeveloper.org/news/18308</guid>
      <link>http://www.phpdeveloper.org/news/18308</link>
      <description><![CDATA[<p>
<i>Anthony Ferrara</i> has <a href="http://blog.ircmaxell.com/2012/08/n-tier-architecture-introduction.html">posted an introduction</a> to the concept of an N-tier architecture - a method for planning your application so that there's a separation of concerns between multiple layers, each handling their own specialty.
</p>
<blockquote>
If you've been following me for a while, you've likely heard me use the term "N-Tier Architecture" before. Today's question comes from <a href="https://twitter.com/me_arno">Arno</a>. He basically asked "What is this N-Tier Architecture thing you keep talking about?"... So, to answer his question, a N-Tier Architecture is one that uses more than one tier. Of course there's more to it than that...
</blockquote>
<p>
He talks about the idea of a "tier" and how, despite it being somewhat subjective depending on the application and the person talking, all agree that it's a separation in the structure of your app. He shows some common setups for a PHP-based application and explains the usefulness of a tiered architecture. He also includes a <a href="http://3.bp.blogspot.com/-_BKuO95QLFo/UBc50P8rLYI/AAAAAAAABD8/X9gqxIQU4S0/s1600/live_architecture.png">more real example</a> that involves multiple languages and data sources and explains some of the downsides to the tiered architecture approach.
</p>]]></description>
      <pubDate>Thu, 02 Aug 2012 08:32:42 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Chris Roane's Blog: Options for Building a Website from a Developers Perspective]]></title>
      <guid>http://www.phpdeveloper.org/news/18130</guid>
      <link>http://www.phpdeveloper.org/news/18130</link>
      <description><![CDATA[<p>
<i>Chris Roane</i> has a new post to his blog outlining a few different options web developers today have for <a href="http://www.montanaprogrammer.com/work-smarter/developing-website-options/">creating new websites or applications</a> - static, custom, framework-based or CMS.
</p>
<blockquote>
Over the years I've built many different types of websites. These range from being a few pages, to being very customized with advanced features. I've learned there is no clear definition in the best way to create a website. But I do think there are advantages and disadvantages to pursuing different methods. This article takes an analytical look at each option. Let's take a closer look at the different approaches in building a website.
</blockquote>
<p>
He includes a brief summary talking about each method and mentions things like benefits and downfalls of the approach and what can be involved in their development.
</p>]]></description>
      <pubDate>Mon, 25 Jun 2012 08:28:27 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Mayflower Blog: Software Architecture Decisions - How to do it Wrong the Hard & Easy Way]]></title>
      <guid>http://www.phpdeveloper.org/news/18128</guid>
      <link>http://www.phpdeveloper.org/news/18128</link>
      <description><![CDATA[<p>
On the MayFlower blog today there's a new post looking at <a href="http://blog.mayflower.de/archives/875-Software-Architecture-Decisions-how-to-do-it-wrong-the-hard-and-the-easy-way.html">two ways to do software architecture</a> (the easy way and hard way) and some of the traditional practices behind its development.
</p>
<blockquote>
When it comes to software architecture, stuff gets funny. First we learn everything about it at university. We learn to use it as a part of our main project plan. We learn how to do risk evaluation. [...] Since we didn't have a lot of experience with software back then, the resulting architecture is a badly done, but well documented. This style of software architecture is called "Enterprise Architecture" and usually done by consultants.
</blockquote>
<p>
They talk about delivering software versus delivering documentation and list some of the actual common reasons software architecture turns out how it does including: "I read about it in a blog", "It worked for me once" and the idea of the "Golden Hammer" of standardized structures.
</p>]]></description>
      <pubDate>Fri, 22 Jun 2012 10:55:10 -0500</pubDate>
    </item>
    <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>
  </channel>
</rss>
