Post on 19-Dec-2015
transcript
“Oslo”: Repository & Models
Martin GudginProgram ManagerMicrosoft Corporation
Chris SellsProgram ManagerMicrosoft Corporation
TL28
What Is "Oslo"?The platform for model-driven applications
“M”Modeling language
Visual Studio “Quadrant”Modeling tool
RepositoryModel store
YOU ARE HERE
A Repository Database
Optimized for storing and sharing models designed for extensibility allows for query, linkage,
impact assessment across models
supports common tasks such as versioning, access control
extensible metadata - enables rich tooling
Includes end-to-end system / lifecycle models out of the box models design-time, run-time
‘Natural’ SQL Server database approach leverages
database ecosystem: tools, reporting, BI, etc
Repository Family of Platform Stores
Message Box
Platform Instance Data
Modeling Language
Monitoring Data
WorkItems
VersionedSourceApplication
Metadata
Repository features are built on SQL Server Repository install also turns on useful features,
e.g. replication and mirroring
Repository Capabilities
system catalog, Change Data Capture,replication, SSIS, mirroring, security, etc.
SQL ServerFeatures
Repository catalog, secure views, auditing,versioning, claims-based security, glob/loc, etc.
RepositoryFeatures
"Oslo" Models
Identity System.Identity
Application System.Runtime System.Application Document
ServiceModel System.ServiceModel
Transactions System.Transactions
WorkflowModel System.WorkflowModel System.WorkflowModel.Activities
WorkflowServiceModel System.WorkflowServiceModel System.WorkflowServiceModel.Activities
Messaging System.Messsaging.Adapters
Security System.Security
Management System.Management.Commands System.Management.Environment System.Management.Lifecycle System.Management.Localization
Hosting Microsoft.Management.Environment Microsoft.Management.Environment.Was
Language Language.Schema
Repository Item Microsoft.Repository System.Globalization
CORE
The Oslo SDK provides tools to: Define new models: Intellipad, Visual Studio
language services Compile models: m.exe, msbuild build tasks Deploy models: mx.exe
Once they’re in the database, it’s just SQL
Adding Your Models To The Repository
M Tool Chain
M.exeDomain Model
Compiler
MX.exeDomain Model
Loader
ModelA.mModelB.m
ModelC.m ModelABC.mx
SQLServer
M Framework
M Framework
Compiling M
M Compiler: m.exe Oslo SDK: C:\Program Files\Microsoft Olso SDK
1.0\bin\m.exe MCompile element of msbuild project file
VS project template installed with SDK
Compiling M: Command Line
// trivial.m
module MyModule {
type Person {
Name : Text;
Age : Text { 42 } // Mismatched type
}
}C:\>m.exe trivial.m Syntax and type
check...C:\trivial.m(5,18): error M0152: Type error
Literal '42' cannot be converted to type 'Text'.
Generating SQL from M: Command Line
Getting started generating “rich” SQL Use /target option of m.exe (/t) Rich SQL: targeted at a repository database (/t:repository)
Enables security and versioning support via views Reach SQL: targeted at any SQL Server database (/t:tsql10)
10
C:\>m.exe /t:repository orderitem.m
// orderitem.mmodule MyModule { type OrderItem { Id : Integer32 =
AutoNumber(); Description : Text; Quantity : Integer32; } where identity Id; OrderItems : OrderItem*;}
...create table [MyModule].
[OrderItemsTable]( [Id] int not null identity, [Description] nvarchar(max) not
null, [Quantity] int not null, constraint [PK_OrderItems] primary
key clustered ([Id]));...
orderitem.sql:
Compiling M: Visual Studio
Generating SQL From M: msbuild<Project ...>
<PropertyGroup>
<MTarget>Repository</MTarget>
<MPackageScript>true</MPackageScript>
<MPackageImage>true</MPackageImage>
<MTargetsPath Condition="$(MTargetsPath) == ''">$(MSBuildExtensionsPath)\Microsoft\M\v1.0</MTargetsPath>
...
</PropertyGroup>
<ItemGroup><Compile Include="Model.m" /></ItemGroup>
<Import Project="$(MTargetsPath)\MProject.targets" />
</Project>
12
c:\Project2>msbuild project2.csproj...Build started 2/4/2008 11:14:02 AM.Project "c:\Project2\project2.csproj" on node 0 (default
targets). Running M Compiler ......c:\Project2> dir bin\debug\orderitem.sql...02/05/2008 01:22 PM 882 orderitem.sql
Packaging Generated SQL
m.exe can create “image” files Can deploy to the Repository at some future date Can use as references for other types Use /package (/p) option to m.exe Generated .mx file is Open Packaging Conventions (OPC)
format
C:\>m.exe /t:repository /p:image size.mC:\>dir size.mx...08/24/2008 01:14 PM 62,612 size.mx
Referencing M Image Files
Can reference exported types from an image file Use /reference (/r) option of m.exe Repository ships with the models as an image file
c:\Program Files\Microsoft Repository\Models.mx
C:\>m.exe /t:repository /p:image person.m /r:size.mxC:\>dir person.mx...08/24/2008 01:17 PM 9,675 person.mx
Extending the Repository
Demo
Data Access Options
You can program against the generated SQL with whatever data access technology makes you happy, e.g. sqlcmd.exe ADO.NET LINQ to SQL Entity Framework Access Excel ODBC OLEDB EIEIO…
Data Access to Repository
Demo
Core Services
Deployment Catalog Security Versioning
Deployment
mx.exe packages SQL for deployment to Repository nodes Packages can come from M files Packages can be exported from
Repository nodes Application model can be used to define
applications to be deployed E.g. define a web service in the Repository and
deploy it without writing a line of code
SQL Server has a catalog List of tables, views, stored procs, etc. and the
relationships between them Repository has its own catalog
Extends SQL Server catalog Adds information about relationships modules,
types and extends Useful for
Rich export Impact analysis Enriched SQL data access code generation …
The Catalog
Security
Security is claims-based Identity becomes just one of several
possible claims Claims presented to authorize operations
against resources Repository tables keep track of claims,
resources and operations Triggers implemented on /t:Repository-
generated views to check claims Views protect against direct access to tables
Domain-specific security containers Use “folders” to partition data Apps decide which data goes into what folder Security checks happen on folder boundaries Must call the field “Folder” for
compiler to find it Folder ID must exist in the Item.Folders table
Security (2)
module Entertainment { type Movies { ... Folder:Integer32; // G, PG, R,
etc. }}
Data change synchronization Between nodes using SQL Server Replication
and Occasionally Connected Systems (OCS) Import/Export using SQL Server Change
Tracking, e.g. repository<->file system Schema evolution
Extend M type and provide backwards compat for old clients w/ computed values
SQL Server Integration Services for data migration
Versioning
Example: Schema Evolution// friendships.mmodule Microsoft.PDC { import System.Identity; type Friendship { Id : Integer32 =
AutoNumber(); ContextParty : Party; ReferencedParty : Party; } where identity Id; Friendships : Friendship* where item.ContextParty in Parties, item.ReferencedParty in
Parties;}
// friendships.mmodule Microsoft.PDC { ... type Friendship2 : Friendship { // default for old (and new)
clients LoveIndex : Integer32 = 5; } Friendships2 : Friendship2* where item.ContextParty in Parties, item.ReferencedParty in Parties;
// updateable view Friendships() : Friendship* { from f in Friendships2 select f }}
Repository Services
Demo
Repository is optimized for many reads, few writes
Contains models for “Oslo” app domains Can be extended with M Models can be deployed, secured
and versioned
Where Are We?
"M" Language Specification to be released under OSP
AnnouncingPublic "Oslo" SDK CTPhttp://msdn.microsoft.com/oslo
Call To Action
Use the bitshttp://msdn.microsoft.com/oslo
Read these documentsRepository Design OverviewRepository Lifecycle Overview
Go see the other talksA Lap Around “Oslo”“Oslo”: The Language“Oslo”: Customizing and Extending the Visual Design Experience“Oslo”: Building Textual DSLs
Evals & Recordings
Please fill
out your
evaluation for
this session at:
This session will be available as a recording at:
www.microsoftpdc.com
Please use the microphones provided
Q&A
© 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.