duanhuang1967 2012-03-18 13:32
浏览 40

Zend Framework的模型和后端接口生成器[关闭]

By doing some research, one of the disadvantages often reported about Zend Framework is the amount of work required to get off the ground. For me this could be addressed if ZF had strong model and backend interface generators like Symfony does. I have been looking for those and here is what I found:

Model generators

Backend interfaces

As usual one can use database administration tools

Backend interface generators

Setting up the interface seems to be quite easy, for instance here is how you would display a form to edit contacts on the same page as you would edit members:

<?php
class MemberContacts extends Kwf_Model_Db
{
    protected $_table = 'member_contacts';
    protected $_referenceMap = array(
        'Member' => array(
            'column'           => 'member_id',
            'refModelClass'     => 'Members',
        )
    );
}
?>

enter image description here

A demo of Koala frameworks is available. To be honest it looks quite impressive.

Q: Which model generators and backend interface (generators) do you use for Zend and why?

  • 写回答

1条回答 默认 最新

  • dongying6659 2012-03-20 03:41
    关注

    I do not use any kind of generator, prepared backoffice or so called scaffolding.

    Why I don't use them in a general way ?

    These tools introduce a strong dependencies on the way the generated UI is structured, you do not have anymore the power to design it the exact way you want.

    They are quite hard to reuse unless you know them very well, they introduce a lot of magic, for example when I create a backoffice using Django I've to set five parameters and I've a backoffice running. Understanding how it works do really need a lot of knowledge on the inner mechanisms of the tool, so updating it can be a real pain.

    To my mind there's a strong difference between providing almost complete backoffice application like Symfony, Rails and Django do, and what Zend Framework do: constraining to general framework and libraries.

    There is a deliberate choice between something working out of the box and something flexible. I think they tend to aim different needs.

    I tend to prefer the Zend Framework approach since I'm not satisfied (nor experienced I've to admit it) with what others offer as an "almost done" UI.

    Why I won't ever use them in Zend Framework ?

    If Zend Framework doesn't embend such tools, I won't plug what others have tried to build upon it since nothing can guaranty that there won't be any regression on it (and upgrading can be a really good thing since Zend always integrate more and more external services). The power of Zend Framework is its flexibility, by overlapping tools over it, you're going against the philosophy of the product.

    It might meet your expectation on really small project, but for bigger one I do really suggest you to build your UI according to your own needs, the backoffice will only take only you one or two weeks more.

    评论

报告相同问题?

悬赏问题

  • ¥20 测距传感器数据手册i2c
  • ¥15 RPA正常跑,cmd输入cookies跑不出来
  • ¥15 求帮我调试一下freefem代码
  • ¥15 matlab代码解决,怎么运行
  • ¥15 R语言Rstudio突然无法启动
  • ¥15 关于#matlab#的问题:提取2个图像的变量作为另外一个图像像元的移动量,计算新的位置创建新的图像并提取第二个图像的变量到新的图像
  • ¥15 改算法,照着压缩包里边,参考其他代码封装的格式 写到main函数里
  • ¥15 用windows做服务的同志有吗
  • ¥60 求一个简单的网页(标签-安全|关键词-上传)
  • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法