<?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>Thu, 23 May 2013 06:36:28 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Luis Atencio: Notes on Continuous Delivery - Implementing a Testing Strategy]]></title>
      <guid>http://www.phpdeveloper.org/news/19508</guid>
      <link>http://www.phpdeveloper.org/news/19508</link>
      <description><![CDATA[<p>
<i>Luis Atencio</i> has posted the latest article in his "Continuous Delivery" series today, this time with a focus on <a href="http://www.luisatencio.net/2013/04/notes-on-continuous-delivery.html">implementing a testing strategy</a>. This is the fourth post in the series (<a href="http://phpdeveloper.org/news/19144">part 1</a>, <a href="http://phpdeveloper.org/news/19240">part 2</a> and <a href="http://phpdeveloper.org/news/19367">part 3</a>).
</p>
<blockquote>
There are three things in life that are always held to be true: we will die someday; we will pay taxes; and software will have bugs.... LOL [...] A testing strategy is often overlooked in software projects. This should not be too surprising, we want to build applications quickly and release them quickly. However, leaving quality out of the picture or towards the end are terrible mistakes.
</blockquote>
<p>
He talks some about the different types of testing that revolve around software development - "business facing" and "technology facing." These are each split down even further into things like acceptance, integration and unit testing.
</p>
Link: http://www.luisatencio.net/2013/04/notes-on-continuous-delivery.html]]></description>
      <pubDate>Thu, 25 Apr 2013 11:55:24 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPMaster.com: Overriding Strategy Logic - The Template Method Pattern]]></title>
      <guid>http://www.phpdeveloper.org/news/18514</guid>
      <link>http://www.phpdeveloper.org/news/18514</link>
      <description><![CDATA[<p>
On PHPMaster.com there's a new tutorial posted talking about <a href="http://phpmaster.com/overriding-strategy-logic-the-template-method-pattern/">the Template Method Pattern</a> to help make some sense (and make easier to use) your implementation of the Strategy pattern.
</p>
<blockquote>
This bring us back to the question whether it's feasible to eliminate duplicated strategy logic via Inheritance rather than switching over to plain Composition. Indeed it is, and the clean up process can be conducted through an ubiquitous pattern known as <a href="http://en.wikipedia.org/wiki/Template_method_pattern">Template Method</a>. [...] Simply put, there's a base class (usually an abstract one), which declares a concrete method (a.k.a. the template) responsible for outlining the steps or hooks of a certain algorithm. Most of the time the base type provides boilerplate implementation for some of those steps and the remaining ones are delegated to subclasses.
</blockquote>
<p>
The subtypes then override the base's functionality and extend it with their own. They show an example of this by making a jQuery image slider (using <a href="http://jquery.malsup.com/cycle/">this plugin</a>) , an "AbstractCycleSlider" class and two subclasses for two other types - "FadeSlider" and "ScrollSlider", each outputting their own HTML. It also shows how to implement a slider using a <a href="http://www.zurb.com/playground/orbit-jquery-image-slider">different plugin</a> and output both in the same script.
</p>]]></description>
      <pubDate>Tue, 25 Sep 2012 08:58:01 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Stefan Koopmanschap: Data migration with Doctrine2]]></title>
      <guid>http://www.phpdeveloper.org/news/18269</guid>
      <link>http://www.phpdeveloper.org/news/18269</link>
      <description><![CDATA[<p>
In <a href="http://www.leftontheweb.com/message/Data_migration_with_Doctrine2">this latest post</a> to his site <i>Stefan Koopmanschap</i> shares a solution he's found to migrating data with Doctrine2 from an existing structure.
</p>
<blockquote>
A project that I'm working on right now required me to migrate data from the existing database to the new database and database structure. Since the application is built on top of Symfony2, I decided to write a <a href="http://symfony.com/doc/current/cookbook/console/console_command.html">Command</a> that would take care of the migration. I ran into an issue though: Doctrine2 insisted on creating new IDs where I wanted to keep the old one. The solution turned out to be really simple.
</blockquote>
<p>
The actual code for the Command is only a few lines long - it just turns off the "AUTO" strategy for each of your entities, making it ignore any IDs you have set on the entity already.
</p>]]></description>
      <pubDate>Wed, 25 Jul 2012 08:18:32 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Chris Hartjes' Blog: Have a 'Strategy']]></title>
      <guid>http://www.phpdeveloper.org/news/17966</guid>
      <link>http://www.phpdeveloper.org/news/17966</link>
      <description><![CDATA[<p>
In response to <a href="http://odino.org/use-the-strategy-to-avoid-the-switch-case-antipattern/">this suggestion</a> from <i>Alessandro Nadalin</i> about using the "Strategy" design pattern to replace a <a href="http://php.net/switch">switch</a. statement, <i>Chris Hartjes</i> has <a href="http://www.littlehart.net/atthekeyboard/2012/05/15/have-a-strategy/">this new post</a> sharing his opinion of "the right way" do it it.
</p>
<blockquote>
Once I realized what he was doing, I realized that the Strategy pattern was applicable in this case…but his chosen example was dumb and one that I wouldn't have used to demonstrate things. As expected, he told me to supply a sample of a better way. I did, telling him that the sample would be better if he didn't mash the logging level together with the message.
</blockquote>
<p>
Included in the post is sample code, first showing the initial version of the logging class, complete with accompanying tests. Following that, he shows how to refactor it into something using the Strategy pattern, replacing the logging type switch statement with protected methods for each logging message type (critical, notice, etc). 
</p>]]></description>
      <pubDate>Wed, 16 May 2012 10:42:29 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Anthony Ferrara's Blog: Handling Plugins In PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/17654</guid>
      <link>http://www.phpdeveloper.org/news/17654</link>
      <description><![CDATA[<p>
<i>Anthony Ferrara</i> has a new post today looking at <a href="http://blog.ircmaxell.com/2012/03/handling-plugins-in-php.html">plugin handling</a> and a few of the more common design patterns that can be used to implement them in your applications.
</p>
<blockquote>
A common problem that developers face when building applications is how to allow the application to be "plug-able" at runtime.  Meaning, to allow non-core code to modify the way an application is processed at runtime.  There are a lot of different ways that this can be done, and lots of examples of it in real life.  Over a year ago, I wrote a <a href="http://stackoverflow.com/a/4471363/338665">StackOverflow Answer</a> on this topic.  However, I think it deserves another look.  So let's look at some patterns and common implementations.
</blockquote>
<p>The patterns he covers are:</p>
<ul>
<li>Observer
<li>Mediator
<li>Strategy
<li>Decorator
<li>Chain of Responsibility
</ul>
<p>
For each there's both a bit of sample code showing it in use and links to some examples from various frameworks and other projects.
</p>]]></description>
      <pubDate>Fri, 09 Mar 2012 13:34:38 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Michael Nitschinger's Blog: Session Encryption with Lithium]]></title>
      <guid>http://www.phpdeveloper.org/news/17427</guid>
      <link>http://www.phpdeveloper.org/news/17427</link>
      <description><![CDATA[<p>
<i>Michael Nitschinger</i> has a new post for the <a href="http://lithify.me/">Lithium framework</a> users out there - a quick tutorial about <a href="http://nitschinger.at/Session-Encryption-with-Lithium">encrypting your session information</a> with the new built in "Encrypt" strategy feature.
</p>
<blockquote>
If you check out the master branch, you can use the new Encrypt strategy to encrypt your session data automatically. This means that you can read and write session data in cleartext and they will be encrypted on the fly before getting stored (in a cookie, for example). 
</blockquote>
<p>
You'll need the <a href="http://php.net/manual/en/book.mcrypt.php">mcrypt extension</a> installed for it to work correctly, but it makes storing the encrypted version of your data more or less automatic. Just set up your Session configuration to use it as a strategy and any time you call a "read" or "write" the hard work is handled for you. For those more interests in what's "under the hood" he goes on to talk about how the strategy works, what cipher it uses by default, how to change it and the default string to use in hashing. 
</p>]]></description>
      <pubDate>Fri, 20 Jan 2012 12:09:08 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Label Media Blog: Design Patterns in PHP - Strategy Pattern]]></title>
      <guid>http://www.phpdeveloper.org/news/15515</guid>
      <link>http://www.phpdeveloper.org/news/15515</link>
      <description><![CDATA[<p>
On the Label Media blog today <i>Tom Rawcliffe</i> continues his series looking at design patterns (see <a href="http://phpdeveloper.org/news/15501">here</a> for his look at the Factory pattern) with <a href="http://www.labelmedia.co.uk/blog/posts/design-patterns-strategy-pattern.html">this new post</a> focusing in on the Strategy pattern.
</p>
<blockquote>
The Strategy Pattern is used to decouple an algorithm from the context in which it is used. I'm going to equate this example to a real world scenario starring a man, I'll call him Bob.
</blockquote>
<p>
In his example Bob heads to work and takes whatever way he wants to get there. His boss only cares that he makes it there, not the path he takes. Bob can take many different ways ("strategies") to get there, but how is up to him. <i>Tom</i> illustrates this with a bit of sample code with a "bob.php" that can use any number of other classes/methods to get to work (like commute, the train or a car).
</p>]]></description>
      <pubDate>Tue, 30 Nov 2010 12:48:26 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[DZone.com: Test Strategy Patterns]]></title>
      <guid>http://www.phpdeveloper.org/news/15371</guid>
      <link>http://www.phpdeveloper.org/news/15371</link>
      <description><![CDATA[<p>
<i>Giorgio Sironi</i> has started up a new series on DZone.com about some practical testing patterns you can use when writing up unit tests (and other types of testing in some cases) for your applications - the <a href="http://css.dzone.com/books/practical-php-testing-patterns/test-strategy-patterns">Test Strategy Patterns</a>.
</p>
<p>
The list so far includes the patterns for:
</p>
<ul>
<li><a href="http://css.dzone.com/books/practical-php-testing/practical-php-testing-patterns">Recoded tests</a>
<li><a href="http://css.dzone.com/books/practical-php-testing/practical-php-testing-patterns-0">Scripted tests</a>
<li><a href="http://css.dzone.com/books/practical-php-testing/practical-php-testing-patterns-1">Data-driven tests</a>
<li><a href="http://css.dzone.com/books/practical-php-testing/practical-php-testing-patterns-2">Test automation frameworks</a>
</ul>
<p>
Keep an eye on <a href="http://css.dzone.com/books/practical-php-testing-patterns/test-strategy-patterns">this great series</a>. There's more to come that can be quite helpful when you're trying to generate those tests and procedures around them.
</p>]]></description>
      <pubDate>Tue, 02 Nov 2010 13:42:40 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Zend Developer Zone: Unit Testing Strategies]]></title>
      <guid>http://www.phpdeveloper.org/news/15327</guid>
      <link>http://www.phpdeveloper.org/news/15327</link>
      <description><![CDATA[<p>
On the Zend Developer Zone there's <a href="http://devzone.zend.com/article/12701-Unit-Testing-Strategies">a new article</a> from <i>Keith Casey</i> looking at some of the "best practices" when it comes to writing unit tests for your applications.
</p>
<blockquote>
If we are starting from absolutely nothing, building tests as we go is a near-trivial process. [...] Unfortunately, most of us don't have this situation. We walk into a project with documentation ranging from non-existent to seemingly-useful-but-really-out-of-date, and hundreds of thousands of lines of code, and the coding standards and practices of every developer that has come before us. In this situations, the above Unit Test example is almost mocking us. We can't start that simply! Or can we?
<blockquote>
<p>
He walks through some of the steps he and another project lead took to start their trip into testing - finding the most problematic bits of code first (based on bugs in the tracker) and testing them, figuring out how to test rapidly changing code, finding common code used in several places and testing that and 
</p>]]></description>
      <pubDate>Mon, 25 Oct 2010 08:52:18 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Chance Garcia's Blog: Auth/ACL implementation strategies]]></title>
      <guid>http://www.phpdeveloper.org/news/14934</guid>
      <link>http://www.phpdeveloper.org/news/14934</link>
      <description><![CDATA[<p>
In <a href="http://phpprotip.com/2010/08/authacl-implementation-strategies/">this new post</a> to his blog talks about authentication strategies in Zend Framework applications with the combination of Zend_Acl and Zend_Auth.
</p>
<blockquote>
I'm going to talk more about <a href="http://en.wikipedia.org/wiki/Access_control_list">ACLs</a> than Auth. Auth is simple, it's the ACL that will trip you up.  Since both concepts are coupled together when you're making a login system, I feel it's appropriate to at least touch on Auth. What I want to cover is the ways we can create the ACL object to suit needs based on the scale of the project. I'm going to assume that readers have a passing familiarity with using the Auth and Acl objects and may have even implemented them into projects.
</blockquote>
<p>
He talks about two things you'd need to consider - scalability (how to define your ACLS: hardcoded, in the navigation object and defined in a database) and working with ACLs in multiple projects.
</p>]]></description>
      <pubDate>Tue, 10 Aug 2010 12:20:00 -0500</pubDate>
    </item>
  </channel>
</rss>
