乡下人产国偷v产偷v自拍,国产午夜片在线观看,婷婷成人亚洲综合国产麻豆,久久综合给合久久狠狠狠9

  • <output id="e9wm2"></output>
    <s id="e9wm2"><nobr id="e9wm2"><ins id="e9wm2"></ins></nobr></s>

    • 分享

      Petshop3.0學(xué)習(xí)筆記(四)應(yīng)用程序接口層 - torome - 博客園

       orion360doc 2011-05-19

      Petshop3.0學(xué)習(xí)筆記(四)應(yīng)用程序接口層

      在面向?qū)ο蟮膽?yīng)用程序開發(fā)中,類的接口是一個(gè)很重要的概念,在.net框架中,.net不僅提供了強(qiáng)大的面向?qū)ο蟮奶匦?,而且它也給我們提供了一系列強(qiáng)大的接口供我們使用,好了我們就來看看petshop3.0中的接口層,從解決方案管理器中的PetShop.IDAL命名空間中,我們可以看到幾個(gè)接口:IAccountIInventory、IItem、IOrder、IProductIProfile,我們以IAccount為例:
      using System;

       

      //References to PetShop specific libraries

      //PetShop busines entity library

      using PetShop.Model;

       

      namespace PetShop.IDAL

      {

           /// <summary>

           /// Inteface for the Account DAL

           /// </summary>

           public interface IAccount

           {

               /// <summary>

               /// Authenticate a user

               /// </summary>

               /// <param name="userId">Unique identifier for a user</param>

               /// <param name="password">Password for the user</param>

               /// <returns>Details about the user who has just logged in</returns>

               AccountInfo SignIn(string userId, string password);

       

               /// <summary>

               /// Get a user's address stored in the database

               /// </summary>

               /// <param name="userId">Unique identifier for a user</param>

               /// <returns>Address information</returns>

               AddressInfo GetAddress(string userId);

       

               /// <summary>

               /// Insert an account into the database

               /// </summary>

               /// <param name="account">Account to insert</param>

               void Insert(AccountInfo account);

       

               /// <summary>

               /// Update an account in the database

               /// </summary>

               /// <param name="Account">Account information to update</param>

               void Update(AccountInfo Account);

           }

      }

       

      這個(gè)外露的接口,提供了一系列的操縱帳戶信息的相關(guān)功能的函數(shù),就像接口的定義那樣,我們不必了解這個(gè)接口具體是如何實(shí)現(xiàn)的,只要我們?cè)跇I(yè)務(wù)處理層能夠好好使用就行了,按我的理解接口是一系列功能的集合,他把應(yīng)用程序不同的層次劃分得很清楚,這樣我們?cè)谛薷牡讓拥臄?shù)據(jù)庫處理過程實(shí)現(xiàn)的時(shí)候就能夠不修改業(yè)務(wù)處理層和表現(xiàn)層的代碼,這也是N層應(yīng)用程序系統(tǒng)架構(gòu)模式的好處,層次清晰,不同實(shí)現(xiàn)的分離,代碼的效率顯著提高了,他具有良好的封裝特性。

        本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊一鍵舉報(bào)。
        轉(zhuǎn)藏 分享 獻(xiàn)花(0

        0條評(píng)論

        發(fā)表

        請(qǐng)遵守用戶 評(píng)論公約

        類似文章 更多