390 likes | 535 Views
SQL Modeling Services M. Robert Hogg. FBCS, CEng Senior Architect Black Marble LTD. The “Oslo” Back Story. “Oslo” 2007: Multi-year, Multi-product vision. “Oslo” 2008: Modeling Platform. “Oslo” 2009: SQL Server Modeling. A LAP AROUND Modelin G. A DESCRIPTION OF A GIVEN DOMAIN.
E N D
Robert Hogg FBCS, CEng Senior Architect Black Marble LTD
A DESCRIPTION OF A GIVEN DOMAIN What is a Model? DRAWINGS Models used to communicate with others Examples: Dataflow, Use Case, … MODEL-ASSISTED Models used to understand or manipulate code Examples: Static Structure, Sequence, … MODEL-DRIVEN Models executed by runtimes directly Examples: HTML, CSS, XAML, BPEL, …
Model-driven Platform DECLARATIVE CONTENT .NET 3.0 wpf:ContentControl wf:StateMachine Web Services xsd:schema wsdl:definitions .NET 1.0 app.config [YourAttributeHere] COM (+) [Transaction] midl.exe TIME
Model-driven Applications Textual domain specific language (CAML) Visual designer (SharePoint Designer) Application definition stored in database Textual domain specific language (X++) Visual designer (MorphX) Application definition stored in database
Why is this happening? TRANSPARENCY Better understanding of your application FLEXIBLITY Faster changes to your application PRODUCTIVITY “More essence, less ceremony”
Data and Modeling Visual Studio “Quadrant” Entity Framework Data Services ADO.NET “M”/EDM SQL Azure SQL Server … SQL Server Modeling Services
THE PLATFORM FOR MODEL-DRIVEN APPLICATIONS What is "SMS"? “M” Modelling language “Quadrant” Modelling tool SQL Server Modeling Services Model store
Key "SMS" Concepts TEXTUALDSLs VISUAL DSLs MODELS RUNTIMES
"SMS" Architecture “QUADRANT” RUNTIMES [Your Textual DSL] [Your Visual DSL] EDITOR FRAMEWORK LANGUAGE FRAMEWORK Composition [Your Runtime] Generic Viewers MSchema “Dublin” Dataflow MGrammar ASP.NET MGraph XML, Custom Formats, … WF WCF REPOSITORY SQL SERVER REPOSITORY SQL SERVER SQL/EDM ADO .NET Windows Other ISV Runtimes REPOSITORY SQL SERVER [Your Models] [Your Models] Base Models Base Models [Your Models] OTHER TOOLS (VSTS, EXCEL, …) XML, Custom Formats, … “M” Runtime “M” Runtime .Net Models Repository Models
Repository Capabilities • Repository features are built on SQL Server • Repository install also turns on useful features, e.g. replication and mirroring Repository catalog, secure views, auditing,versioning, claims-based security, glob/loc, etc. Repository Features system catalog, Change Data Capture,replication, SSIS, mirroring, security, etc. SQL Server Features
What is "Quadrant"? • Graphical tool used for managing instance models • Targeted at architects and business analysts • Loads model definitions from repository database • Allows management of instances • Changes are saved to database immediately
SERVICES SHELL AND SURFACE COMPOSITION ENGINE Nesting Sizing Layout Snapping "Quadrant" Architecture Core Services Undo/Redo Commands Drag/Drop Selection Activation Error Handling General Services Search Validation Annotations Relationship Highlighting DATAFLOW ENGINE Caching, Virtualization, Change tracking, and Notification Target Data View State Configuration REPOSITORY
Why “M”? • Interacting with Oslo content needs to be simple and natural • Textural based modelling language
What Is “M”? • “M” is a language for defining domain models and textual domain-specific languages (DSLs) • M domain models define schema and query over structured data • Values, Constraints, and Views • Natural projection to SQL • M DSLs define projections from Unicode text to structured data • Rule-based transformation • Grammar-driven text editor integration
codename “m”: a language for data “M” T-SQL Specification Grammar Specification EDMX Specification
The "M" Language DSL DSLX DSLY Point.m Domain Model DomainX.m Domain Model DomainY.m Domain Model PointLanguage.mg Domain Grammar DomainX.mg Domain Grammar DomainY.mg Domain Grammar "M" Domain-specific data models • type Point { • X : Integer; • Y : Integer; • } MSchema Domain-specific grammars • language PointLanguage { • syntax Main = h:Integer "," v:Integer • => Point { X { h }, Y { v }};} MGrammar Abstract data model • Point { X { 100 }, Y { 200 } } MGraph
// Module: Used to scope model definitions moduleTest.TimeReport { // Type: Defines employee data structure type Employee { Id : Integer32 FirstName : Text wherevalue.Count <= 100; LastName : Text wherevalue.Count <= 100; } // Extent: Contains zero or more employees Employees : Employee*; } “M” Language Example • MSchema is used to model data structures, storage, views and constraints
Using “M” to Model a Database // Module: Used to scope model definitions module Test.TimeReport { // Type: Defines employee data structure type Employee { FirstName : Text where value.Count <= 100; LastName : Text where value.Count <= 100; } // Extent: Contains zero or more employees Employees : Employee*; } • create table • [Test.TimeReport].[Employees] • ( • [FirstName] nvarchar(100) not null, • [LastName] nvarchar(100) not null, • ); • go • Once they’re in the database, it’s just SQL • “TSQL can be used to create repository structure or standard database structure • Repository TSQL is more complex Compile
Your Models “M” Code Microsoft.Uml2 “M” Command-Line Tools System_Runtime BDL System.Identity Modeling Services Database
What “M” Is Not • An object-oriented language • No polymorphism, virtual dispatch • “Is-a” determined based on structural subtyping, not stipulation • A data access technology • M domain models compile down to T-SQL • Tool chain supports course-grained loading/unloading of schemas and values – not an OLTP solution • A replacement for T-SQL • Far less expansive feature set • Tool chain supports linking/invoking T-SQL
IntelliPad Editing Tool • Simple text based code editor • Supports “M” languages • Provides instant feedback of code compilation • Great for learning “M” languages • Visual Studio can also be used for “M” • Most likely scenario in real projects
IntelliPad Editing Tool Modelling data in IntelliPad TSQL code is created instantly
Bits • http://msdn.com/data • SDK Download • SDK Contains • Repository database • “M” modelling language (MSchema, MGrammer) • IntelliPad editor • N • Community • BoggersGuides.net • Use “Oslo” today • Use “M” to model a database! • MGrammar • Language for creating textual DSLs • Specification will be released under OSP
P/X001 How to Get Full Access to a Database Backup in 3 Minutes or Less Idera P/L001 End-to-end database development has arrived Red Gate P/L002 Weird, Deformed, and Grotesque –Horrors Stories from the World of IT Quest P/L005 Expert Query Analysis with SQL Sentry SQLSentry P/T007 Attunity Change Data Capture for SSIS Attunity Coming up… • #SQLBITS