Download - Data Access Layer (DAL) App Logic Database View Web Service App Logic App Logic Trust Boundary
![Page 1: Data Access Layer (DAL) App Logic Database View Web Service App Logic App Logic Trust Boundary](https://reader035.vdocuments.net/reader035/viewer/2022062404/551a74f5550346761a8b4ad6/html5/thumbnails/1.jpg)
mini
![Page 2: Data Access Layer (DAL) App Logic Database View Web Service App Logic App Logic Trust Boundary](https://reader035.vdocuments.net/reader035/viewer/2022062404/551a74f5550346761a8b4ad6/html5/thumbnails/2.jpg)
Mini
WCF RIA Services
Bátyai KrisztiánMVP|MCT|MCPD 4.0Webmine Kft.
![Page 3: Data Access Layer (DAL) App Logic Database View Web Service App Logic App Logic Trust Boundary](https://reader035.vdocuments.net/reader035/viewer/2022062404/551a74f5550346761a8b4ad6/html5/thumbnails/3.jpg)
Mini
Menetrend
o WCF RIA Services bemutatásao OFF: Navigáció & Témák & Autentikációo Lekérdezések (& Autorizáció)o CRUD műveleteko Business Logic & Validáció
![Page 4: Data Access Layer (DAL) App Logic Database View Web Service App Logic App Logic Trust Boundary](https://reader035.vdocuments.net/reader035/viewer/2022062404/551a74f5550346761a8b4ad6/html5/thumbnails/4.jpg)
Mini
WCF RIA Services bemutatása
![Page 5: Data Access Layer (DAL) App Logic Database View Web Service App Logic App Logic Trust Boundary](https://reader035.vdocuments.net/reader035/viewer/2022062404/551a74f5550346761a8b4ad6/html5/thumbnails/5.jpg)
Mini
N-rétegű alkalamzás fejlesztés
Mit akarunk általában csinálni?
o felhasználók kezeléseo adatok o megjelenítéseo listázásao szerkesztése
o üzleti szabályok érvényesítéseo stb.
Mit teszünk az idő nagy részében?
o infrastruktúrát gyártunk(infrastruktúra===framework, componensek, helper osztályok)(change-tracking,validáció...)o saját megoldáso meglépvő out-of-box és/vagy 3rd
party megoldások illesztése
![Page 6: Data Access Layer (DAL) App Logic Database View Web Service App Logic App Logic Trust Boundary](https://reader035.vdocuments.net/reader035/viewer/2022062404/551a74f5550346761a8b4ad6/html5/thumbnails/6.jpg)
Mini
RIA Services N rétegű alkalmazás fejlesztés
Data Access Layer (DAL)
App Logic
Database
View
Web Service
AppLogic
TrustBoundary
![Page 7: Data Access Layer (DAL) App Logic Database View Web Service App Logic App Logic Trust Boundary](https://reader035.vdocuments.net/reader035/viewer/2022062404/551a74f5550346761a8b4ad6/html5/thumbnails/7.jpg)
Mini
Skálázhatóság, illeszthetőség
AppLogic
DatabasesADO.NET,ORMs (LTS, EF, …)
CLR Lists/ObjectsRepository(nHibernate, …)
ServicesREST/SOAP(Azure, …)
XML, JSON, Binary
.NET ClientsSilverlight, WPF
Standards ClientsJavaScript
Server RenderingHTML, SEO,Printing, …
ServicesWCF
Unit Test Code
![Page 8: Data Access Layer (DAL) App Logic Database View Web Service App Logic App Logic Trust Boundary](https://reader035.vdocuments.net/reader035/viewer/2022062404/551a74f5550346761a8b4ad6/html5/thumbnails/8.jpg)
Mini
Áttekintés
Rich Internet Application
DB
Services
Data Access Layer
AppLogic
PresentationLogic
Network
DomainServiceStateless CRUD + App Logic
class PlateViewDomainServiceIQueryable<Restaurant> GetRestaurants()IQueryable<Restaurant> SearchRestaurant(string)void AddRestaurant(Restaurant)Validation and authorization rules,
Application workflows, …
Data Model class Book
DomainContextStateful view + Bindable Data
class PlateViewDomainServiceEntityList<Restaurant> Books { get }EntityQuery<Restaurant> GetRestaurantQuery()EntityQuery<Restaurant> SearchRestaurantQuery(string)
class RestaurantData members + Validation
Data Model +Metadata +
Shared Code
DomainContext
DataService
Under the covers infrastructure
![Page 9: Data Access Layer (DAL) App Logic Database View Web Service App Logic App Logic Trust Boundary](https://reader035.vdocuments.net/reader035/viewer/2022062404/551a74f5550346761a8b4ad6/html5/thumbnails/9.jpg)
Mini
WCF Ria Services & WCF
DomainService(LinqToEntitiesDomainService
<T>)
DomainServiceHost
WCF ServiceWCF
Service Contract
WCR RIAServices
WCF
DomainContext
DomainClient
WCFWCF
Service Contract
1101001..
...<Entity>
![Page 10: Data Access Layer (DAL) App Logic Database View Web Service App Logic App Logic Trust Boundary](https://reader035.vdocuments.net/reader035/viewer/2022062404/551a74f5550346761a8b4ad6/html5/thumbnails/10.jpg)
Mini
Navigáció & Témák& Autentikáció
![Page 11: Data Access Layer (DAL) App Logic Database View Web Service App Logic App Logic Trust Boundary](https://reader035.vdocuments.net/reader035/viewer/2022062404/551a74f5550346761a8b4ad6/html5/thumbnails/11.jpg)
Mini
SL&RIA Alkalmazás témák
![Page 12: Data Access Layer (DAL) App Logic Database View Web Service App Logic App Logic Trust Boundary](https://reader035.vdocuments.net/reader035/viewer/2022062404/551a74f5550346761a8b4ad6/html5/thumbnails/12.jpg)
SL&RIA Alkalmazás témák
DEMO
![Page 13: Data Access Layer (DAL) App Logic Database View Web Service App Logic App Logic Trust Boundary](https://reader035.vdocuments.net/reader035/viewer/2022062404/551a74f5550346761a8b4ad6/html5/thumbnails/13.jpg)
Mini
Autentikáció
o Out-of-box ASP.Net Application Services
o Out-of-box WCF Ria Autentikáció
<%@ ServiceHost Language="C#" Service="System.Web.ApplicationServices.AuthenticationService" Debug="true" %>
[EnableClientAccess]public class AuthenticationDomainService1 : AuthenticationBase<User>{...}
WebContext webContext = new WebContext();webContext.Authentication = new FormsAuthentication();//webContext.Authentication = new WindowsAuthentication();this.ApplicationLifetimeObjects.Add(webContext);
![Page 14: Data Access Layer (DAL) App Logic Database View Web Service App Logic App Logic Trust Boundary](https://reader035.vdocuments.net/reader035/viewer/2022062404/551a74f5550346761a8b4ad6/html5/thumbnails/14.jpg)
Autentikáció
DEMO
![Page 15: Data Access Layer (DAL) App Logic Database View Web Service App Logic App Logic Trust Boundary](https://reader035.vdocuments.net/reader035/viewer/2022062404/551a74f5550346761a8b4ad6/html5/thumbnails/15.jpg)
Mini
Lekérdezések
![Page 16: Data Access Layer (DAL) App Logic Database View Web Service App Logic App Logic Trust Boundary](https://reader035.vdocuments.net/reader035/viewer/2022062404/551a74f5550346761a8b4ad6/html5/thumbnails/16.jpg)
Mini
A lekérdezés szereplői
DomainServiceStateless
DataModell
DALL2S EF REST/SOAP
POCO
SQL
DomainContextStateFull
UI VIEW
UI - VMEntity+Metadat
a
Entity+Metadat
a
Entity-Containe
r
Server Client
![Page 17: Data Access Layer (DAL) App Logic Database View Web Service App Logic App Logic Trust Boundary](https://reader035.vdocuments.net/reader035/viewer/2022062404/551a74f5550346761a8b4ad6/html5/thumbnails/17.jpg)
Mini
A lekérdezés folyamata
DomainServiceStateless
DataModell
DALL2S EF REST/SOAP
POCO
SQL
DomainContextStateFull
UI VIEW
UI - VMEntity+Metadat
a
Entity+Metadat
a
Entity-Containe
r
Server Client
1. Query request
2. EntityQuery<T>
3. dc.Load(eq)4. Async request
5. Async response
6. Binding
![Page 18: Data Access Layer (DAL) App Logic Database View Web Service App Logic App Logic Trust Boundary](https://reader035.vdocuments.net/reader035/viewer/2022062404/551a74f5550346761a8b4ad6/html5/thumbnails/18.jpg)
Mini
Query definíció
o Elnevezésselo Visszatérési érték: IQueryable<T>, IEnumerable<T>
o QueryAttributeo IsComposable
![Page 19: Data Access Layer (DAL) App Logic Database View Web Service App Logic App Logic Trust Boundary](https://reader035.vdocuments.net/reader035/viewer/2022062404/551a74f5550346761a8b4ad6/html5/thumbnails/19.jpg)
Domain Queries
DEMO
![Page 20: Data Access Layer (DAL) App Logic Database View Web Service App Logic App Logic Trust Boundary](https://reader035.vdocuments.net/reader035/viewer/2022062404/551a74f5550346761a8b4ad6/html5/thumbnails/20.jpg)
Mini
Kliens oldali cache
DomainContext
DomainService
Load(q) Query result)
Entity+Metadat
a
Entity-Containe
r
Entity-Containe
r
EntitySetEntity
SetEntitySet
EntitySet<T>• IEnumerable<T>• INotifyCollectionChanged• IRevertibleChangeTracking• IChangeTracking• ...
EntityEntit
yEntity
![Page 21: Data Access Layer (DAL) App Logic Database View Web Service App Logic App Logic Trust Boundary](https://reader035.vdocuments.net/reader035/viewer/2022062404/551a74f5550346761a8b4ad6/html5/thumbnails/21.jpg)
Kliens oldali cache
DEMO
![Page 22: Data Access Layer (DAL) App Logic Database View Web Service App Logic App Logic Trust Boundary](https://reader035.vdocuments.net/reader035/viewer/2022062404/551a74f5550346761a8b4ad6/html5/thumbnails/22.jpg)
Mini
Kliens oldali LINQ használata
EntityQuery<T>
Domain Service
EntityQuery<T>• QueryName• Parameters• Query• IsComposable
Query• Where• Skip• Take• OrderBy
SQL
Base Query +
Client Query
![Page 23: Data Access Layer (DAL) App Logic Database View Web Service App Logic App Logic Trust Boundary](https://reader035.vdocuments.net/reader035/viewer/2022062404/551a74f5550346761a8b4ad6/html5/thumbnails/23.jpg)
Kliens oldali LINQ használata
DEMO
![Page 24: Data Access Layer (DAL) App Logic Database View Web Service App Logic App Logic Trust Boundary](https://reader035.vdocuments.net/reader035/viewer/2022062404/551a74f5550346761a8b4ad6/html5/thumbnails/24.jpg)
Mini
Objektum hierarchiák
Server Side
Entity
Server Side
Metadata
Domain Service
foo1 foo1
Server Client
EntityContainer
![Page 25: Data Access Layer (DAL) App Logic Database View Web Service App Logic App Logic Trust Boundary](https://reader035.vdocuments.net/reader035/viewer/2022062404/551a74f5550346761a8b4ad6/html5/thumbnails/25.jpg)
Objektum hierarchiák lekérdezése
DEMO
![Page 26: Data Access Layer (DAL) App Logic Database View Web Service App Logic App Logic Trust Boundary](https://reader035.vdocuments.net/reader035/viewer/2022062404/551a74f5550346761a8b4ad6/html5/thumbnails/26.jpg)
Mini
CRUD műveletek
![Page 27: Data Access Layer (DAL) App Logic Database View Web Service App Logic App Logic Trust Boundary](https://reader035.vdocuments.net/reader035/viewer/2022062404/551a74f5550346761a8b4ad6/html5/thumbnails/27.jpg)
Mini
Kliens oldali működés
DomainContext
EntityContainer
EntitySet
Entity
EntityChangeSet
ChangeSetEntry
DomainClient
SubmitChanges()
![Page 28: Data Access Layer (DAL) App Logic Database View Web Service App Logic App Logic Trust Boundary](https://reader035.vdocuments.net/reader035/viewer/2022062404/551a74f5550346761a8b4ad6/html5/thumbnails/28.jpg)
Mini
Változás-követés
EntityContainer
EntitySet
Entity
• IRevertibleChangeTracking• HasChanges• GetChanges()
• IRevertibleChangeTracking• HasChanges
• IRevertibleChangeTracking• HasChanges• EntityState, GetOriginal()
• AcceptChanges• RejectChanges• Add()• Attach()• ...
![Page 29: Data Access Layer (DAL) App Logic Database View Web Service App Logic App Logic Trust Boundary](https://reader035.vdocuments.net/reader035/viewer/2022062404/551a74f5550346761a8b4ad6/html5/thumbnails/29.jpg)
Mini
DomainSerivce
Server oldali működés
001101101DomainClient
WCF
WCF
Submit(ChangeSet)• AuthorizeChangeSet()• ValidateChangeSet()• ExecuteChangeSet()• CRUD• PersistChangeSet()
EntityChangeSet
ChangeSetEntry
![Page 30: Data Access Layer (DAL) App Logic Database View Web Service App Logic App Logic Trust Boundary](https://reader035.vdocuments.net/reader035/viewer/2022062404/551a74f5550346761a8b4ad6/html5/thumbnails/30.jpg)
Mini
CRUD definíció
o Elnevezésselo Visszatérési érték:voido Paraméter: Entityo Prefix: Insert,Update,Delete v. Add,Change,Remove
o Attribute*
![Page 31: Data Access Layer (DAL) App Logic Database View Web Service App Logic App Logic Trust Boundary](https://reader035.vdocuments.net/reader035/viewer/2022062404/551a74f5550346761a8b4ad6/html5/thumbnails/31.jpg)
CRUD
DEMO
![Page 32: Data Access Layer (DAL) App Logic Database View Web Service App Logic App Logic Trust Boundary](https://reader035.vdocuments.net/reader035/viewer/2022062404/551a74f5550346761a8b4ad6/html5/thumbnails/32.jpg)
Mini
Business Logic & Validáció
![Page 33: Data Access Layer (DAL) App Logic Database View Web Service App Logic App Logic Trust Boundary](https://reader035.vdocuments.net/reader035/viewer/2022062404/551a74f5550346761a8b4ad6/html5/thumbnails/33.jpg)
Mini
RIA Services N rétegű alkalmazás fejlesztés
Data Access Layer (DAL)
App Logic
Database
View
Web Service
AppLogic
TrustBoundary
• Business Logic• Validation
![Page 34: Data Access Layer (DAL) App Logic Database View Web Service App Logic App Logic Trust Boundary](https://reader035.vdocuments.net/reader035/viewer/2022062404/551a74f5550346761a8b4ad6/html5/thumbnails/34.jpg)
Mini
Business Logic & Validáció
o Business Logico Invoke Operationso Shared files
o Validációo Out-of-Box Validationo (Custom) Server Validationo Client & Server (shared) Validationo Entity Level Validationo Async Server Validation with InvokeMethod in Client
![Page 35: Data Access Layer (DAL) App Logic Database View Web Service App Logic App Logic Trust Boundary](https://reader035.vdocuments.net/reader035/viewer/2022062404/551a74f5550346761a8b4ad6/html5/thumbnails/35.jpg)
Mini
Business Logic
o Invoke Operationso ~WCF operationo No change trackingo Async
o Shared fileso Visual Studio Tool
![Page 36: Data Access Layer (DAL) App Logic Database View Web Service App Logic App Logic Trust Boundary](https://reader035.vdocuments.net/reader035/viewer/2022062404/551a74f5550346761a8b4ad6/html5/thumbnails/36.jpg)
Invoke OperationShared Code
DEMO
![Page 37: Data Access Layer (DAL) App Logic Database View Web Service App Logic App Logic Trust Boundary](https://reader035.vdocuments.net/reader035/viewer/2022062404/551a74f5550346761a8b4ad6/html5/thumbnails/37.jpg)
Mini
Out-of-Box Validation
o Server Sideo Metadata modello Required,Range,etc.
o Client Sideo System.ComponentModel.DataAnnotations.*o Entity.ValidateProperty()o INotifyErrorDataInfo
![Page 38: Data Access Layer (DAL) App Logic Database View Web Service App Logic App Logic Trust Boundary](https://reader035.vdocuments.net/reader035/viewer/2022062404/551a74f5550346761a8b4ad6/html5/thumbnails/38.jpg)
Out-of-Box Validation
DEMO
![Page 39: Data Access Layer (DAL) App Logic Database View Web Service App Logic App Logic Trust Boundary](https://reader035.vdocuments.net/reader035/viewer/2022062404/551a74f5550346761a8b4ad6/html5/thumbnails/39.jpg)
Mini
(Custom) Server Validation
o ValidationException
![Page 40: Data Access Layer (DAL) App Logic Database View Web Service App Logic App Logic Trust Boundary](https://reader035.vdocuments.net/reader035/viewer/2022062404/551a74f5550346761a8b4ad6/html5/thumbnails/40.jpg)
Mini
(Custom) Server Validation
o CustomValidationAttribute
![Page 41: Data Access Layer (DAL) App Logic Database View Web Service App Logic App Logic Trust Boundary](https://reader035.vdocuments.net/reader035/viewer/2022062404/551a74f5550346761a8b4ad6/html5/thumbnails/41.jpg)
(Custom) Server Validation
DEMO
![Page 42: Data Access Layer (DAL) App Logic Database View Web Service App Logic App Logic Trust Boundary](https://reader035.vdocuments.net/reader035/viewer/2022062404/551a74f5550346761a8b4ad6/html5/thumbnails/42.jpg)
Mini
Client & Server (shared) Validation
.shared
.cs
![Page 43: Data Access Layer (DAL) App Logic Database View Web Service App Logic App Logic Trust Boundary](https://reader035.vdocuments.net/reader035/viewer/2022062404/551a74f5550346761a8b4ad6/html5/thumbnails/43.jpg)
Client & Server (shared) Validation
DEMO
![Page 44: Data Access Layer (DAL) App Logic Database View Web Service App Logic App Logic Trust Boundary](https://reader035.vdocuments.net/reader035/viewer/2022062404/551a74f5550346761a8b4ad6/html5/thumbnails/44.jpg)
Entity Level validáció
DEMO
![Page 45: Data Access Layer (DAL) App Logic Database View Web Service App Logic App Logic Trust Boundary](https://reader035.vdocuments.net/reader035/viewer/2022062404/551a74f5550346761a8b4ad6/html5/thumbnails/45.jpg)
Async Server validációa kliens oldalon
DEMO
![Page 46: Data Access Layer (DAL) App Logic Database View Web Service App Logic App Logic Trust Boundary](https://reader035.vdocuments.net/reader035/viewer/2022062404/551a74f5550346761a8b4ad6/html5/thumbnails/46.jpg)
Mini
Összefoglalás
Kihívás Megoldás
Középső réteg kialakítása Domain Services (with WCF)LINQ + EF + POCO + stb.
Code/Logic megosztás Desing-time tools
Async kommunikáció Out-of-box WCF + DomainContext
Rétegeken átívelő validáció Metadata, code share, SL komponensek
Security: authentication & authorization Out-of-box ASP.Net+customization
![Page 47: Data Access Layer (DAL) App Logic Database View Web Service App Logic App Logic Trust Boundary](https://reader035.vdocuments.net/reader035/viewer/2022062404/551a74f5550346761a8b4ad6/html5/thumbnails/47.jpg)
Mini
Using RIA Services effectivelyDoo Require authentication / roleso Authenticate w/ https
o Utilize query compositiono Filter, sort, page
o Consider custom update
o Factor into multiple DomainService classes / libraries
o Handle errors on server
o Use declarative validation
Don’to Deploy with anon access
o Expose non-essential entities/ operations or allow free-form access to data
o Use a single large DomainService class
![Page 48: Data Access Layer (DAL) App Logic Database View Web Service App Logic App Logic Trust Boundary](https://reader035.vdocuments.net/reader035/viewer/2022062404/551a74f5550346761a8b4ad6/html5/thumbnails/48.jpg)
© 2010 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.
![Page 49: Data Access Layer (DAL) App Logic Database View Web Service App Logic App Logic Trust Boundary](https://reader035.vdocuments.net/reader035/viewer/2022062404/551a74f5550346761a8b4ad6/html5/thumbnails/49.jpg)
Demo Title
NameTitleGroup
DEMO
![Page 50: Data Access Layer (DAL) App Logic Database View Web Service App Logic App Logic Trust Boundary](https://reader035.vdocuments.net/reader035/viewer/2022062404/551a74f5550346761a8b4ad6/html5/thumbnails/50.jpg)
Slide for Showing Developer’s Software Code
o Use this layout to show software codeo The font is Consolas, a monospace fonto The slide doesn’t use bullets but levels can be indented
using the “Increase List Level” icon on the Home menu
![Page 51: Data Access Layer (DAL) App Logic Database View Web Service App Logic App Logic Trust Boundary](https://reader035.vdocuments.net/reader035/viewer/2022062404/551a74f5550346761a8b4ad6/html5/thumbnails/51.jpg)
Mini
PowerPoint Guidelines
o Font, size, and color for text have been formatted for you in the Slide Master
o This template uses Segoe UI, a standard Windows Vista and Office 2007 font
o Use the color palette shown below
Sample FillSample FillSample Fill
Sample FillSample FillSample Fill
![Page 52: Data Access Layer (DAL) App Logic Database View Web Service App Logic App Logic Trust Boundary](https://reader035.vdocuments.net/reader035/viewer/2022062404/551a74f5550346761a8b4ad6/html5/thumbnails/52.jpg)
Slide for Showing Developer’s Software Code
o Use this layout to show software codeo The font is Consolas, a monospace fonto The slide doesn’t use bullets but levels can be indented
using the “Increase List Level” icon on the Home menu
![Page 53: Data Access Layer (DAL) App Logic Database View Web Service App Logic App Logic Trust Boundary](https://reader035.vdocuments.net/reader035/viewer/2022062404/551a74f5550346761a8b4ad6/html5/thumbnails/53.jpg)
Demo Title
NameTitleGroup
DEMO
![Page 54: Data Access Layer (DAL) App Logic Database View Web Service App Logic App Logic Trust Boundary](https://reader035.vdocuments.net/reader035/viewer/2022062404/551a74f5550346761a8b4ad6/html5/thumbnails/54.jpg)
Video Title
VIDEO
![Page 55: Data Access Layer (DAL) App Logic Database View Web Service App Logic App Logic Trust Boundary](https://reader035.vdocuments.net/reader035/viewer/2022062404/551a74f5550346761a8b4ad6/html5/thumbnails/55.jpg)
Partner Title
NameTitleCompany
PARTNER
![Page 56: Data Access Layer (DAL) App Logic Database View Web Service App Logic App Logic Trust Boundary](https://reader035.vdocuments.net/reader035/viewer/2022062404/551a74f5550346761a8b4ad6/html5/thumbnails/56.jpg)
Customer Title
NameTitleCompany
CUSTOMER
![Page 57: Data Access Layer (DAL) App Logic Database View Web Service App Logic App Logic Trust Boundary](https://reader035.vdocuments.net/reader035/viewer/2022062404/551a74f5550346761a8b4ad6/html5/thumbnails/57.jpg)
Announcement Title
ANNOUNCING
![Page 58: Data Access Layer (DAL) App Logic Database View Web Service App Logic App Logic Trust Boundary](https://reader035.vdocuments.net/reader035/viewer/2022062404/551a74f5550346761a8b4ad6/html5/thumbnails/58.jpg)
Slide for Showing Developer’s Software CodeUse this layout to show software codeThe font is Consolas, a monospace fontThe slide doesn’t use bullets but levels can be indented using the “Increase List Level” icon on the Home menu