ODBC/JDBC/ORM are not cornerstones of PHP MVC frameworks in any way.


You appear to be saying that the "M" in MVC frameworks is not dependent on ODBC/JDBC or an ORM in any way. Can you explain >that?

That's exactly what I'm saying. MVC frameworks don't care where or how you get your data. It could be a series of CSV files stored on the file system if you so choose. Obviously you wouldn't access such data using ODBC/JDBC. As for ORM, it's just much easier to use ORM regardless of your data access method (CSV, RDBMS, REST API, etc.), but it is not necessary never mind a dependency. So long as you return the same format/structure of the data regardless of access method, they would still be interchangeable and your application layer wouldn't have to change.


I don't follow how if someone is considering PHP web frameworks, they may
be thinking of doing too much in PHP.


Some people would suggest that a best practice is to implement data validation, referential integrity, database related >business rules, and any other logic that requires database access - to implement that type of logic in the same address space >as the DBMS. Any logic that is incidental to database read, write, update, and delete events, for example.

MVC frameworks do not prevent you from doing so. If using a RDBMS via ODBC/JDBC you can place that logic in the RDBMS using triggers and referential integrity. If using a REST API (IBM I REST Web Service or otherwise) you can place that logic in the REST API (or if your REST API accesses a RDBMS, keep it in the RDBMS). However most people would suggest including some level of data validation directly in the application as well. If you have blatantly invalid data, why waste the time and bandwidth making an API call.

The point I'm making is a REST Web Service is directly interchangeable with ODBC/JDBC access, NoSQL, or even a CSV data store. The purpose of MVC is to separate your data access method from your presentation layer. Rest Web Services do not however replace the "M"odel in MVC, they are simply used by the Model layer the same way ODBC/JDBC access is.

-----Original Message-----
From: Nathan Andelin <nandelin@xxxxxxxxx>
Sent: Wednesday, June 20, 2018 3:15 PM
To: Web Enabling the IBM i (AS/400 and iSeries) <web400@xxxxxxxxxxxx>
Subject: Re: [WEB400] Frameworks

On Wed, Jun 20, 2018 at 12:30 PM, Dan Lanza <DLanza@xxxxxxxxxxxxxxx> wrote:

ODBC/JDBC/ORM are not cornerstones of PHP MVC frameworks in any way.


You appear to be saying that the "M" in MVC frameworks is not dependent on ODBC/JDBC or an ORM in any way. Can you explain that?

I don't follow how if someone is considering PHP web frameworks, they may
be thinking of doing too much in PHP.


Some people would suggest that a best practice is to implement data validation, referential integrity, database related business rules, and any other logic that requires database access - to implement that type of logic in the same address space as the DBMS. Any logic that is incidental to database read, write, update, and delete events, for example.


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.