Code Critique Please :)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

I am trying to increase my knowledge and understanding of OO and OO Design Patterns. I'd like to request a critique of a program that extracts MySQL table information and translates it into XML. In the program, I tried to accomplish a few things:

1. Correct use of ADOdb
2. Closely match the PEAR coding standards
	- I encode my scripts in UTF-8
- Not all indents are 4 spaces, but I have switched my IDE to treat tabs as four spaces
	- My phpDoc comments could probably use some tweaking
3. Object Oriented principles
4. Strategy Design Pattern
	- Interface used for column attribute parsing

My overall goal is to use these xml files as a starting point to write a DAO with the Data Mapper Pattern.

Here are the related files to peruse:
http://simeons.net/code/datamapper/sql/photo_portfolio.sql
	- SQL dump
http://simeons.net/code/datamapper/mysql_to_xml_oo.phps
	- Calling script
http://simeons.net/code/datamapper/helpers/autoload.phps
	- Auto load classes
http://simeons.net/code/datamapper/classes/DB.phps
	- ADOdb connection
http://simeons.net/code/datamapper/classes/MySQLToXML.phps
	- MySQL extraction and parsing
	- XML writing

Here are the outputted xml files:
http://simeons.net/code/datamapper/xmldatamaps/album.xml
http://simeons.net/code/datamapper/xmldatamaps/photo.xml
http://simeons.net/code/datamapper/xmldatamaps/comment.xml

Any comments are appreciated.

Thanks,
Simeon

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux