PHP Gets Dynamic
Get radical with PHP, read this to find out how. A great article by Jack D. Herrington is a senior software engineer with more than 20 years of experience. He’s the author of three books: Code Generation in Action, Podcasting Hacks, and the soon to be released PHP Hacks. He’s also written more than 30 articles.
“Objects are a double-edged sword. On the one hand, objects are a great way to encapsulate data and logic and create a more maintainable system. On the other hand, they can become verbose and require that you write a lot of redundant code where the best you can hope for is not to make any mistakes. One example of this problem comes with database access objects. Generally speaking, you want a single class for every database table that performs the following functions: The object reads a data row from the database, allows you to update the fields, then allows you to update the database given the new data or delete the row. There is also a way of creating a new empty object, setting its fields, and inserting that data into the database.”