久久久久久久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中如何實(shí)現(xiàn)服務(wù)層?

        How to implement service layer in Zend Framework?(Zend Framework中如何實(shí)現(xiàn)服務(wù)層?)

        • <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中如何實(shí)現(xiàn)服務(wù)層?的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  我正在尋找一些好的資源來學(xué)習(xí)如何在 Zend Framework 中實(shí)現(xiàn)內(nèi)部服務(wù)層.這是個(gè)有趣的帖子Bookie Link,但沒有具體的代碼示例.

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

                  解決方案

                  我認(rèn)為這個(gè)問題的答案取決于您的需求、您的時(shí)間限制以及您的軟件開發(fā)的整體方法/風(fēng)格.

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

                  如果時(shí)間緊迫且應(yīng)用程序不是太大,那么您可以創(chuàng)建名稱類似于 Application_Model_BlahService 的類并將它們存儲(chǔ)在 application/models目錄,默認(rèn)情況下它們會(huì)被自動(dòng)加載器選取(假設(shè)自動(dòng)加載器已正確引導(dǎo)).

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

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

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

                  理論上,您可以隨心所欲地將模型類與服務(wù)類與數(shù)據(jù)訪問類等分開.但同樣,這取決于您喜歡的開發(fā)風(fēng)格、應(yīng)用程序的大小團(tuán)隊(duì),在某種程度上,你的持久層對(duì)你有什么要求.

                  最后一件事:查看 Zend_Application_Module_Autoloader 中默認(rèn)添加到自動(dòng)加載器的資源列表.(我應(yīng)該在這個(gè)答案中提到我指的是 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?)

                  這篇關(guān)于Zend Framework中如何實(shí)現(xiàn)服務(wù)層?的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                  相關(guān)文檔推薦

                  Deadlock exception code for PHP, MySQL PDOException?(PHP、MySQL PDOException 的死鎖異常代碼?)
                  PHP PDO MySQL scrollable cursor doesn#39;t work(PHP PDO MySQL 可滾動(dòng)游標(biāo)不起作用)
                  PHP PDO ODBC connection(PHP PDO ODBC 連接)
                  Using PDO::FETCH_CLASS with Magic Methods(使用 PDO::FETCH_CLASS 和魔術(shù)方法)
                  php pdo get only one value from mysql; value that equals to variable(php pdo 只從 mysql 獲取一個(gè)值;等于變量的值)
                  MSSQL PDO could not find driver(MSSQL PDO 找不到驅(qū)動(dòng)程序)
                    <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>
                            主站蜘蛛池模板: 色综合一区二区 | 午夜精品久久久久久久久久久久久 | 国产高清免费 | 欧美久久视频 | 四虎影视免费观看 | 国产精品福利久久久 | 四虎最新视频 | 日本精品一区二区三区在线观看 | 精品国产一区二区在线 | 精品国产一区二区三区观看不卡 | 日韩性在线 | 亚洲一区二区三区在线播放 | 日韩欧美国产一区二区三区 | 国产精品美女在线观看 | 日韩久草 | 午夜资源 | 国产精品成人国产乱一区 | 97视频网站 | 国产精品国产a级 | 午夜在线免费观看视频 | 亚洲最大av| 欧美在线a | 天堂精品视频 | 欧美午夜一区 | 一区二区三区四区在线 | 99久久成人 | 男女污污动态图 | 99国产精品久久久 | a级在线 | 最新中文字幕在线 | 国产一区二 | 欧美成人猛片aaaaaaa | 成人在线视频一区 | av片免费| 亚洲 欧美 综合 | 999热精品 | 免费高清av | 久草在线视频中文 | 视频1区2区 | 亚洲午夜精品在线观看 | 亚洲第一中文字幕 |