No one ever died for my sins in hell, as far as I can tell, at least the ones I got away with
<email ⁄>
<windows live messenger ⁄>
<myCurriculum type="pdf" ⁄>
Modeling real-world objects with computer Data Structures is one of the more fundamental principles of Computer Science.
Data Models however are often tied heavily to their storage medium, whether that be an SQL database, files on a filesystem or a web-service. The idea of implementing a Model/Mapper system is to decouple the format in which we wish to manipulate data from the format that we store it.
PHP is a great language to attempt something like this. It's dynamic nature allows us to create complex Domain Objects with a large range of functionality with minimal setup.
In Part 1 of this tutorial I'm going to show you how to build a generic Model base class from which you can easily extend concrete classes for use in your application.
In Part 2, I'm going to explore the role of the Mapper class, and how best to form a layer between your storage and your Domain Objects.
este é só um excerto do artigo, para aceder ao artigo completo, clique no link em baixo:
this is just a small excerpt from the article, to access the full article please click in the link below:
http://matbyrne.com/2008/4/20/dynamic-domain-objects-in-php