<?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>Sat, 25 May 2013 09:33:44 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[SitePoint.com: What Happened when we Talked PHP with the Experts]]></title>
      <guid>http://www.phpdeveloper.org/news/19459</guid>
      <link>http://www.phpdeveloper.org/news/19459</link>
      <description><![CDATA[<p>
On SitePoint.com today they've <a href="http://www.sitepoint.com/what-happened-when-we-talked-php-with-the-experts/">posted the transcript </a> of a "Talk with the Experts" session they did with <i>Lorna Mitchell</i> (instructor of their recent OOP sessions). The transcript includes questions and answers to those in attendance as well as some good links and advice.
</p>
<blockquote>
Last Thursday I broke with tradition slightly and ran a Talk with the Experts session in the evening (down under), making it a bit more time-zone friendly for our UK audience. It also meant that I was able to swap my usual coffee for a wine, which probably made the session run a bit more smoothly. The subject was PHP and our expert was Lorna Mitchell, tutor of <a href="https://learnable.com/courses/object-oriented-php-2734">Object-oriented PHP</a> and co-author of <a href="https://learnable.com/books/phppro1">PHP Master: Write Cutting-edge Code</a>.
</blockquote>
<p>
The <a href="http://www.sitepoint.com/what-happened-when-we-talked-php-with-the-experts/">transcript</a> starts with a collection of some of the links provided during the discussion and then runs through the entire conversation. There's some good advice in there, especially if you're relatively new to the world of PHP object-oriented programming.
</p>
Link: http://www.sitepoint.com/what-happened-when-we-talked-php-with-the-experts]]></description>
      <pubDate>Mon, 15 Apr 2013 09:05:56 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Rob Allen: Objects in the model layer]]></title>
      <guid>http://www.phpdeveloper.org/news/19350</guid>
      <link>http://www.phpdeveloper.org/news/19350</link>
      <description><![CDATA[<p>
In <a href="http://akrabat.com/development/objects-in-the-model-layer/">this latest post</a> to his site <i>Rob Allen</i> talks some about application structure and the different kinds of objects he uses in his applications.
</p>
<blockquote>
I currently use a very simple set of core objects within my model layer: entities, mappers and service objects. [...] I dislike the phrase "service object" as the word "service" means so many things to so many people. I haven't heard a better phrase yet that everyone understands though.
</blockquote>
<p>
He defines each of the types of objects to help make the separation clearer. Here they are in brief:
</p>
<ul>
<li>Entities are objects that represent something in my business logic.
<li>Mappers know how to save and load an entity from the data store.
<li>Service objects provide the API that the rest of the application uses.
</ul>
<p>
Some of the comments on the post relate his choices to use in Zend Framework v2-based applications, noting that there are some base components you can extend to create these kinds of objects.
</p>]]></description>
      <pubDate>Fri, 22 Mar 2013 10:45:54 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Reddit.com: Good guidance for shifting to OO from Procedural coding]]></title>
      <guid>http://www.phpdeveloper.org/news/19333</guid>
      <link>http://www.phpdeveloper.org/news/19333</link>
      <description><![CDATA[<p>
On Reddit.com there's a conversation kicked off by user <i>swiftpants</i> about making the move from procedural PHP programming to the world of object-oriented programming. They <a href="http://www.reddit.com/r/PHP/comments/1a9003/good_guidance_for_shifting_to_oo_from_procedural/">ask for advice</a> from the community for the next steps to take to make the jump.
</p>
<blockquote>
One thing I always have in the back of my head is that all my code is procedural and I should be making use of classes and ?? more. I have a very basic understanding of OO programming but I rarely implement it. Is there a good book or online guide that can get me on my way to OO programming in php. I am especially looking for feed back from self taught programmers. 
</blockquote>
<p>
There's lots of comments on <a href="http://www.reddit.com/r/PHP/comments/1a9003/good_guidance_for_shifting_to_oo_from_procedural/">the post</a> talking about everything from:
</p>
<ul>
<li><a href="http://www.killerphp.com/tutorials/object-oriented-php/">Introductory videos</a> from KillerPHP
<li>Reading lots of other people's (OOP) code
<li>That OOP is more about code reusing and simplicity (DRY) than abstraction.
<li>You can learn a lot by working with one of the MVC/OO frameworks. Download one and build something.
<li>The suggestion of <a href="http://phptherightway.com/">phptherightway.com</a>
</ul>
<p>
Have any other thoughts on the best ways to learn OOP in PHP? <a href="http://www.reddit.com/r/PHP/comments/1a9003/good_guidance_for_shifting_to_oo_from_procedural/">Share them here!</a>
</p>]]></description>
      <pubDate>Tue, 19 Mar 2013 12:33:29 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[thePHP.cc: Software Development Fluxx]]></title>
      <guid>http://www.phpdeveloper.org/news/19186</guid>
      <link>http://www.phpdeveloper.org/news/19186</link>
      <description><![CDATA[<p>
If you've ever played the card game "Fluxx" (or are familiar with the ever changing rules behind software development) you can release to <a href="http://thephp.cc/viewpoints/blog/2013/02/software-development-fluxx">this new article</a> from <i>Sebastian Bergmann</i>. He makes a link between the "Star Fluxx" card game and how OOP and encapsulation help make changing things easier.
</p>
<blockquote>
Star Fluxx is a science-fiction-themed version of Fluxx, "a card game [that] is different from most other card games, in that the rules and the conditions for winning are altered throughout the game, via cards played by the players." (Wikipedia) When I heard the description of the game on the aforementioned episode of TableTop it reminded me of software development projects. Changing business rules and requirements (rules and the conditions for winning), probably sounds familiar to you, too.
</blockquote>
<p>
He talks about how the game could be implemented effectively in OOP classes and interfaces - and how this structure would make it easier to make changes. A largely procedural codebase, however, would make the task much more challenging. The analogy breaks down a bit when it gets to the competitive nature of the game and how software development should be collaborative instead, but it's still effective.
</p>]]></description>
      <pubDate>Fri, 15 Feb 2013 09:06:57 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[NetTuts.com: How to Write Code That Embraces Change]]></title>
      <guid>http://www.phpdeveloper.org/news/19132</guid>
      <link>http://www.phpdeveloper.org/news/19132</link>
      <description><![CDATA[<p>
On NetTuts.com today there's a great new article about how to <a href="http://net.tutsplus.com/tutorials/how-to-write-code-that-embraces-change/">write code that embraces change</a> and can be easily updated and reconfigured due to a decoupled nature and use of good OOP concepts.
</p>
<blockquote>
Writing code, which is easy to change is the Holy Grail of programming. Welcome to programming nirvana! But things are much more difficult in reality: source code is difficult to understand, dependencies point in countless directions, coupling is annoying, and you soon feel the heat of programming hell. In this tutorial, we will discuss a few principles, techniques and ideas that will help you write code that is easy to change.
</blockquote>
<p>
He covers some of the good OOP principles to think about when developing - like cohesion, orthogonality and coupling (via class methods, polymorphism, dependency injection or interfaces). He spends some time looking at the <a href="http://en.wikipedia.org/wiki/SOLID_(object-oriented_design)">SOLID</a> development principles and how you can implement each of them in some sample code. He also talks some about high level design and how the separation of concerns can help make your code easier to maintain and change.
</p>]]></description>
      <pubDate>Mon, 04 Feb 2013 13:18:58 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPMaster.com: Using SSH and SFTP with PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/19020</guid>
      <link>http://www.phpdeveloper.org/news/19020</link>
      <description><![CDATA[<p>
On PHPMaster.com today there's a quick tutorial showing you how to <a href="http://phpmaster.com/using-ssh-and-sftp-with-php/">use SSH and SFTP</a> from inside your PHP applications (requiring the <a href="http://pecl.php.net/package/ssh2">ssh2 package</a>).
</p>
<blockquote>
In today's world with so many third-party integrations and content-sharing, it's important to understand and make use of protocols like SCP and SFTP. PHP's SSH2 extension, a wrapper for libssh2 which implements the SSH2 protocol, provides several functions you can use to securely transfer files.
</blockquote>
<p>
Sample code is included showing how to make a SSH request to a remote server, define the key files to use and execute a remote command (like scp). They also mention the use of wrapper functions like <a href="http://php.net/mkdir">mkdir</a> that also work with SSH/SFTP connections. The post finishes up with an example class or two you can use to wrap your connection handling and make it a bit more OOP-friendly.
</p>]]></description>
      <pubDate>Thu, 10 Jan 2013 11:31:52 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Brandon Savage: Effective Refactoring Strategies]]></title>
      <guid>http://www.phpdeveloper.org/news/18943</guid>
      <link>http://www.phpdeveloper.org/news/18943</link>
      <description><![CDATA[<p>
In a recent post to his site, <i>Brandon Savage</i> has <a href="http://www.brandonsavage.net/effective-refactoring-strategies/">a few helpful hints</a> to keep in mind when you're refactoring your applications to make them easier to maintain (and possibly perform better) in the future.
</p>
<blockquote>
The downtime [of this week] provides a perfect opportunity for the aspiring software developer to do the one thing they are always told there's no time to do: make the code better for better's sake. With few deadlines and plenty of free time, most developers can get a few hours of refactoring in to their code towards the end of the year. They can rearchitect sections that were implemented with haste in September; they can write tests for sections that were untested in April. Put another way, the "lost week" can be redeemed.
</blockquote>
<p>He has a few recommendations, each including their own brief summary:</p>
<ul>
<li>Test Everything First
<li>One Method, One Job (Also One Class, One Job)
<li>Don't Be Afraid Of More Objects And Classes
<li>Remove Dead, Unused, Unnecessary or Old Code
<li>Document Your Code
</ul>
<p>
Check out the <a href="http://www.brandonsavage.net/effective-refactoring-strategies/">full post</a> for the summaries and links to other useful resources.
</p>]]></description>
      <pubDate>Mon, 24 Dec 2012 11:24:57 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Lorna Mitchell: 9 Magic Methods in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/18875</guid>
      <link>http://www.phpdeveloper.org/news/18875</link>
      <description><![CDATA[<p>
<i>Lorna Mitchell</i> has a new post showing <a href="http://www.lornajane.net/posts/2012/9-magic-methods-in-php">nine of the magic methods</a> that are included in PHP by default (like __construct, __get and __set) including a few you may not have used before.
</p>
<blockquote>
The <A href="http://php.net/manual/en/language.oop5.magic.php">"magic" methods</a> are ones with special names, starting with two underscores, which denote methods which will be triggered in response to particular PHP events. That might sound slightly automagical but actually it's pretty straightforward, we already saw an example of this in the last post, where we used a constructor - so we'll use this as our first example.
</blockquote>
<p>She includes details (and some code samples) for these methods:</p>
<ul>
<li>__construct
<li>__destruct
<li>__get
<li>__set
<li>__call
<li>__sleep
<li>__wakeup
<li>__clone
<li>__toString
</ul>
<p>
You can find out about these and a few others in <a href="http://php.net/manual/en/language.oop5.magic.php">this page</a> of the PHP manual.
</p>]]></description>
      <pubDate>Tue, 11 Dec 2012 12:18:49 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[David Zentgraf: How Not To Kill Your Testability Using Statics]]></title>
      <guid>http://www.phpdeveloper.org/news/18847</guid>
      <link>http://www.phpdeveloper.org/news/18847</link>
      <description><![CDATA[<p>
If you've been around PHP for any length of time, you know about the <a href="http://php.net/static">static functionality</a> and keyword that the language offers. You might have used it in the past for a few things, but maybe you're not 100% sure of how to use it right. If this describes you, you should check out <a href="http://kunststube.net/static/">this article</a> from <i>David Zentgraf</i> for a great summary of their use and how to not kill the testability of your application by using them,
</p>
<blockquote>
"Class Oriented Programming" is what people do when they write classes which are all static methods and properties and are never once instantiated. I'll try to explain why this adds virtually nothing vis-a-vis procedural programming, what these people are really missing out on by ignoring objects and why, against all odds, statics don't automatically kill testability. While this article focuses on PHP, the concepts apply equally across many languages.
</blockquote>
<p>
He talks about code coupling, expectations when using static classes/methods and how it seems a little too similar to some of the procedural PHP we all started out writing. He ponts out that most static method calls are more like function calls than true OOP methods and that their dependencies are a bit more difficult to manage. He suggests that statics are really only good for one kind of thing - dealing with already static data and "utility methods" operating on given data.
</p>]]></description>
      <pubDate>Wed, 05 Dec 2012 11:57:33 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Sherif Ramadan: PHP OOP: Objects Under The Hood]]></title>
      <guid>http://www.phpdeveloper.org/news/18838</guid>
      <link>http://www.phpdeveloper.org/news/18838</link>
      <description><![CDATA[<p>
In another of his series looking "under the covers" at what actually happens in the PHP language during its use, <i>Sharif Ramadan</i> has posted <a href="http://sheriframadan.com/2012/12/php-oop-objects-under-the-hood/">this look at the object handling</a> in PHP's OOP functionality.
</p>
<blockquote>
I would love to take a good long look under the hood at just how PHP objects and classes do the work that they do, and hope that you could benefit from that knowledge. [There are] many questions that come across my desk, on a regular basis, from developers and beginner PHP enthusiasts that I've worked with over the years, and are some of the key points this article attempts to help you answer.
</blockquote>
<p>
He talks about classes "giving birth" to objects, how they're stored internal to PHP and how they provide the "blueprints" for it to lay out the storage of the object's data. He talks about using identifiers for variable/property access, object handlers and how "$this" fits into all of it. He notes that OOP, while a major part of PHP now, wasn't in the initial versions (until around PHP4). He finishes off the post talking about lateral/vertical context switching, the lifecycle of an object and the "early binding problem" and class scope.
</p>]]></description>
      <pubDate>Tue, 04 Dec 2012 09:15:27 -0600</pubDate>
    </item>
  </channel>
</rss>
