 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
Devshed: Building a PHP ORM Deploying a Blog
by Chris Cornutt December 09, 2011 @ 11:13:18
DevShed concludes their three-part series about building an ORM in PHP with this latest article. It introduces the idea of dependency injection into the mix, showing how it can be used in the relationships between entities.
if you've already read the two installments that precede this one, it's probable that you're familiar with the inner workings of this sample ORM. In those chapters I implemented the ORM's data access and mapping layers, along with a simple domain model. To be frank, the development of this last tier is entirely optional; however, it's useful for demonstrating the ORM's actual functionality in the deployment of a blog program, which naturally will handle some "typical" domain objects, namely blog entries, comments and authors.
They share the code for creating proxy objects and, using a "poor man's dependency injection container" made from a factory method, interfaces and service classes to handle the results.
voice your opinion now!
orm dependencyinjection container deploy blog service interface
CloudSpring.com: Using the Rackspace PHP SDK
by Chris Cornutt November 16, 2011 @ 12:10:38
On the CloudSpring site today there's the continuation of a previous article about RackSpace's CloudFiles API. In this new post they show how to use their PHP SDK to connect to and use the CloudFiles service.
Rackspace provides a Software Development Kit (SDK) for multiple programming languages. They store their PHP SDK on GitHub. The PHP SDK requires PHP 5 with the following modules: cURL, FileInfo and mbstring. In this tutorial we are going to review use of the PHP SDK with CloudFiles. Not all parts of the API will be covered but you will get a great start.
Code is included showing how to make the connection, work with containers, pushing content out to a CDN, object handling and a few other handy tips (and API info) to help you along your way.
voice your opinion now!
rackspace sdk tutorial object container api
Lars Strojny's Blog: Dependency Injection Container Refactorings, Part One
by Chris Cornutt April 20, 2011 @ 10:27:12
New on his blog today Lars Strojny has posted the first part of his look at dependency injection and how he's been using it to do some refactoring in his applications. He uses the Symfony DI container in his examples, but really you can apply the principles to just about any of the other current DI offerings.
Working heavily with the Symfony2 Dependency Injection Container, I feel that we found some typical refactorings towards a DI container that emerge during the introduction of such a component. I want to write down the preliminary results of trying to systematize more or less as a draft. I will use the Symfony2 DI container configuration as an example but most of the refactorings should be applicable to other containers as well, some of them even to dependency injection without a container.
He's broken it up into a few different sections:
- Making a dependency explicit
- Introducing interface injection
- Exposing the service
voice your opinion now!
dependency injection di refactor container tutorial
Zend Developer Zone: Quick Start Symfony DI (Dependency Injection) Tutorial
by Chris Cornutt August 30, 2010 @ 12:59:46
On the Zend Developer Zone there's a recent post from Steven Lloyd Watkin giving you a quick start to a technique becoming more popular in the PHP development community - dependency injection.
Dependency injection is a technique that allows for loosely coupled objects within a software application. Generally if an object requires access to the functionality of another it would be instantiated internally leading to tightly coupled systems. By implementing dependency injection we inject the required objects ready for use (sometimes also referred to inversion of control - IOC).
He illustrates with an example showing the injection of DecisionParameters into a DecisionMaker object (rather than just passing the parameters in manually). He looks at frameworks and how it's handled there, specifically with the Symfony DI container. He includes example code of how to use it, configure it, pull information back out and, of course, how it can help in unit testing your code.
voice your opinion now!
dependency injection symfony tutorial framework container
Benjamin Eberlei's Blog: Using a Dependency Injection Container with Zend_Application
by Chris Cornutt June 17, 2009 @ 10:25:17
New on his blog today Benjamin Eberlei has posted his own look at dependency injection containers in PHP applications, specifically with the Zend_Application component of the Zend Framework.
Much has been written on Dependency Injection lately [...]. Its an awesome pattern if used on a larger scale and can (re-) wire a complex business application according to a clients needs without having to change much of the domain code. Beginning with version 1.8 Zend Framework is able to integrate any of these DI containers into its Zend_Application component easily.
He gives an example of this integration, adding in the creation of the container as a part of the bootstrap setup (a getContainer call on the front controller object). He also introduces the Yadif DI container (a lightweight container written by Thomas McKelvey) and how to set it up including its own configuration file.
voice your opinion now!
zendframework tutorial container injection dependency
SitePoint PHP Blog: Introducing Bucket A Minimal Dependency Injection Container for PHP
by Chris Cornutt May 11, 2009 @ 07:58:04
On the SitePoint PHP blog Troels Knak-Nielsen has posted about a new tool he's whipped up to handle dependency injections - Bucket.
I got fed up with the lack of a decent DI-container for PHP, so today I created Bucket. To be clear, what I think is wrong with the currently available containers (at least that I'm aware of) is that they either are unstable, abandoned, require a lot of up-front configuration in external XML-files, or are tightly integrated into some full-stack framework. I had my hopes up for Phemto for a while, but it seems that progress has stalled.
He includes a few bits of examples code in the post showing how to use type hinting, the factory method, callbacks and its support for child scopes. If you'd like to check it out for yourself, you can clone it from github.
voice your opinion now!
dependency injection bucket container github
Fabien Potencier's Blog: On PHP 5.3, Lambda Functions, and Closures
by Chris Cornutt April 17, 2009 @ 10:29:43
In this new post to his blog Fabien Potencier looks at two of the much-hyped features of the upcoming PHP 5.x series release (5.3) - closures and lambda functions.
I won't talk too much about what lambda functions or closures are, as you can find many good blog posts describing them in great details. To sum up, a lambda function is an anonymous PHP function that can be stored in a variable and passed as an argument to other functions or methods. A closure is a lambda function that is aware of its surrounding context.
He includes several examples including how they would work with a few of the array functions, an implementation of the Y-combinator method (as written by Stanislav Malyshev) and how they can be used to create dependency injection functionality.
voice your opinion now!
lambda function closure php5 array ycombinator dependency injection container
|
Community Events
Don't see your event here? Let us know!
|