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

Freek Lijten:
Separating concerns even better with events
Mar 09, 2015 @ 14:17:26

Freek Lijten has a new post to his site today today talking about a concept of good OOP design, separation of concerns, and how the use of events can help make it "even better". In it he converts some code from a decently structure state into something even driven, splitting out the work from the handling code.

At PHP Benelux 2015 I witnessed a talk by Matias Noback about events. It was a great talk so if you have chance to see it yourself somewhere, do so! In a very tiny nutshell he took us from what most would consider already decent code to better code. Lets start with "decent".

His "decent" code handles user management, executing certain business rules once the user is successfully registered. In the first version of is code, the User is passed into the "saveUser" function and several actions are performed (is the username in use? can they be saved?) including the sending of the email as requested once a user registers. This code is primarily procedural, all in one place and Freek updates it using events to make it a bit more well-contained. He extracts the piece sending the email and translates that into an event. This is then pushed into a set of handlers and executed allowing for greater flexibility if additional actions are needed in the future.

tagged: seperation concerns events tutorial introduction

Link: http://www.freeklijten.nl/home/2015/03/09/Separating-concerns-even-better-with-events

Zend Developer Zone:
The HYSOCAMTT templating approach
Feb 27, 2008 @ 13:56:00

In a new post to the Zend Developer Zone, Brett Zamir has posted a new tutorial that talks about using the Smarty templating system to create what he calls the HYSOCAMTT templating approach ("Have-Your-Separation-Of-Concerns-And-Mix-Them-Too".

This article aims to highlight a approach which allows one to separate everything from one's business logic to one's design logic, to XHTML from CSS, one's Javascript from the page structure, etc., while at the same time being able to be lazy and include, for example, CSS information within the same document (template) as one's XHTML

The tutorial uses an extension for Smarty called SmartyDocB that makes the documentation side much easier. He works through the templating process and includes some of the code for the .tpl files to get you started.

He also includes some future goals for his idea, a mention of XSL templating, XQuery and the potential for templating across programming languages to make your site even more flexible.

tagged: hysocmatt template approach tutorial smarty smartydocb seperation concerns

Link:

Jim Plush's Blog:
What separates a professional PHP web developer from a scripter?
Mar 16, 2007 @ 16:08:00

In this new post to his blog today, Jim Plush investigates what it is that really separates out the professional PHP developers from those that are just "scripters".

I've just interviewed probably my 200th php/web candidate during the past three years that I've been involved with staffing. I've come up with some criteria that I look for to get a real "senior" level developer position filled. I'd say 98% of people don't seem to meet even half the criteria. How many do you meet?

He includes his list, including things like knowing differences between PHP4 and PHP5, be able to work with OOP, know what unit testing is, be a part of the community, and his final, most important item - have a passion for improvement.

tagged: list seperation developer professional scripter list seperation developer professional scripter

Link:

Jim Plush's Blog:
What separates a professional PHP web developer from a scripter?
Mar 16, 2007 @ 16:08:00

In this new post to his blog today, Jim Plush investigates what it is that really separates out the professional PHP developers from those that are just "scripters".

I've just interviewed probably my 200th php/web candidate during the past three years that I've been involved with staffing. I've come up with some criteria that I look for to get a real "senior" level developer position filled. I'd say 98% of people don't seem to meet even half the criteria. How many do you meet?

He includes his list, including things like knowing differences between PHP4 and PHP5, be able to work with OOP, know what unit testing is, be a part of the community, and his final, most important item - have a passion for improvement.

tagged: list seperation developer professional scripter list seperation developer professional scripter

Link:

PHP Magazine:
Poll Question: Pre-requisites of a Good Framework?
Jun 30, 2006 @ 11:01:14

The International PHP Magazine site has posted the results of their poll (still taking votes, by the way) about what some of the prerequisited of a good framework should be.

The International PHP Magazine conducted a poll last week, asking for your opinion on the 'Pre-requisites of a good framework'. The options provided include:
  • Strong separation of data
  • Web 2.0 support and preferably libraries built in
  • Strong naming conventions and smart English recognition
  • Robustness (ability to handle large volumes of traffic and data)
  • Rapid development features (scaffolding etc.)
  • A great IDE (preferably Eclipse)
  • Others

The results so far show that two options are neck and neck for users - the correct/strong seperation of data and the framework's robustness for dealing with the loads. Pulling in close behind them is the need for rapid development, making it quick and easy to use.

tagged: poll question prerequisites good framework robust seperation rapid development poll question prerequisites good framework robust seperation rapid development

Link:

PHP Magazine:
Poll Question: Pre-requisites of a Good Framework?
Jun 30, 2006 @ 11:01:14

The International PHP Magazine site has posted the results of their poll (still taking votes, by the way) about what some of the prerequisited of a good framework should be.

The International PHP Magazine conducted a poll last week, asking for your opinion on the 'Pre-requisites of a good framework'. The options provided include:
  • Strong separation of data
  • Web 2.0 support and preferably libraries built in
  • Strong naming conventions and smart English recognition
  • Robustness (ability to handle large volumes of traffic and data)
  • Rapid development features (scaffolding etc.)
  • A great IDE (preferably Eclipse)
  • Others

The results so far show that two options are neck and neck for users - the correct/strong seperation of data and the framework's robustness for dealing with the loads. Pulling in close behind them is the need for rapid development, making it quick and easy to use.

tagged: poll question prerequisites good framework robust seperation rapid development poll question prerequisites good framework robust seperation rapid development

Link:

Paperbagcoder:
MVC and PHP
May 30, 2006 @ 11:08:17

In This quick post from Paperbagcoder, he gives basic example of what a Model-View-Controller kind of architecture is all about along with some code as an example.

Model view controller architecture has been a staple of desktop application development for a hell of a long time. I dont know when exactly it became a buzz word in web development but I feel pretty safe saying it is the new hotness. And why not, with the increasing complexity of these newfangled web applications and websites in general the encapsulation and flexibility of mvc design makes darn good sense (buzzwords bolded for the executives out there). But what happens when a good design idea meets a really really evil language...

In his perspective, PHP isn't neccessarily evil - it just allows people to "be evil" and write bad code way too easily. He does note, though, that it is possible to write good PHP code without much effort, especially if you use a correct MVC mentatlity. His example selects car data from the database and makes a call to update the information before spitting it out to the template to be rendered.

tagged: model view controller mvc tutorial seperation model view controller mvc tutorial seperation

Link:

Paperbagcoder:
MVC and PHP
May 30, 2006 @ 11:08:17

In This quick post from Paperbagcoder, he gives basic example of what a Model-View-Controller kind of architecture is all about along with some code as an example.

Model view controller architecture has been a staple of desktop application development for a hell of a long time. I dont know when exactly it became a buzz word in web development but I feel pretty safe saying it is the new hotness. And why not, with the increasing complexity of these newfangled web applications and websites in general the encapsulation and flexibility of mvc design makes darn good sense (buzzwords bolded for the executives out there). But what happens when a good design idea meets a really really evil language...

In his perspective, PHP isn't neccessarily evil - it just allows people to "be evil" and write bad code way too easily. He does note, though, that it is possible to write good PHP code without much effort, especially if you use a correct MVC mentatlity. His example selects car data from the database and makes a call to update the information before spitting it out to the template to be rendered.

tagged: model view controller mvc tutorial seperation model view controller mvc tutorial seperation

Link:

DevShed:
Developing an Extensible Template Processor in PHP 5 (Part 1)
May 02, 2006 @ 18:58:09

Building web aplications that split out the responsibilities correctly is becoming more and more important. Developers are creating more complex applications, and cluttering up the presentation with the logic of the code can only make things more of a nightmare down the road. Thankfully, there are articles like this one from DevShed to help you template your site correctly.

This is the first part of a three-part series that covers separating logic from presentation in PHP applications. In this article you will learn to develop a template system that is advanced enough to meet the requirements of a majority of applications.

It's possible to develop an intermediate template system that meets the requirements of a vast majority of applications, without the need to appeal to basic packages or having to deal with the numerous features of Smarty. It's precisely for this reason that this series will be focused on developing an extensible template processor in PHP 5.

You'll need a bit of experience with templating your site before you get started, as they begin with a basic structure of the template processor before anything. They demonstrate the code to create the "TemplateProcessor" class and defining the "processTemplate" method inside it. By the end of this first part in the series, they've created a very simple templating class that could be used as is for base-level projects. Stay tuned for more, though, if you're hungry for more features.

tagged: tutorial extensible seperation template system logic tutorial extensible seperation template system logic

Link:

DevShed:
Developing an Extensible Template Processor in PHP 5 (Part 1)
May 02, 2006 @ 18:58:09

Building web aplications that split out the responsibilities correctly is becoming more and more important. Developers are creating more complex applications, and cluttering up the presentation with the logic of the code can only make things more of a nightmare down the road. Thankfully, there are articles like this one from DevShed to help you template your site correctly.

This is the first part of a three-part series that covers separating logic from presentation in PHP applications. In this article you will learn to develop a template system that is advanced enough to meet the requirements of a majority of applications.

It's possible to develop an intermediate template system that meets the requirements of a vast majority of applications, without the need to appeal to basic packages or having to deal with the numerous features of Smarty. It's precisely for this reason that this series will be focused on developing an extensible template processor in PHP 5.

You'll need a bit of experience with templating your site before you get started, as they begin with a basic structure of the template processor before anything. They demonstrate the code to create the "TemplateProcessor" class and defining the "processTemplate" method inside it. By the end of this first part in the series, they've created a very simple templating class that could be used as is for base-level projects. Stay tuned for more, though, if you're hungry for more features.

tagged: tutorial extensible seperation template system logic tutorial extensible seperation template system logic

Link:


Trending Topics: