 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
Alex Bilbie: Introducing MongoQB
by Chris Cornutt November 16, 2012 @ 09:38:38
Alex Bilbie has passed along a link to a project he's been working on to try to simplify access to MongoDB databases from PHP - his MongoQB library:
A few years ago I released a MongoDB library for the CodeIgniter PHP framework which has become quite popular thanks to it's likeness to CodeIgniter's query builder library. I've just spent the last week travelling and to keep myself occupied I spent some time re-architecting the library's code; removing the framework dependancy, making it Composer friendly and adding a full suite of unit tests. Check out the code on Github - https://github.com/alexbilbie/MongoQB.
The library makes it simpler to do most of the usual CRUD (Create, Read, Update, Delete) operations with your Mongo data. Example code is included in the post. This is a nice lightweight alternative to things like the Doctrine query builder.
voice your opinion now!
mongoqb query builder database project
Giorgio Sironi's Blog: Refactoring PHPUnit's getMock()
by Chris Cornutt August 19, 2010 @ 10:49:16
Giorgio Sironi has a new post to his blog about a "refactoring" he's done of PHPUnit's mock objects to make their creation with getMock easier.
Not an actual refactoring, but at least the introduction of a layer of indirection, a Parameter object, called PHPUnit_Framework_MockSpecification. I have already written the patch in a branch of my github repository. They are actually two independent patches, since PHPUnit core and the mocking component are in two separate repositories.
If you create a basic object, the creation is simple, but when you start wanting to use one of the other optional parameters down the line, things can get messy. His solution adds methods like disableOriginalConstructor and disableAutoload to make this simpler. You can find the patches on his github account.
UPDATE: This feature has been included in the latest PHPUnit master branch.
voice your opinion now!
phpunit getmock patch builder designpattern
Giorgio Sironi's Blog: Practical PHP Patterns
by Chris Cornutt January 11, 2010 @ 11:11:48
Starting off a new series on his blog Giorgio Sironi has posted two new tutorials looking at PHP design patterns - specifically the Abstract Factory and Builder patterns.
[This series will] touch the majority of the known design patterns, with a special look at their application in a php context. A running code sample will be provided for each part of this series, along with the theory and the terminology of each pattern.
In the Abstract Factory (or just Factory) post he includes a diagram of the pattern's relationship with other "participants" and has a Zend Framework-based code sample to create a simple WidgetHelper. In the second article he looks at the Builder pattern and how it can make creating instances of complex objects a bit easier. As before a diagram and code are included.
You can keep up with the rest of the posts in the series as they're added by following along here.
voice your opinion now!
designpattern tutorial factory builder
PHPBuilder.com: PHP and Adobe Air Building a Time-tracking and Billing Application - Part II
by Chris Cornutt April 07, 2009 @ 07:54:44
PHPBuilder.com has posted the second part of their series on creating a sample application - a time tracking app - with PHP and Adobe Air.
Welcome back. In part 1 of this series, you created some PHP remote services and the Clocked! widget application. Part 2 covers PHP administration and completion of the timer widget.
They're developing a Flex-based application (rather than the HTML/Javascript combo that can also be used with Air) so they'll be doing their work in Flex Builder. They set up a few placeholder functions like getClients, getProjects and getProjectsResult as well as support for the ticket and timer objects. Add in a few interface items like dropdowns for client and project selection and a start/stop button and you have the basic app laid out. The PHP interface to all of this Flex code comes in the next article of the series.
voice your opinion now!
time track air adobe tutorial series billing application flex builder
Jani Hartikainen's Blog: Using a builder to construct complex classes
by Chris Cornutt April 02, 2009 @ 12:58:28
If your code is getting more and more complex all the time and you find yourself creating a similar group of objects over and over, you might check out Jani Hartikainen's latest advice and create a "builder" around them.
Sometimes if you have a complex class, which needs to be set up in a specific way: Perhaps it takes a lot of constructor arguments, or often requires calling some setters. [...] Sometimes if you have a complex class, which needs to be set up in a specific way: Perhaps it takes a lot of constructor arguments, or often requires calling some setters.
His example is a "message builder" wrapper that lets you specify the receiver, sender and message and inject them into a to() method call (with a fluent interface). He shows how to make sure that the object you need (the message object) is always complete.
voice your opinion now!
fluent interface builder class complex tutorial
DevShed: Developing a Form Director Class
by Chris Cornutt October 18, 2006 @ 15:13:00
DevShed is continuing on with their look at using Builder objects (part 1, part 2) with the third and final part of the series -
Developing a Form Director Class.
In this article I'll complete the builder pattern, since I'll demonstrate how to define and use a form director class, in this way putting the final strokes on the example that you learned in the previous tutorial.
The tutorial goes back over a few of the concepts and code from the previous part of the series before getting into the form generation with these handy objects. They also show the FormBuilder class (creative name, eh?) that will generate the form's elements as created previously. They wrap it all up with the only new functionality - the Builder object Director class, creating a simple contact form.
voice your opinion now!
tutorial form director class builder object tutorial form director class builder object
DevShed: Introducing Builder Objects in PHP 5
by Chris Cornutt October 04, 2006 @ 15:03:57
DevShed kicks off another three-parts series today with part one of a look at working with builder objects in PHP5.
In this article, the first of a three-part series, you will be introduced to the basics of creating directors and builder objects with PHP 5. As usual, there will be copious examples to help you quickly start using the builder pattern in your own PHP projects.
Well, to put things in a simple perspective, when the builder pattern is applied, two objects are put into action to create a third one. First, these two objects create a director; as its name suggests, the director controls all aspects of the creation process and determines what pieces and modifications will be introduced into the target object. Finally, a builder is tasked with constructing the third object in question, in accordance with particular specifications. Sounds fairly simple, doesn't it?
They start with a look at starting with the Builder pattern, building a basic XML document to provide the structure for the target object. From that information, they show how to create the object and give a simple class to help direct that object along.
voice your opinion now!
builder prattern object xml creation director class builder prattern object xml creation director class
|
Community Events
Don't see your event here? Let us know!
|