News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Nick Halstead's Blog:
Bad code, bad data flow, good idea?
May 15, 2007 @ 09:28:00

While developing a new application in a framework, Nick Halstead came across an "oops" point where he realized that the part of the application he was working on could have been coded better. In this instance, he found a spot where he needed to pass data backwards and forwards through the app without loosing "the flow". His solution? Singletons!

One of these situations occurs when you suddenly that find you don't have access to data you want, or you can't pass back (or forward) data as part of the common flow of your application. [...] The solution was to create a singleton class which uses references to bind a name to a already defined variable.

In his example, he illustrates (and explains) how to use a class he developed (varmap) to handle the assignment/removal/etc of the data to the common Singleton object.

0 comments voice your opinion now!
singleton data flow backward forward framework application singleton data flow backward forward framework application


blog comments powered by Disqus

Similar Posts

Code Yellow Blog: What Your Framework Never Told You About SQL Injection Protection

Code2Learn.com: Generating CSV file using CodeIgniter Framework

AjaxRay.com: The first Kohana book : Kohana 3.0 Beginnerís Guide

Debuggable Blog: Make your life easier with these five CakePHP Quicktips

Stefan Mischook's Blog: Note to CodeIgniter nerds: please, no looping code in your views.


Community Events

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


application framework opinion community laravel yii2 podcast interview symfony list composer example language series introduction part2 project php7 voicesoftheelephpant api

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