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.
6. Intro to Project Codename quot;Jasperquot; – Dynamic ADO.NET
Jasper Technical Walk-through
ASP.NET Development with the Jasper AutoDataSource
Extending Jasper Data Classes – Business Logic
Beyond Demo-ware: Jasper and Real-World Databases
7. Project goal
Enable rapid, iterative development of
data-serving applications
Target scenarios
Forms over data
Interactively exploring data with code
Jasper, AB
Key features
Data classes inferred at runtime
Automatic data binding
8. YES NO
Point at a database and
begin coding
Excessive configuration
One simple way to do
Heavyweight tools
things
Generated source files
Works with real-world
databases
9. CTP available today
http://msdn2.microsoft.com/data/bb419139.aspx ADO.NET
Team
We're here to get your feedback
Jasper
Jasper is an incubation project Design ASP.NET
VB Team
Team
Team
CLR
Team
10. Jasper provides a programming interface to your data
API surface tailored for dynamic language development
Data Access and Data Binding
Without generated source code or complex configuration
Query Object API
Jasper
Update UI Binding
11. O/R Framework + API ASP.NET WinForms/WPF
AutoDataSource AutoBinder
Data classes inferred at runtime
Automatic UI Binding Jasper API
ASP.NET AutoDataSource
Runtime Data Class
AutoBinder for WinForms/WPF Generator
Built on ADO.NET Entity Framework ADO.NET Entity
Framework
Rich Mapping Engine
Entity SQL Query Pipeline
.NET Data Providers
12. ADO.NET Capabilities EDM Concepts
• Provides a higher level
• .NET Object API for manipulating data
abstraction for data in the store
in a store
• Mapping engine constructs Entities and
Relationships from tables and keys • Successor to the core relational
data model
• eSQL and LINQ Query Pipeline
• Providers to various database stores
• Adds formal relationships,
• Management of metadata for flexible
inheritance, and composition
deployment
13. DynamicContext Class
Configured with a connection string
Serves as an overall context for the database
Exposes properties corresponding to the database tables
Does change tracking and identity resolution
Dim connectionString As String = quot;...quot;
Dim context
context = DynamicContext.CreateDynamicContext(connectionString)
...context.Stories ... context.Submitters etc...
14. Query class
Provides 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 results
results = My.DynamicContext.ExecuteDirectQuery(quot;SELECT VALUE s
FROM DataAccessCityModel.Stories As squot;)
'Entity SQL Query with query-builder methods
storiesQuery = My.DynamicContext.Stories.Where(quot;it.Topic.TopicId = @TopicId quot;, _
New ObjectParameter() {New ObjectParameter(quot;TopicIdquot;, topicId)})
15. Data Classes
Represent the entities in the database
Reflect database schema by default
DynamicContext creates data classes at runtime
Usable at compile-time via late binding
Builds an Entity Data Model with relationships from Database
Schema
Infers classes from Entity Data Model
Bottle Winery
Supplier
Database Schema Data Classes
Entity Data Model
16. AutoDataSource component
A data source control that uses Jasper for data access
Automatically configures data binding of web controls
Naming conventions determine bindings
Can bind contols to
Entity Sets
Relationship navigation properties
Arbirtrary queries
Supports read and write (insert, update, delete) operations
17. Creating the AutoDataSource: Markup
<jasper:AutoDataSource ID=quot;AutoDataSource1quot; runat=quot;serverquot; />
Creating the DynamicContext: Code-behind
Dim connectionString As String = quot;...quot;
Dim context
context = DynamicContext.CreateDynamicContext(connectionString)
Creating the data-bound controls: Markup
<asp:ListBox ID=quot;CategoryNamequot; runat=quot;server” />
…
<asp:DetailsView ID=quot;Categories_Productsquot; runat=quot;serverquot; … />
19. Implement GetProperty and SetProperty methods
Naming convention: data class generator makes property getters/setters call
these methods
Access to all data class properties
Public 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(quot; quot;)
Return desc.Substring(0, i + 1) + quot;...quot;
End If
Return desc
End Function
End Class
20. How do we expose type information at design time?
Requires extension of current IntelliSense system.
We are working with language teams on this!
22. Dynamic Data Classes
Custom Data
Default Data Model
Model
Define Custom
No Customize
Data Model and
Customization Naming Service
Mapping
Simple Database Simple Database Complex Database
with Unconventional Names
23. Supports custom naming conventions and pluralization
rules
Dim ns As NameService = New NameService()
ns.BaseNameService = NameService.Default
ns.ClassNameMap.AddNameMapping(quot;P2NWEMPquot;, quot;Employeesquot;)
ns.ClassNameMap.AddPrefixMapping(quot;avw_quot;)
ns.ClassNameMap.AddNameRegexMapping(quot;Empzquot;, quot;Employeequot;)
Dim context =
DynamicContext.CreateDynamicContext(connectionString, ns)
24. Rich ADO.NET Entity Framework Mapping Engine
supports:
Renaming
De-normalization
Horizontal and vertical partitioning
Stored-procedure access
Jasper API can be used over any mappable Entity Data
Model
27. 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 applications
http://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/