 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
Devis Lucato's Blog: Select Inversion of Control
by Chris Cornutt December 14, 2011 @ 13:34:53
In a recent post to his blog Devis Lucato introduces the "Inversion of Control" design pattern and shares an implementation he's created as an illustration - a Service Locator called Select.
[In a Service Locator] all the dependencies are provided by a builder, which serves as a registry of dependencies and/or service definitions. The service locator knows how to instantiate each dependency. Such service exposes methods like 'getMailer()', 'getLogger()' etc. A service locator centralises the configuration detailing classes and parameters involved on objects instantiations.
He includes some sample code showing the structure of a Select implementation using a "Mailer" identifier and definitions of the classes to load for it. He also includes a bit of documentation of the (simple) API you can use to work with the tool - setting namespaces, replacing class definitions, creating definitions and finding the resource associated with a definition (to name a few).
voice your opinion now!
inversion control designpattern select implementation
DZone.com: Java PHP Python -- Which is "Faster In General"?
by Chris Cornutt January 07, 2011 @ 12:17:55
On the Java DZone.com section today there's a "which is faster" post comparing PHP, Java and Python. No, it's not quite what you're expecting - I'd suggest reading on.
Sigh. What a difficult question. There are numerous incarnations on StackOverflow. All nearly unanswerable. The worst part is questions where they add the "in general" qualifier. Which is "faster in general" is essentially impossible to answer. And yet, the question persists. There are three rules for figuring out which is faster. And there are three significant problems that make these rules inescapable.
His three rules are:
- Languages don't have speeds. Implementations have speeds.
- Statistics Aren't a Panacea.
- Benchmarking Is Hard.
He seems to hit most of the issues with these sort of "faster" posts up front and notes that, while benchmarks can be run on a lot of different aspects about the languages, the results depend on how you slice it. His suggestion is, instead, to not try to compare the languages in a grand sense. Take each of them and compare them on specific tasks and let those results stand alone. Each of the three languages is going to be better at something than the other two.
voice your opinion now!
benchmarking python java faster implementation
Developer.com: Quercus Bring Java's Power to Your PHP Development (and Vice Versa)
by Chris Cornutt August 27, 2010 @ 09:30:58
On Developer.com today there's a new tutorial about Quercus - the Java-based implementation of PHP - and how to get it up and running in your environment.
Imagine the possibilities when a PHP developer can continue using the language's templating capabilities while leveraging Hibernate's object-relational features. Thanks to an open source project named Quercus, PHP and Java developers alike can mix and match the respective capabilities of both languages. [...] This approach (part of the movement that software architect Neal Ford famously defined as "polyglot programming") opens up a whole new world of opportunities for developers seeking to squeeze every last ounce of performance and capability from their application platforms.
They help you get it installed and show you how to execute a PHP script from inside. There's also a bit about integrating Java libraries into your code and the integration of a type of tool PHP doesn't come native with, something like iTextPDF.
voice your opinion now!
quercus java integration implementation polyglot mix
Elizabeth Smith's Blog: My five (well four and one-half) issues with namespaces
by Chris Cornutt September 09, 2008 @ 08:46:35
Even with the release of PHP 5.3 looming closer and closer on the horizon, there's a few things that are still being worked through - one of which is the much touted namespace support. Elizabeth Smith has posted a few of the issues that she's having with how they're being implemented, four and a half of them, to be exact.
The first thing to clarify is that I like the new implementation overall, it's fairly light and although it isn't really namespacing or packaging in any sense of the word, the best way to describe it is aliasing, it does help keep code easy to use. In fact I have a couple of projects and even a PHP extension that's all namespaced code.
Her list of five (four and a half) things are:
- multiple namespaces in a file
- you can't have ANYTHING before the namespace statement but an opening <?php tag
- The autoload and resolution paths
- Functions in namespaces
- No use * and three million use statements (this is the one with the workaround - class_alias)
voice your opinion now!
issue namespace implementation multiple autoload function use
Alexey Zakhlestin's Blog: FastCGI in PHP - The way it could be.
by Chris Cornutt June 11, 2006 @ 13:26:04
Alexey Zakhlestin shares with us in this new blog post, how the fast-cgi PHP developers think they're using isn't really a true FastCGI.
Most PHP programmers believe, that PHP has support for FastCGI. They refer to fastcgi-sapi, which is bundled with php since long ago, and which was recently reimplemented for PHP 5.1.3/4. This SAPI really does exist and actually working quite good. But… it is not a real fast-cgi. It is just an imitation of mod_php which is linked against fastcgi api, instead of apache api. So, it's time for you to ask: if it exists and works, then what am I talking here about? Let's start from the basics...
He talks about a history of how things go to where they are, starting back with regular CGI scripts, moving up through using server-based APIs, and finally to FastcGI, a method for overcoming a lot of the limitations of its predecessors.
With that look back, he turns his attention around and looks to the current situation within PHP. He talks about the sudden appearance fastcgi made in PHP's SAPIs, but that the implementation wasn't true. He suggests that the reasoning behind this "fake" implementation was for the sake of speed. He also notes, however, it's his opinion that true FastCGI support in PHP will be a requirement for future large-scale applications.
voice your opinion now!
fastcgi sapi fake implementation fastcgi sapi fake implementation
Jason Sheet's Blog: Soundex implemented in PHP
by Chris Cornutt May 27, 2006 @ 11:52:57
On Jason Sheet's blog, there's a new post that offers up a brief tutorial on implementing the soundex functionality in PHP.
Soundex is an algorithim to help determine if a word sounds like another word; it is commonly used to detect words that are incorrectly spelled or to make the suggestion "did you mean ? instead of !?" For example if you typed in smythe using soundex a program could look for other names that sound like it and find that smith and smythe sound alike.
In this article I will demonstrate a PHP implementation of soundex, in practice this implementation has little value because PHP itself has soundex() function already but this article should help you understand how it works better.
He jumps right in, mentioning the steps the script will take (seven of them) before getting right to the code. He's written up his own soundex functionality packaged up nicely in a reusable function and has even compared it to the built-in PHP soundex function for accuracy.
voice your opinion now!
tutorial soundex implementation builtin simple function tutorial soundex implementation builtin simple function
DevShed: Iterators in the Simplest Sense - An Accessible Implementation in PHP 4
by Chris Cornutt March 09, 2006 @ 07:12:15
DevShed has published the first in a new series that looks to explain the implementation and core concepts behind using iterators in PHP. This time, they look at creating this environment in PHP4.
Here, I'm not going to offer a full reference for what each design pattern is. You can buy a book to learn that, or even do some "googling" and find other helpful resources that probably will treat the subject much more extensively. Instead, I'll provide you with a concise explanation of what an Iterator is, in conjunction with numerous sample codes, which hopefully will help you understand much more easily how it can applied in PHP object-oriented programming.
They start off by looking at what the Iterator pattern is - the setup of a pseudo-class and an explaination of how it works. They follow this with a functional example and creating a subclass off of the generic base class.
voice your opinion now!
design pattern iterator core concepts implementation design pattern iterator core concepts implementation
|
Community Events
Don't see your event here? Let us know!
|