pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

<small id='g0Gx8'></small><noframes id='g0Gx8'>

<i id='g0Gx8'><tr id='g0Gx8'><dt id='g0Gx8'><q id='g0Gx8'><span id='g0Gx8'><b id='g0Gx8'><form id='g0Gx8'><ins id='g0Gx8'></ins><ul id='g0Gx8'></ul><sub id='g0Gx8'></sub></form><legend id='g0Gx8'></legend><bdo id='g0Gx8'><pre id='g0Gx8'><center id='g0Gx8'></center></pre></bdo></b><th id='g0Gx8'></th></span></q></dt></tr></i><div class="vk2ncob" id='g0Gx8'><tfoot id='g0Gx8'></tfoot><dl id='g0Gx8'><fieldset id='g0Gx8'></fieldset></dl></div>
    • <bdo id='g0Gx8'></bdo><ul id='g0Gx8'></ul>

    1. <tfoot id='g0Gx8'></tfoot><legend id='g0Gx8'><style id='g0Gx8'><dir id='g0Gx8'><q id='g0Gx8'></q></dir></style></legend>

        Zend Framework中如何實現服務層?

        How to implement service layer in Zend Framework?(Zend Framework中如何實現服務層?)

        • <legend id='PCTY5'><style id='PCTY5'><dir id='PCTY5'><q id='PCTY5'></q></dir></style></legend>
            <tbody id='PCTY5'></tbody>
            1. <i id='PCTY5'><tr id='PCTY5'><dt id='PCTY5'><q id='PCTY5'><span id='PCTY5'><b id='PCTY5'><form id='PCTY5'><ins id='PCTY5'></ins><ul id='PCTY5'></ul><sub id='PCTY5'></sub></form><legend id='PCTY5'></legend><bdo id='PCTY5'><pre id='PCTY5'><center id='PCTY5'></center></pre></bdo></b><th id='PCTY5'></th></span></q></dt></tr></i><div class="jytjq2e" id='PCTY5'><tfoot id='PCTY5'></tfoot><dl id='PCTY5'><fieldset id='PCTY5'></fieldset></dl></div>
            2. <tfoot id='PCTY5'></tfoot>

              <small id='PCTY5'></small><noframes id='PCTY5'>

                • <bdo id='PCTY5'></bdo><ul id='PCTY5'></ul>
                  本文介紹了Zend Framework中如何實現服務層?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我正在尋找一些好的資源來學習如何在 Zend Framework 中實現內部服務層.這是個有趣的帖子Bookie Link,但沒有具體的代碼示例.

                  • 在哪里放置服務類 (/application/modules/modulename/services/?);
                  • 如何自動加載它們(自定義自動加載器?)
                  • 最常見的服務(用戶、身份驗證、購物車、緩存、提要?)
                  • 示例實現(任何 github 存儲庫?)
                  • 好的做法?

                  解決方案

                  我認為這個問題的答案取決于您的需求、您的時間限制以及您的軟件開發的整體方法/風格.

                  我最近 (A) 決定在一個小型但復雜的 Web 應用程序上使用 Zend Framework,該應用程序的期限非常緊迫,并且 (B) 花了大量時間研究 ORM 解決方案和不同的 ZF 應用程序結構.我得出的結論是,沒有一刀切的解決方案,您應該盡情發揮創意并構建一個滿意的應用程序結構.>

                  如果時間緊迫且應用程序不是太大,那么您可以創建名稱類似于 Application_Model_BlahService 的類并將它們存儲在 application/models目錄,默認情況下它們會被自動加載器選取(假設自動加載器已正確引導).

                  但是,如果您的應用程序較大,或者由于某些其他原因,您想將類拆分到更多目錄中,則可以在應用程序目錄下創建自己的子目錄,并使用類似于下面的代碼(可能會存在)在您的 application/Bootstrap.php) 中將這些類添加到自動加載器:

                  受保護的函數 _initResourceLoader(){$this->_resourceLoader->addResourceType('service', 'services', 'Service');$this->_resourceLoader->addResourceType('serviceplugin', 'services/plugins', 'Service_Plugin');}

                  然后您可以創建諸如 Application_Service_Invoice 之類的類,它們將駐留在 application/services/Invoice.phpApplication_Service_Plugin_TaxPlugin 中,它們將駐留在application/services/plugins/TaxPlugin.php.(注意:上面的代碼假設您使用的是 Zend_Application).

                  理論上,您可以隨心所欲地將模型類與服務類與數據訪問類等分開.但同樣,這取決于您喜歡的開發風格、應用程序的大小團隊,在某種程度上,你的持久層對你有什么要求.

                  最后一件事:查看 Zend_Application_Module_Autoloader 中默認添加到自動加載器的資源列表.(我應該在這個答案中提到我指的是 ZF 1.8+ 嗎?)

                  I'm looking for some good resources to learn how to implement internal service layer in Zend Framework. This is interesting post Bookie Link, but with no concrete code samples.

                  • Where to put service classes (/application/modules/modulename/services/?);
                  • How to autoload them (custom autoloader?)
                  • Most common services (user, authentication, cart, cache, feed?)
                  • Sample implementations (any github repos?)
                  • Good practices?

                  解決方案

                  I think the answer to this question depends on your needs, your time constraints and your overall approach to/style of software development.

                  I have recently (A) made the decision to use Zend Framework on a small but complex web application that has a very tight deadline and (B) have spent a LOT of time investigating ORM solutions and different ZF application structures in general. The conclusion I have come to is that there isn't a one-size-fits-all solution and that you should feel free to get creative and build an application structure that you are happy with.

                  If you have tight time constraints and the application isn't too large, then you could just create classes with names like Application_Model_BlahService and store them in the application/models directory and they will get picked up by default by the autoloader (assuming the autoloader has been bootstrapped correctly).

                  But if your application is larger or if, for some other reason, you want to split classes out into more directories, you could create your own sub-directories under the application directory and use something like the code below (which would exist in your application/Bootstrap.php) to add those classes to the autoloader:

                  protected function _initResourceLoader()
                  {
                      $this->_resourceLoader->addResourceType( 'service', 'services', 'Service' );
                      $this->_resourceLoader->addResourceType( 'serviceplugin', 'services/plugins', 'Service_Plugin' );
                  }
                  

                  You can then create classes like Application_Service_Invoice, which would reside in application/services/Invoice.php and Application_Service_Plugin_TaxPlugin, which would reside in application/services/plugins/TaxPlugin.php. (Note: the code above assumes you are using Zend_Application).

                  You could, in theory, take this as far as you like and separate model classes from service classes from data access classes, etc etc etc. But again, it depends on the style of development that you prefer, the size of the team and, to some degree, what requirements your persistence layer imposes on you.

                  One last quick thing: have a look in Zend_Application_Module_Autoloader for a list of resources that are added to the autoloader by default. (Should I have mentioned that I'm referring to ZF 1.8+ in this answer?)

                  這篇關于Zend Framework中如何實現服務層?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  Deadlock exception code for PHP, MySQL PDOException?(PHP、MySQL PDOException 的死鎖異常代碼?)
                  PHP PDO MySQL scrollable cursor doesn#39;t work(PHP PDO MySQL 可滾動游標不起作用)
                  PHP PDO ODBC connection(PHP PDO ODBC 連接)
                  Using PDO::FETCH_CLASS with Magic Methods(使用 PDO::FETCH_CLASS 和魔術方法)
                  php pdo get only one value from mysql; value that equals to variable(php pdo 只從 mysql 獲取一個值;等于變量的值)
                  MSSQL PDO could not find driver(MSSQL PDO 找不到驅動程序)
                    <bdo id='raamy'></bdo><ul id='raamy'></ul>
                  • <i id='raamy'><tr id='raamy'><dt id='raamy'><q id='raamy'><span id='raamy'><b id='raamy'><form id='raamy'><ins id='raamy'></ins><ul id='raamy'></ul><sub id='raamy'></sub></form><legend id='raamy'></legend><bdo id='raamy'><pre id='raamy'><center id='raamy'></center></pre></bdo></b><th id='raamy'></th></span></q></dt></tr></i><div class="ctgre2w" id='raamy'><tfoot id='raamy'></tfoot><dl id='raamy'><fieldset id='raamy'></fieldset></dl></div>
                        <tbody id='raamy'></tbody>

                      <small id='raamy'></small><noframes id='raamy'>

                    • <tfoot id='raamy'></tfoot>

                          <legend id='raamy'><style id='raamy'><dir id='raamy'><q id='raamy'></q></dir></style></legend>
                            主站蜘蛛池模板: 高压油管,液压接头,液压附件-烟台市正诚液压附件 | 过滤器_自清洗过滤器_气体过滤器_苏州华凯过滤技术有限公司 | 杜康白酒加盟_杜康酒代理_杜康酒招商加盟官网_杜康酒厂加盟总代理—杜康酒神全国运营中心 | 超高频感应加热设备_高频感应电源厂家_CCD视觉检测设备_振动盘视觉检测设备_深圳雨滴科技-深圳市雨滴科技有限公司 | 我爱古诗词_古诗词名句赏析学习平台 | 金属切削液-脱水防锈油-电火花机油-抗磨液压油-深圳市雨辰宏业科技发展有限公司 | 科普仪器菏泽市教育教学仪器总厂| 皮带机_移动皮带机_大倾角皮带机_皮带机厂家 - 新乡市国盛机械设备有限公司 | 旋振筛|圆形摇摆筛|直线振动筛|滚筒筛|压榨机|河南天众机械设备有限公司 | 汽液过滤网厂家_安平县银锐丝网有限公司| 超高频感应加热设备_高频感应电源厂家_CCD视觉检测设备_振动盘视觉检测设备_深圳雨滴科技-深圳市雨滴科技有限公司 | 食安观察网| 铝合金重力铸造_铝合金翻砂铸造_铝铸件厂家-东莞市铝得旺五金制品有限公司 | 管家婆-管家婆软件-管家婆辉煌-管家婆进销存-管家婆工贸ERP | 变色龙PPT-国内原创PPT模板交易平台 - PPT贰零 - 西安聚讯网络科技有限公司 | 上海平衡机-单面卧式动平衡机-万向节动平衡机-圈带动平衡机厂家-上海申岢动平衡机制造有限公司 | 上海物流公司,上海货运公司,上海物流专线-优骐物流公司 | 铁盒_铁罐_马口铁盒_马口铁罐_铁盒生产厂家-广州博新制罐 | 广东护栏厂家-广州护栏网厂家-广东省安麦斯交通设施有限公司 | 广东护栏厂家-广州护栏网厂家-广东省安麦斯交通设施有限公司 | 合肥升降机-合肥升降货梯-安徽升降平台「厂家直销」-安徽鼎升自动化科技有限公司 | 定量包装机,颗粒定量包装机,粉剂定量包装机,背封颗粒包装机,定量灌装机-上海铸衡电子科技有限公司 | 120kv/2mA直流高压发生器-60kv/2mA-30kva/50kv工频耐压试验装置-旭明电工 | 超声波清洗机_超声波清洗机设备_超声波清洗机厂家_鼎泰恒胜 | 丁基胶边来料加工,医用活塞边角料加工,异戊二烯橡胶边来料加工-河北盛唐橡胶制品有限公司 | 蒸汽吸附分析仪-进口水分活度仪|康宝百科| 工作心得_读书心得_学习心得_找心得体会范文就上学道文库 | 精密光学实验平台-红外粉末压片机模具-天津博君 | 卸料器-卸灰阀-卸料阀-瑞安市天蓝环保设备有限公司 | jrs高清nba(无插件)直播-jrs直播低调看直播-jrs直播nba-jrs直播 上海地磅秤|电子地上衡|防爆地磅_上海地磅秤厂家–越衡称重 | 米顿罗计量泵(科普)——韬铭机械| 车载加油机品牌_ 柴油加油机厂家| 哈希PC1R1A,哈希CA9300,哈希SC4500-上海鑫嵩实业有限公司 | 齿轮减速机_齿轮减速电机-VEMT蜗轮蜗杆减速机马达生产厂家瓦玛特传动瑞环机电 | 磁力抛光机_磁力研磨机_磁力去毛刺机_精密五金零件抛光设备厂家-冠古科技 | 裹包机|裹膜机|缠膜机|绕膜机-上海晏陵智能设备有限公司 | 橡胶接头_橡胶软接头_套管伸缩器_管道伸缩器厂家-巩义市远大供水材料有限公司 | 免联考国际MBA_在职MBA报考条件/科目/排名-MBA信息网 | 3d可视化建模_三维展示_产品3d互动数字营销_三维动画制作_3D虚拟商城 【商迪3D】三维展示服务商 广东健伦体育发展有限公司-体育工程配套及销售运动器材的体育用品服务商 | 丹佛斯变频器-Danfoss战略代理经销商-上海津信变频器有限公司 | 蔡司三坐标-影像测量机-3D扫描仪-蔡司显微镜-扫描电镜-工业CT-ZEISS授权代理商三本工业测量 |