久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

<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="qwawimqqmiuu" 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="qwawimqqmiuu" 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="qwawimqqmiuu" 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>
                            主站蜘蛛池模板: 日韩一区二区精品 | 嫩呦国产一区二区三区av | 成人免费视频一区二区 | 亚洲精品久久久一区二区三区 | 国产香蕉视频在线播放 | 欧美日韩专区 | 综合色在线 | 久久久精彩视频 | 国产精品美女一区二区 | 久久久精| 久久久久久天堂 | 一级片免费在线观看 | 91精品国产麻豆 | 免费在线观看一区二区三区 | 欧美天堂在线 | 国产91精品久久久久久久网曝门 | 日韩免费福利视频 | 国产精品成人在线播放 | 高清人人天天夜夜曰狠狠狠狠 | 成人久久| 亚洲高清久久 | 国产视频久久 | 日韩欧美国产成人一区二区 | 国产高清在线 | 91资源在线| 亚洲在线 | www.色53色.com | 欧美美女二区 | 久久一区二区三区四区 | 欧美久久不卡 | 三级在线免费观看 | 91tv在线观看 | 91国在线观看 | 成人在线视频看看 | 久久99网 | 日韩一二区 | 国产一区二区精 | 中文字幕乱码一区二区三区 | 欧美aaaaaaaaaa| 黄色在线免费观看视频 | 中文字幕不卡在线观看 |