News Feed
Jobs Feed
Sections




News Archive
feed this:

PHPMaster.com:
Explore Aspect Oriented Programming with CodeIgniter, Part 2
August 20, 2012 @ 09:13:36

In this new post to PHPMaster.com they continue their look at aspect-oriented programming with CodeIgniter. In part one they introduced some of the fundamentals of AOP and in this new article, they dig deeper with more practical examples.

In the previous part of this series we learned what Aspect Oriented Programming (AOP) is and the meaning of important AOP terminology. In this part I'll explain why we need AOP using practical examples and how to add AOP behavior to your PHP application using the CodeIgniter framework.

They start with a look at a few pieces of functionality that could cut across multiple parts of the application like logging or authentication/authorization. They show how to use the "hooks" feature of CodeIgniter to implement the AOP proxy class generation, executing pre- and post-controller.

0 comments voice your opinion now!
aspectoriented programming tutorial codeigniter framework practical


DZone.com:
Practical Testing Patterns - Redux
June 02, 2011 @ 12:12:25

A while back we posted about a series of articles Giorgio Sironi was doing about some of the more practical applications of testing patterns in PHP unit testing. He' been building on the series ever since and has lots of great patterns you can use to more correctly structure your testing practices.

The current list includes:

There's lots more where these came from, all divided into sections like "Fixture Setup", "Test Double" and "Database Isolation" patterns. You can find the full list so far here.

0 comments voice your opinion now!
testing pattern unittest practical


Shameer's Blog:
PHP 5.3 Practical look into Lambda functions and closures
December 30, 2010 @ 11:11:26

For those out there still coming to grips with some of what PHP 5.3 has to offer, I'd suggest checking out this new article from Shameer about using lambdas and closures along with some examples putting them into action.

PHP 5.3 packaged the power of functional programming by adding support for lambda functions and closures. You will be familiar with them in javascript. In this article we will have a look into these features and its usages.

He starts with explanations of what they are with simple code examples showing their use - a lambda assigned to a variable and closures with the "use" keyword. He shows how they can be used in application prototyping, making handy callback functions and includes a practical example of finding the factorial of a number using a lambda.

2 comments voice your opinion now!
lambda closure tutorial practical example


Vance Lucas' Blog:
Practical Uses for PHP 5.3 Closures
October 20, 2010 @ 08:51:47

By now everyone's heard about one of the more powerful and major advancements made in the PHP 5.3.x series of the language - closures. You might have read a description of them and been left wondering what a practical application might be to help drive the point home. Vance Lucas has written up a post to help with just that.

If you're like me, you might be wondering what the practical uses for these new features are before you can rightly justify diving in and using them in new or existing projects. I experimented a lot with closures and possible uses over the past few weeks, and came up with some compelling reasons to start using them.

He's come up with five different examples of how you can use this handy feature:

  • Templating
  • Dynamic Code Extension
  • Delayed Execution
  • Caching
  • Convenience (as in their role in one-off functions for callbacks)

Each of the tips comes with a bit of code (except delayed execution, that's a bit more involved) to help explain the point a bit more.

0 comments voice your opinion now!
closure practical example template dynamic delay cache


Cormac' PHP Blog:
Practical example php implementation of the Observer pattern
October 14, 2010 @ 08:36:35

New from Cormac's blog there's a post looking at an implementation of the Observer design pattern in a bit more practical scenario than some other examples out there.

Observer is a pattern where an object called the subject maintains a list of dependents (observers) and notifies them of any state changes. I implemented this recently to log changes to an Account object, and to notify the account holder if their account had expire - here's the basics of the code, hopefully it'll help someone else figure out how the pattern works

The basis of the Observer pattern is that you attach these "observer" objects to a main object. These watch the object and see if something changes (like a property value) and react accordingly. For their example, they create a setup that extends the main Observer class to have some or the detection functionality built-in.

0 comments voice your opinion now!
practical example observer pattern


php|architect:
Programming you're doing it wrong
March 11, 2010 @ 11:06:42

In an opinion piece posted to the php|architect site Marco Tabini suggests that we (as developers) are doing it wrong as we move further and further away from the pragmatic side of programming into the abstract.

No matter how advanced the techniques that we use, there is always something that we could be doing better. [...] Which one is right? The real problem is that the answer to that question is, "yes." That's because it lacks a specific context in which it can be inserted.

He suggests that, in our quest to figure out what the perfect case for any situation, we stop focusing on the practicality of writing applications to accomplish goals. Sometimes it's not about getting the right theory behind the code - sometimes it's just doing it.

0 comments voice your opinion now!
programming opinion theory practical focus


Zend Developer Zone:
A Practical Guide to Data Caching with Zend Server
April 16, 2009 @ 10:26:16

The Zend Developer Zone has pointed out a new white paper (written up by Shahar Evron of Zend) about data caching with the Zend Server product Zend offers.

Did you know that Zend Server not only has it's own PHP accelerator built in (like APC). But that it also has similar functionality allowing for caching of data in shared memory? Shahar Evron, Project Manager of Zend Server, has written a white paper describing just how exactly to use this to good effect.

Caching is one of the simplest ways to increase the speed of your application and Zend Server makes it simple with its included Optimizer+, Zend Page Cache and Data Cache API tools. For more information, you can download the whitepaper here [pdf].

0 comments voice your opinion now!
practical guide zendserver zend shaharevron whitepaper cache


Jani Hartikainen's Blog:
Practical uses for reflection
February 17, 2009 @ 10:22:36

Reflection can be a handy tool when you need it, but how many times have you actually found a use for it in the past few applications you've written? Jani Hartikainen has one suggestion of a place it can be used - form generation.

Most web applications use forms. Forms often represent some model, such as a news post. If the model is simple, writing the form in HTML is not too bad, or we might be able to use a scaffolding feature in our framework. [...] Here's a good use for reflection! Since in models we often have a naming scheme for the data the users would be able to input, we can utilize this knowledge with reflection to generate a list of possible fields in the model, and then generate the form with less typing required from us.

His example looks into the model class and pulls out the "get" functions and, after pulling out the name, adds it to a fields array. This array is then passed out to the display part of the script and looped over to create a text field for each. He expands it a bit to also include checking for "@return" values in docblock comments for the type of form field that should be displayed.

1 comment voice your opinion now!
reflecton api form generation practical suggestion model view


Symfony Blog:
Questions and Answers about "Practical symfony" book
February 03, 2009 @ 12:08:18

The symfony blog has a few questions and answers posted about their "Practical symfony" book for those inquiring minds out there.

Questions include:

  • Should I buy it? (who is it targeted towards)
  • Will it get old too soon?
  • Should I wait to the new edition of the book?
  • Are the contents of the book full color or b&w?
  • Should I buy the book or print The definitive guide to symfony 1.2?

The book can be ordered in three versions - Propel (English), Doctrine (English) and Propel (Spanish).

0 comments voice your opinion now!
question answer practical symfony book


Symfony Blog:
The "Practical symfony" book is now on sale
January 20, 2009 @ 12:07:08

On the Symfony blog today there's a new post from Fabien Potencier about a new book that's just been released and might be of interest to those wanting to get into the framework - Practical Symfony.

Two years after the publishing of "The Definitive Guide to symfony" book, I am happy to announce that the Jobeet tutorial is now available as a printed book: "Practical symfony". During the last two weeks, I have updated and enhanced the Jobeet tutorial based on the feedback from the community. I have also updated the screenshots to reflect the new Jobeet design. The "Practical symfony" book is the printed version of this tutorial and as such covers the symfony 1.2 version.

The Jobeet tutorial was their 2008 "advent" piece that created a job posting website from scratch with each day focusing on a different aspect of the application. There are two versions of the book (Propel and Doctrine) but for now, only the Propel version can be purchased over on lulu.com.

0 comments voice your opinion now!
practical symfony framework tutorial book propel doctrine



Community Events











Don't see your event here?
Let us know!


interview development language unittest tool series community conference introduction opinion example testing release phpunit application podcast code framework functional zendframework2

All content copyright, 2013 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework