More Related Content
Similar to 以 .NET RIA Services 打通 Silverlight 分散式開發之任督二脈
Similar to 以 .NET RIA Services 打通 Silverlight 分散式開發之任督二脈 (20)
More from Chui-Wen Chiu (20)
以 .NET RIA Services 打通 Silverlight 分散式開發之任督二脈
- 2. Agenda
.NET RIA Services目標功能定位
RIA Services運作主要觀念
定義DomainServices的CRUD
Entity Framework的ORM資料來源
RIA Services支援的型別
Asynchronous Domain Operations
Silverlight DomainDataSource
ASP.NET使用DomainService
Validation to Entities
2
- 5. .NET RIA Services到底想幹嘛?
目標:針對建立N-tier應用程式的複雜度而來
Framework:提供撰寫程式所需的規範patterns
Tools:VS 2008有效整合Client及mid-tier為一體
Services:如帳號及群組驗證、使用者設定等服務
5
- 7. RIA Services價值主張
支援end-to-end的資料使用
統合應用系統的Client與Server端程式開發
提供現成的Patterns與Services增加生產力
7
- 13. DomainService建立與消費
Defining Query Methods
ASP.NET透過DomainDataSource
存取DomainService服務
13
- 14. 定義DomainServices的CRUD
定義CRUD方法之原則
回傳型別
single instance T
IEnumerable<T>
IQueryable<T>
使用零或多個參數
使用[Query] attribute
Domain的operations不支援方法的多載
14
- 18. EDM主要定義檔成員
Conceptual Model
定義Entities及Relationships
Conceptual schema definition language file
(.csdl)
Storage Model(Logical Model)
目的是為了關聯式資料庫,將Entities及
Relationships正規化成具有foreign key
constrains的Table資料表
Store schema definition language file (.ssdl)
Mappings
定義Storage 及Conceptual Model二者間的對應
Mapping specification language file (.msl)
18
- 20. RIA Services支援的型別
Simple Type
Boolean、Byte 、 SByte 、 Int16 、 Char 、
Double 、 Single String、Decimal、DateTime、
TimeSpan、Guid、Uri、XElement
Complex Type
Byte[]
System.Data.Linq.Binary
Array
IEnumerable<T>
Nullable<T>
Any types that implements IList
20
- 21. Asynchronous Domain Operations
LoadOperation(Query)
SubmitOperation(Submit)
InvokeOperation(Invoke)
Operation State
IsComplete
Completed event
UserState
Cancel () / CanCancel / IsCanceled
Error / HasError
21
- 26. Validation to Entities
CustomValidationAttribute
DataTypeAttribute
RangeAttribute
RegularExpressionAttribute
RequiredAttribute
StringLengthAttribute
26
- 29. © 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.
The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should
not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS,
IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
29