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

Marco Bunge:
Application logic done right
Aug 14, 2017 @ 12:13:13

In a recent post to his site Marco Bunge offers some suggestions on how to write good application logic in a "clean, testable and reusable" way.

Web based enterprise applications are often accessible via different user interfaces through protocols like HTTP, Sockets, RPC, CLI. The Model-View-Controller is still present as a user-interface pattern. But requests and responses needs to be handled in the way of their interface requirements.

We don’t want to write the same logic for each required interfaces. Furthermore we don’t want to test and maintain code for each required interfaces. We want to write, test and maintain reusable source code at a central point of the application eco-system.

He then talks about the ideas behind the "three-teir architecture" and how this structure can be used to split logic into layers: presentation, logic and data. He mentions domain driven design as a development method to help achieve this structure and his meaning of the word "clean". He then gets into the implementation of this structure, defining the major pieces of functionality for each tier (with code for each included). He ends the post with some suggestions of points for additional reading about things like presenters, the ADR pattern and the "Inversion of Control" principle.

tagged: application logic opinion threetier clean tutorial example code

Link: http://www.marco-bunge.com/2017/08/05/application-logic-done-right/

PHPImpact Blog:
Zend Framework Architecture
Jul 28, 2008 @ 10:26:01

In this new post to the PHP::Impact blog, Federico takes a look at the architecture behind one of the PHP community's most popular frameworks - the Zend Framework.

Before we begin our exploration of the architecture of the Zend Framework (ZF), it is important to discuss how a typical MVC application is built. Examining and understanding the architecture of an MVC Web application allows you to make more contextually sound choices when building your application.

He starts with a look at a three-tier architecture (presentation, application, data) and compares that to the MVC used in the Zend Framework. He talks about how ZF is a hybrid component and infrastructure framework and the coupling that it provides between its components. He also has a few criticisms namely some performance issues from this style and the lack of a module to handle model/controller dependencies.

tagged: zendframework architecture mvc threetier component criticism