× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I can see a lot of programmers reading that article and scratching their heads and wondering if "separation of concerns" or MVC is really worth it. The first sample shows DB I/O, control logic, and HTML in just one file. Strait forward and easy to read.

As the code evolves to finally using the "twig" template engine, the code is split into several files, and grows substantially in size. Some must wonder if maintainability is actually improved.

You're still left with a mixture of DB I/O, control logic, and Browser I/O in multiple files. The "separation of concerns" is not pure, so to speak.

CGIDEV had an HTML template interface back in 1998. PHP seems to be struggling with separation of concerns in 2013.

-Nathan



________________________________
From: Eric Lehti <elehti@xxxxxxxxxxxxxxxxxx>
To: Web Enabling the IBM i (AS/400 and iSeries) <web400@xxxxxxxxxxxx>
Sent: Thursday, March 21, 2013 3:47 PM
Subject: [WEB400] PHP coding styles; Procedural versus Model-view-controller (MVC)

I received an email from iprodeveloper.com saying this link to paid
content is temporarily unlocked for all to read.  I find it interesting
and want to share with you.  Enjoy.

http://www.iprodeveloper.com/article/application-development-tools/jumps
tart-php-productivity-websmart-699592

Discusses PHP coding styles:
-  Procedural  Pros and Cons, with Comparison to procedural RPG.  UI is
often intertwined with the coding logic-a poor design strategy.

- Advantage of separating UI from business logic.  separates the UI
from the business logic.
<snip> SoC stands for separation of concerns, which is just a fancy way
of saying "keep your programming logic separate from your user
interface." The SoC philosophy is exemplified by Model-View-Controller
(MVC) development. One can make a case that RPG green-screen programs
were using MVC design long before it became popular in web application
development. The RPG code is the model (and parts of it are the
controller, too) and the Display file is the view

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.