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

PHPBuilder:
Value & Data Access Objects in PHP 4.2
Jun 02, 2004 @ 12:23:22

Any of the J2EE programmers out there know that the two languages share some basic concepts, but are pretty different when it comes to the details. Well, in this new article from PHPBuilder.com, Geno Timlin shows you his effort to bridge that gap.

In Value Objects and Data Access Objects with PHP 4.2.x he introduces you to the two kinds of objects and what they're for (value objects as a "business entity" and data access objects as the middleman between the value objects and the database). His example, a simple auto sales site, steps you through how to create these two objects, complete with some sample code and database structures. He creates a base data access object, then extends it to create a VehicleDAO object with more functionality. He fillows this all up with some functions to pull and various information into the database via the DAO.

Most developers out there will find this example quite familiar, as it's a pretty standard PHP abstraction layer setup, but it's still nice to see that there are some things that span languages - even if they are called different names.

tagged:

Link:


Trending Topics: