一、Web Service Software Factory 是微軟在patterns & practices中提出的關於Web Service 的最佳實務
二、首先來看看關於ASMX Service模板的解決方案架構圖,有對於我們以後的學習有個全域上瞭解
因為我的e文不是很好,所以我把原文也發了上來,以免誤人子弟
Service interface layer. This layer defines the operations of a service, the messages required to interact with each operation, and the patterns by which these messages interact—these patterns are referred to as message exchange patterns. The service interface layer contains a service contract, which describes the behavior of a service and the messages required as the basis for interaction. The service interface layer also contains a service adapter, which is used to implement the service contract and to expose this functionality on a certain endpoint.
服務介面層.這層定義商務服務,所需資訊互動每次行動而這些資訊和互動的模式-這些模式稱為資訊交流模式.服務介面層包含了服務合約,用來描述行為所需的資訊和服務為基礎的互動.服務介面層也包含了服務適配器,它是用來執行這一功能服務合約和揭露某個端點.
Business layer. This layer incorporates components that implement the business logic of the application. Simple services often require only a very simple business action, but services with more complex requirements may implement a Controller pattern or business rules for implementing service behavior. The business layer also includes business entities that are used to represent objects specific to a business domain. These entities can incorporate both state and behavior.
商務層.這一層包含商業邏輯元件,貫徹實施往往只需要一個非常簡單的服務動作,但更為複雜的服務需求,則可能要實施控制器模式或業務實施細則的服務行為.業務層業務實體還包括用來向特定對象所代表的業務領域.這層也包括商務流程
Resource access layer. This layer contains the logic necessary to access data. The layer also contains service agents, which isolate the idiosyncrasies of calling diverse services from your application and can provide additional services, such as basic mapping between the format of the data exposed by the service and the format your application requires. Components to address cross-cutting concerns. These components address functionality common to multiple layers of the architecture.
資源接入層.這一層包含的資料擷取所需的邏輯.該層也包含服務代理孤立的特質,從你的應用和服務多樣化要求提供額外服務,測繪等基本資料格式之間的接觸和服務形式的申請.關切組件處理跨領域的.
三、服務工廠的核心
Data types. These are used to define the abstract data structures that form the basis for content within a message. These types are often reused by different operations of a service and even by different services.
資料類型.這些都是用來界定抽象資料結構,形成了資訊內容的依據.這些不同類型的業務,往往再用一個服務,甚至不同的服務.
Message types. These are used to compose complex messages from existing data types and primitive types.
訊息類型.這些是被用來從現有的資料類型和原始類型組成的複雜訊息.
Service contracts. These specify the operations that services support and the messages required for interacting with each operation.
服務合約.這些具體行動表示支援和服務所需的資訊互動配合運作.
Service implementations. These are .NET Framework classes that implement service contracts.
服務執行。 這些是.NET執行服務合約的架構類。
Adapters. These use the EntityTranslator to translate between message types or data types and types required by the business actions before invoking the business action. 適配器.利用這些entitytranslator在所需的訊息類型或資料類型的商業行為之前調用商業行為的類型之間的解釋.
Entity translators. These transform between message or data types and business entities. The entity translator is an object that is tightly coupled to both the service interface and business layers, but at the same time provides loose coupling between them. This loose coupling prevents changes in one layer from forcing changes in the other layer.
實體翻譯器.這些訊息或資料類型之間的轉換和業務主體.翻譯器是一個實體物件就是緊耦合服務介面和業務都層,但同時規定,它們之間保持低耦合.這一低耦合的變化防止了從一個層變化到另一層.
Business actions. These organize business logic by procedures where each procedure handles a single request from the presentation layer.
業務行為.這些組織業務的邏輯處理常式,每個程式一個單一的請求套層.
BusinessEntity. This is a class used to represent a domain model entity within the business layer of the application.
業務實體,這是一個類用來代表業務域實體模型的應用程式層.
Repository. This is an intermediate object used to support interactions between business logic and the data access logic. 庫.這是一個中間對象用來支援互動商務邏輯和資料存取邏輯.