(on Wednesday, 01 July 2009, 08:43 AM +0200):
> I remember the discussion about the model part in the Zend Framework
> many moons ago. I also remember a few approaches discussed on these
> issue, e.g. providing a set of interfaces or abstract classes to build a
> model then "Zend Framework way" or adding a chapter to the reference
> guide with best practices about writing models for the Zend Framework.
> And I also remember that this was planned for the 1.9 release.
>
> So, are there any news about Zend_Model or whatsoever it will be called?
Not currently, though I'm working currently on some ideas and
initiatives that may help address this in the future (though not the 1.9
timeframe).
The problem with providing interfaces and/or abstract classes for
"models" at this point is that there are *so* many ways to approach
models: domain models, data mappers, gateways, transaction scripts,
service layers, ActiveRecord, table/row data gateways,
subject/observer... the list goes on and on. Many patterns can be used
in combination (e.g., I used a combination of service layer, domain
model, data mapper, and TDG for my ZF workshop at DPC this year), yet
still work effectively in a standalone way. Additionally, for patterns
such as domain models... just having a class is often enough of an
interface. We could have interfaces for each pattern -- but that starts
to look like overkill, and also limits the actual implementations (as
many patterns can have a variety of implementations).
What will most likely happen is that we will include a chapter detailing
several approaches to model creation -- but still leave the actual act
of creating models to the developer.
--
Matthew Weier O'Phinney
Project Lead | matthew@zend.com
Zend Framework | http://framework.zend.com/
没有评论:
发表评论