Upload
goodfriday
View
1.796
Download
1
Tags:
Embed Size (px)
DESCRIPTION
Come learn about how new technologies from Microsoft bring together the concepts of dynamic languages and ADO.NET and allow you to quickly develop data driven Web pages using ASP.NET dynamic data controls, scalable to even the most complex databases.
Citation preview
DEV 18 - Rapidly Building Data-Driven Web Pages with Dynamic ADO.NET
Sam DrukerProduct Unit ManagerData Progammability
Shyam PatherDevelopment LeadData Programmability
Quick Rapid Clean Instant Gratification Easy
Iterative Intuitive
How fast can I build a data-driven web app?
• Hierarchical data binding• Insert/Update/Delete• No generated code• No configuration
challenge
Jasper National Park
Dynamic ADO.NET in Action
Shyam PatherDevelopment LeadData Programmability
demo
Crowfoot GlacierIcefields Parkway, near Jasper
National Park
Agenda
Intro to Project Codename "Jasper" – Dynamic ADO.NETJasper Technical Walk-throughASP.NET Development with the Jasper AutoDataSourceExtending Jasper Data Classes – Business LogicBeyond Demo-ware: Jasper and Real-World Databases
Project Codename "Jasper"
Project goalEnable rapid, iterative development of data-serving applications
Target scenariosForms over dataInteractively exploring data with code
Key featuresData classes inferred at runtimeAutomatic data binding
Jasper, AB
Jasper Development Experience
Point at a database and begin coding
One simple way to do things
Works with real-world databases
Excessive configuration
Heavyweight tools
Generated source files
YES NO
Jasper Project Status
CTP available todayhttp://msdn2.microsoft.com/data/bb419139.aspx
We're here to get your feedbackJasper is an incubation project Jasper
Design Team
ADO.NET Team
ASP.NET Team
CLR Team
VB Team
Jasper Technical Overview
Jasper provides a programming interface to your data
API surface tailored for dynamic language development
Data Access and Data BindingWithout generated source code or complex configuration
JasperQuery
Update
Object API
UI Binding
Jasper Components
O/R Framework + APIData classes inferred at runtime
Automatic UI BindingASP.NET AutoDataSourceAutoBinder for WinForms/WPF
Built on ADO.NET Entity Framework
Rich Mapping EngineEntity SQL Query Pipeline.NET Data Providers
Jasper API
Runtime Data Class Generator
ADO.NET Entity Framework
ASP.NET AutoDataSour
ce
WinForms/WPFAutoBinde
r
ADO.NET Entity FrameworkADO.NET Capabilities
• .NET Object API for manipulating data in a store
• Mapping engine constructs Entities and Relationships from tables and keys
• eSQL and LINQ Query Pipeline
• Providers to various database stores
• Management of metadata for flexible deployment
EDM Concepts
• Provides a higher level abstraction for data in the store
• Successor to the core relational data model
• Adds formal relationships, inheritance, and composition
Jasper API – DynamicContext Class
DynamicContext ClassConfigured with a connection stringServes as an overall context for the databaseExposes properties corresponding to the database tablesDoes change tracking and identity resolution
Dim connectionString As String = "..." Dim contextcontext = DynamicContext.CreateDynamicContext(connectionString)
...context.Stories ... context.Submitters etc...
Jasper API – Querying
Query classProvides Entity SQL and LINQ query capabilities
'LINQ Query storiesQuery = From t In CType(My.DynamicContext.Tags, IQuery) _ Where t.TagName = tag _ Select t.Story _ Distinct
'Direct Entity SQL Query
Dim resultsresults = My.DynamicContext.ExecuteDirectQuery("SELECT VALUE s FROM DataAccessCityModel.Stories As s")'Entity SQL Query with query-builder methods
storiesQuery = My.DynamicContext.Stories.Where("it.Topic.TopicId = @TopicId ", _New ObjectParameter() {New ObjectParameter("TopicId", topicId)})
Jasper API – Data ClassesData Classes
Represent the entities in the database
Reflect database schema by default
DynamicContext creates data classes at runtimeUsable at compile-time via late binding
Builds an Entity Data Model with relationships from Database Schema
Infers classes from Entity Data Model
Data Classes
Bottle Winery
Supplier
Database Schema Entity Data Model
Using Jasper with ASP.NET
AutoDataSource componentA data source control that uses Jasper for data accessAutomatically configures data binding of web controls
Naming conventions determine bindings
Can bind contols toEntity SetsRelationship navigation propertiesArbirtrary queries
Supports read and write (insert, update, delete) operations
Jasper ASP.NET Code Snippets
<jasper:AutoDataSource ID="AutoDataSource1" runat="server" />
<asp:ListBox ID="CategoryName" runat="server” />…<asp:DetailsView ID="Categories_Products" runat="server" … />
Dim connectionString As String = "..." Dim contextcontext = DynamicContext.CreateDynamicContext(connectionString)
Creating the AutoDataSource: Markup
Creating the DynamicContext: Code-behind
Creating the data-bound controls: Markup
Implementing Business Logic on Jasper Data ClassesShyam PatherDevelopment LeadData Programmability
demo
Horned Sheep at Miette Hot Springs (near Jasper,
AB)
Implementing Business LogicImplement GetProperty and SetProperty methods
Naming convention: data class generator makes property getters/setters call these methods
Access to all data class propertiesPublic Class Story Public Function SetDescription(ByVal desc As String) As String 'Truncate the description if too long If desc.Length > 200 Then Dim i = desc.LastIndexOf(" ") Return desc.Substring(0, i + 1) + "..." End If Return desc End FunctionEnd Class
IntelliSense Support for Jasper
How do we expose type information at design time?Requires extension of current IntelliSense system.We are working with language teams on this!
Beyond Demo-ware: Jasper and Real-World DatabasesShyam PatherDevelopment LeadData Programmability
demo
Athabasca Falls (Jasper National Park)
Customization with Jasper
Simple Database Simple Database with Unconventional Names
Complex Database
No Customization
CustomizeNaming Service
Define Custom Data Model and
Mapping
Default Data ModelCustom Data
Model
Dynamic Data Classes
Naming Service Customization
Supports custom naming conventions and pluralization rules
Dim ns As NameService = New NameService()ns.BaseNameService = NameService.Default ns.ClassNameMap.AddNameMapping("P2NWEMP", "Employees")ns.ClassNameMap.AddPrefixMapping("avw_")ns.ClassNameMap.AddNameRegexMapping("Emp\\z", "Employee") Dim context = DynamicContext.CreateDynamicContext(connectionString, ns)
Using a Custom EDM and Mapping
Rich ADO.NET Entity Framework Mapping Engine supports:
RenamingDe-normalizationHorizontal and vertical partitioningStored-procedure access
Jasper API can be used over any mappable Entity Data Model
Entity Model Designer Tools
video
Pyramid Lake (Jasper National Park)
What Next?
We are planning a second CTP before the end of '07
Try out Jasper in the Mix Sandbox
Download Jasper and try it with your own applicationshttp://msdn2.microsoft.com/data/bb419139.aspx
Please give us feedback!Jasper Forum: http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=1556&SiteID=1
Andy Conrad’s blog: http://blogs.msdn.com/aconrad/
Shyam Pather’s blog: http://pather.net/shyam/
Carl Perry’s blog: http://blogs.msdn.com/cperry/
ADO.NET Team blog: http://blogs.msdn.com/adonet/
Please fill out your eval
evaluation
© 2007 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.