Right; I don't believe it's appropriate to assume that a "model" can
simply extend a table or row object.  It's better to write your own
model class, extending nothing, that may use a table or row object, and
may also use other sources of data, such as a SOAP service.

Regards,
Bill Karwin

> -----Original Message-----
> From: Greg Frith [mailto:[EMAIL PROTECTED] 
> Sent: Friday, July 20, 2007 4:35 AM
> To: [email protected]; [EMAIL PROTECTED]
> Subject: [fw-general] Data models
> 
> Hi list,
> 
> A request for thoughts/advice if I may.  I have an entity 
> which I wish to model, let's say for now it's a car.  I want 
> to be able to use a 'car' object (or list of car objects) in 
> my view.  For example $car->colour, $car->engineSize.
> 
> Now, some of the information my site presents about the car 
> comes from a SOAP web service running on another server, and 
> some additional information comes from a local MySQL 
> database.  I understand all the Zend_Db_* classes and how I 
> might use them to model my database car info.  But I'm not 
> too sure how to create an object that represents a car 
> combining information from both the Web Service and the database.
> 
> If for example I was to extend Zend_Db_Table_Row_Abstract to 
> represent the car, could I add additional public fields to 
> hold the data obtained through the Web Service without 
> creating problems when I use ->save and such methods?
> 
> Or would I perhaps be better creating a car class that 
> doesn't extend Zend_Db_Table_Row_Abstract.  Then either use 
> the basic Zend_Db class's or extend them slightly to do the 
> DB work for a car.  Calling the various find and save methods 
> from the car class?
> 
> Thoughts?
> 
> Many thanks, Greg Frith.
> 
> 

Reply via email to