NYCPHP Meetup

NYPHP.org

[nycphp-talk] Never heard that term: Viet Nam of programming

Hans C. Kaspersetz hans at cyberxdesigns.com
Wed Jan 24 21:53:32 EST 2007


These are some of my comments based on a quick read of Ted's article. 

Object-to-Table Mapping Problem
We ended up adopting the table per concrete class approach.  We did 
denormalize and we accepted the costs.  We had the data base much more 
normalized but the inheritance issues became too problematic.  In 
selected places the team chose to flatten things to make our life a 
little easier.  After much soul searching and refactoring we have 
settled on a good balance of normalization.  Everything has a cost in life.

Schema-Ownership Conflict
Our database is slated to be used by a group of applications functioning 
on a framework.  We have chosen to write a framework and implement all 
the companies applications on that framework.  The data/object model 
lives in the framework.  It will be interesting to see how thing 
progress as new applications are built on the framework and the data.  I 
can see Ted's point here, I hadn't considered it.  I could see how a dev 
team could have a myopic view of who will use the system and how the 
data should be structured.  We have tried to implement ours in the most 
flexible form we could.  We knew from the start that our applications 
would be replacing a collection of existing applications with quite 
divergent requirements.

Data Retrieval Mechanism
We have elected to use the "Query-By-API" approach.  We can generate 
fairly complex and readable data retrieval requests.  Here is an example:

$Customer = new PreCustomer();
$Customer->GetFilter()->AddCondition('AND UserID = "FOO" ');
$CustomerSet = $Customer->Find(); 
$Customer = $CustomerSet[0];

If we need something truely complex, we define it in the data model and 
make it available to the whole of the framework.  If we need something 
complex and very local we can do the following:

$lookup = new Lookup();
$lookup->DBBroker()->Prepare('Lookup', "SELECT Value as Value, Value AS 
Name from OWLSLookup where LookupType = 'Foo' and Active=1 order by 
Position");
$Foo = $lookup->Lookup();

Hans
http://photos.cyberxdesigns.com




More information about the talk mailing list