DAT305 Boost Your Data-Driven Application Development Using SQL Server Centric.NET Code Generator...

57
DAT305 Boost Your Data-Driven Application Development Using SQL Server Centric .NET Code Generator Pascal Belaud Microsoft France

Transcript of DAT305 Boost Your Data-Driven Application Development Using SQL Server Centric.NET Code Generator...

Page 1: DAT305 Boost Your Data-Driven Application Development Using SQL Server Centric.NET Code Generator Pascal Belaud Microsoft France.

DAT305Boost Your Data-Driven Application Development Using SQL Server Centric .NET Code Generator

Pascal BelaudMicrosoft France

Page 2: DAT305 Boost Your Data-Driven Application Development Using SQL Server Centric.NET Code Generator Pascal Belaud Microsoft France.

Questions & evaluation Form

Please keep all your questions for the end of this session or after this session

Thanks to fill out the evaluation form (you have only one hour after the session to do so) and WIN A POCKET PC

It helps us improve our session content and delivery

Page 3: DAT305 Boost Your Data-Driven Application Development Using SQL Server Centric.NET Code Generator Pascal Belaud Microsoft France.

Agenda

Overview

Setup

Reuse built-in templates

Write custom templates

Page 4: DAT305 Boost Your Data-Driven Application Development Using SQL Server Centric.NET Code Generator Pascal Belaud Microsoft France.

Resources

Web Sitehttp://www.microsoft.com/france/msdn/olymars

Send feedback [email protected]

Free but NOT SUPPORTED

Page 5: DAT305 Boost Your Data-Driven Application Development Using SQL Server Centric.NET Code Generator Pascal Belaud Microsoft France.

Agenda

Overview

Setup

Reuse built-in templates

Write custom templates

Page 6: DAT305 Boost Your Data-Driven Application Development Using SQL Server Centric.NET Code Generator Pascal Belaud Microsoft France.

OverviewOlyMars stands for

Olympique de Marseille

SQL Server Centric .NET Code Generator is the marketing name

Project started in Mars 2001

Help you switch more quickly and more easily to SQL Server 2000 and .NET

Page 7: DAT305 Boost Your Data-Driven Application Development Using SQL Server Centric.NET Code Generator Pascal Belaud Microsoft France.

Overview

OlyMars was developed on .NET (C#)

Two ways of considering this toolComes with 200+ built-in templates

Supplies a framework for intensive code generation

Relies on a SQL Server 2000 database

Was built using itself!56% of the tool code was generated(168,288 total lines – 94,313 generated lines)

Page 8: DAT305 Boost Your Data-Driven Application Development Using SQL Server Centric.NET Code Generator Pascal Belaud Microsoft France.

Agenda

Overview

Setup

Reuse built-in templates

Write custom templates

Page 9: DAT305 Boost Your Data-Driven Application Development Using SQL Server Centric.NET Code Generator Pascal Belaud Microsoft France.

OlyMars Setup

demodemo

Page 10: DAT305 Boost Your Data-Driven Application Development Using SQL Server Centric.NET Code Generator Pascal Belaud Microsoft France.

Agenda

Overview

Setup

Reuse built-in templates

Write custom templates

Page 11: DAT305 Boost Your Data-Driven Application Development Using SQL Server Centric.NET Code Generator Pascal Belaud Microsoft France.

DatabaseDatabase

What do we need next?What do we need next?

Stored procedures…Stored procedures…

Table1Table1

Table2Table2

Table3Table3

Table4Table4

Written by handWritten by hand

Page 12: DAT305 Boost Your Data-Driven Application Development Using SQL Server Centric.NET Code Generator Pascal Belaud Microsoft France.

Stored proceduresStored procedures

DatabaseDatabase

InsertInsert

UpdateUpdate

DeleteDelete

SelectSelect

GeneratedGenerated

Custom1Custom1

Custom2Custom2

Custom3Custom3

Written by handWritten by hand

Table1Table1

Page 13: DAT305 Boost Your Data-Driven Application Development Using SQL Server Centric.NET Code Generator Pascal Belaud Microsoft France.

Stored Procedures Generation

demodemo

Page 14: DAT305 Boost Your Data-Driven Application Development Using SQL Server Centric.NET Code Generator Pascal Belaud Microsoft France.

Stored proceduresStored procedures

DatabaseDatabase

What do weWhat do we need next?need next?

ADO .NET classesADO .NET classesable to call our able to call our stored proceduresstored procedures

InsertInsert

UpdateUpdate

DeleteDelete

SelectSelect

GeneratedGenerated

Custom1Custom1

Custom2Custom2

Custom3Custom3

Written by handWritten by hand

Table1Table1

Page 15: DAT305 Boost Your Data-Driven Application Development Using SQL Server Centric.NET Code Generator Pascal Belaud Microsoft France.

ADO .NET Code Generation

demodemo

Page 16: DAT305 Boost Your Data-Driven Application Development Using SQL Server Centric.NET Code Generator Pascal Belaud Microsoft France.

DataDataClassesClasses

DatabaseDatabase

What do we need next?What do we need next?

Windows and WebWindows and Webcontrols dedicatedcontrols dedicatedto our tablesto our tables

GeneratedGenerated

Written by handWritten by hand

Page 17: DAT305 Boost Your Data-Driven Application Development Using SQL Server Centric.NET Code Generator Pascal Belaud Microsoft France.

Web controlsWeb controls

Windows controlsWindows controls

DatabaseDatabase

Table1Table1

ComboBoxComboBoxListBoxListBox

CheckedListBoxCheckedListBox

DataGridDataGrid

ListBoxListBox

DropDownListDropDownList

CheckBoxListCheckBoxListDataGridDataGrid

RepeaterRepeater

DataListDataList

GeneratedGenerated

Written by handWritten by hand

Page 18: DAT305 Boost Your Data-Driven Application Development Using SQL Server Centric.NET Code Generator Pascal Belaud Microsoft France.

Web controlsWeb controls

Windows controlsWindows controls

DatabaseDatabase

ComboBoxComboBoxListBoxListBox

CheckedListBoxCheckedListBox

DataGridDataGrid

ListBoxListBox

DropDownListDropDownList

CheckBoxListCheckBoxListDataGridDataGrid

RepeaterRepeater

DataListDataList

GeneratedGenerated

Written by handWritten by hand

SPSP

If it returnsIf it returnsdatadata

Page 19: DAT305 Boost Your Data-Driven Application Development Using SQL Server Centric.NET Code Generator Pascal Belaud Microsoft France.

Web FormsWeb Forms

Windows FormsWindows Forms

DatabaseDatabase

Table1Table1

FormForm

PagePage

GeneratedGenerated

Written by handWritten by hand

SampleSampleApplicationApplication

Page 20: DAT305 Boost Your Data-Driven Application Development Using SQL Server Centric.NET Code Generator Pascal Belaud Microsoft France.

Whole Generation Using Batch Mode

demodemo

Page 21: DAT305 Boost Your Data-Driven Application Development Using SQL Server Centric.NET Code Generator Pascal Belaud Microsoft France.

Templates Supplied As Add-On

Business Components

TreeView Factory

XML Web Services

Object Space style

.NET Compact Framework

Page 22: DAT305 Boost Your Data-Driven Application Development Using SQL Server Centric.NET Code Generator Pascal Belaud Microsoft France.

How to import and use an add-on

demodemo

Page 23: DAT305 Boost Your Data-Driven Application Development Using SQL Server Centric.NET Code Generator Pascal Belaud Microsoft France.

Templates Supplied As Add-On

Business Components

TreeView Factory

XML Web Services

Object Space style

.NET Compact Framework

Page 24: DAT305 Boost Your Data-Driven Application Development Using SQL Server Centric.NET Code Generator Pascal Belaud Microsoft France.

Business Components

Page 25: DAT305 Boost Your Data-Driven Application Development Using SQL Server Centric.NET Code Generator Pascal Belaud Microsoft France.

Business ComponentsBrowsing a collection of products:

Updating an existing product

Page 26: DAT305 Boost Your Data-Driven Application Development Using SQL Server Centric.NET Code Generator Pascal Belaud Microsoft France.

Business ComponentsAdding a new product:

Deleting an existing product

Page 27: DAT305 Boost Your Data-Driven Application Development Using SQL Server Centric.NET Code Generator Pascal Belaud Microsoft France.

Templates Supplied As Add-On

Business Components

TreeView Factory

XML Web Services

Object Space style

.NET Compact Framework

Page 28: DAT305 Boost Your Data-Driven Application Development Using SQL Server Centric.NET Code Generator Pascal Belaud Microsoft France.

TreeView Factory

Page 29: DAT305 Boost Your Data-Driven Application Development Using SQL Server Centric.NET Code Generator Pascal Belaud Microsoft France.

Templates Supplied As Add-On

Business Components

TreeView Factory

XML Web Services

Object Space style

.NET Compact Framework

Page 30: DAT305 Boost Your Data-Driven Application Development Using SQL Server Centric.NET Code Generator Pascal Belaud Microsoft France.

.NET Compact Framework

SQLCESQLCE

SQL ServerSQL Server

OlyMarsOlyMars

System.DataSystem.Data.SqlClient.SqlClient

System.DataSystem.Data.SqlServerCe.SqlServerCe

Page 31: DAT305 Boost Your Data-Driven Application Development Using SQL Server Centric.NET Code Generator Pascal Belaud Microsoft France.

Add-On:.NET Compact Framework

demodemo

Page 32: DAT305 Boost Your Data-Driven Application Development Using SQL Server Centric.NET Code Generator Pascal Belaud Microsoft France.

.NET Compact Framework

SQLCESQLCE

SQL ServerSQL Server

OlyMarsOlyMars

SPsSPs

SQL statementsSQL statements

Single point ofSingle point ofmanagementmanagement

Tables

Tables

Page 33: DAT305 Boost Your Data-Driven Application Development Using SQL Server Centric.NET Code Generator Pascal Belaud Microsoft France.

Agenda

Overview

Setup

Reuse built-in templates

Write custom templates

Page 34: DAT305 Boost Your Data-Driven Application Development Using SQL Server Centric.NET Code Generator Pascal Belaud Microsoft France.

Write Custom Templates

Allow you to extend the tool

You can reuse part or none of the built-in templates and write your own

Can reflect more accurately your internal development guidelines

Page 35: DAT305 Boost Your Data-Driven Application Development Using SQL Server Centric.NET Code Generator Pascal Belaud Microsoft France.

IEIE ASP pageASP page

IISIIS

HTMLHTMLcontentcontent

Page 36: DAT305 Boost Your Data-Driven Application Development Using SQL Server Centric.NET Code Generator Pascal Belaud Microsoft France.

IEIE ASP pageASP page

IISIIS

HTMLHTMLcontentcontent

OlyMarsOlyMars

TemplateTemplate

CodeCode

YouYou

SQLSQL

FileFile

Page 37: DAT305 Boost Your Data-Driven Application Development Using SQL Server Centric.NET Code Generator Pascal Belaud Microsoft France.

OlyMarsOlyMars

RepositoryRepository

ConnectionConnectionto the repositoryto the repository

Page 38: DAT305 Boost Your Data-Driven Application Development Using SQL Server Centric.NET Code Generator Pascal Belaud Microsoft France.

OlyMarsOlyMars

RepositoryRepository

Working DBWorking DB

Connection andConnection andanalysis of youranalysis of your

working databaseworking database

Page 39: DAT305 Boost Your Data-Driven Application Development Using SQL Server Centric.NET Code Generator Pascal Belaud Microsoft France.

OlyMarsOlyMars

RepositoryRepository In memoryIn memoryrepresentation ofrepresentation of

working DBworking DB

Working DBWorking DB

Once analyzed, a in-memoryOnce analyzed, a in-memoryrepresentation of the databaserepresentation of the database

is createdis created

Page 40: DAT305 Boost Your Data-Driven Application Development Using SQL Server Centric.NET Code Generator Pascal Belaud Microsoft France.

OlyMarsOlyMars TemplatesTemplates

RepositoryRepository In memoryIn memoryrepresentation ofrepresentation of

working DBworking DB

Working DBWorking DB

Templates are loadedTemplates are loadedin memoryin memory

Page 41: DAT305 Boost Your Data-Driven Application Development Using SQL Server Centric.NET Code Generator Pascal Belaud Microsoft France.

OlyMarsOlyMars TemplatesTemplates

RepositoryRepository In memoryIn memoryrepresentation ofrepresentation of

working DBworking DB

Working DBWorking DB

This representation isThis representation issupplied to the templatessupplied to the templates

Page 42: DAT305 Boost Your Data-Driven Application Development Using SQL Server Centric.NET Code Generator Pascal Belaud Microsoft France.

OlyMarsOlyMars TemplatesTemplates

RepositoryRepository In memoryIn memoryrepresentation ofrepresentation of

working DBworking DB

Working DBWorking DB

Templates areTemplates arethen executedthen executed

Page 43: DAT305 Boost Your Data-Driven Application Development Using SQL Server Centric.NET Code Generator Pascal Belaud Microsoft France.

OlyMarsOlyMars TemplatesTemplates

RepositoryRepository In memoryIn memoryrepresentation ofrepresentation of

working DBworking DB

Working DBWorking DB

SQLSQLcodecode SQL code is directlySQL code is directly

executed on the workingexecuted on the workingdatabasedatabase

Page 44: DAT305 Boost Your Data-Driven Application Development Using SQL Server Centric.NET Code Generator Pascal Belaud Microsoft France.

OlyMarsOlyMars TemplatesTemplates

RepositoryRepository In memoryIn memoryrepresentation ofrepresentation of

working DBworking DB

DiskDisk

FileFile

Working DBWorking DB

SQLSQLcodecode

Code is savedCode is savedto a fileto a file

Page 45: DAT305 Boost Your Data-Driven Application Development Using SQL Server Centric.NET Code Generator Pascal Belaud Microsoft France.

Writing Custom Templates

demodemo

Page 46: DAT305 Boost Your Data-Driven Application Development Using SQL Server Centric.NET Code Generator Pascal Belaud Microsoft France.

Extensions For OlyMars

Write OlyMars extensions from Visual Studio .NET

Run this batch file first:\ForExtensionsDevTimeOnly\Copy OlyMars DLL.bat

Make a reference to SQLCodeGenDotNet.dll from your VS .NET projects

Page 47: DAT305 Boost Your Data-Driven Application Development Using SQL Server Centric.NET Code Generator Pascal Belaud Microsoft France.

Extensions For OlyMars

From your code, use the following namespaces

Olymars.SqlDbScanApplication

Olymars.ExecutorResponse

Source

Page 48: DAT305 Boost Your Data-Driven Application Development Using SQL Server Centric.NET Code Generator Pascal Belaud Microsoft France.

Writing Extensions For OlyMars

demodemo

Page 49: DAT305 Boost Your Data-Driven Application Development Using SQL Server Centric.NET Code Generator Pascal Belaud Microsoft France.

Add-Ins For OlyMars

You can write your own add ins for OlyMars

Make a reference to SQLCodeGenDotNet.dll from your project

Create Class Library projects and add at least a public class implementing:

Olymars.IOlymarsAddIn

Page 50: DAT305 Boost Your Data-Driven Application Development Using SQL Server Centric.NET Code Generator Pascal Belaud Microsoft France.

Add-Ins For OlyMars

Page 51: DAT305 Boost Your Data-Driven Application Development Using SQL Server Centric.NET Code Generator Pascal Belaud Microsoft France.

Writing Add-ins For OlyMars

demodemo

Page 52: DAT305 Boost Your Data-Driven Application Development Using SQL Server Centric.NET Code Generator Pascal Belaud Microsoft France.

Next StepsNext Steps

Give this tool a try

Look at the code that is generated by default

Write your own templates

Extend the tool with your own extensions and add-ins

Page 53: DAT305 Boost Your Data-Driven Application Development Using SQL Server Centric.NET Code Generator Pascal Belaud Microsoft France.

Resources

Web Sitehttp://www.microsoft.com/france/msdn/olymars

Send feedback [email protected]

Free but NOT SUPPORTED

Page 54: DAT305 Boost Your Data-Driven Application Development Using SQL Server Centric.NET Code Generator Pascal Belaud Microsoft France.

Questions?

Page 55: DAT305 Boost Your Data-Driven Application Development Using SQL Server Centric.NET Code Generator Pascal Belaud Microsoft France.

Community Resources

Community Resourceshttp://www.microsoft.com/communities/default.mspx

Most Valuable Professional (MVP)http://www.mvp.support.microsoft.com/

NewsgroupsConverse online with Microsoft Newsgroups, including Worldwidehttp://www.microsoft.com/communities/newsgroups/default.mspx

User GroupsMeet and learn with your peershttp://www.microsoft.com/communities/usergroups/default.mspx

Page 56: DAT305 Boost Your Data-Driven Application Development Using SQL Server Centric.NET Code Generator Pascal Belaud Microsoft France.

evaluationsevaluations

Page 57: DAT305 Boost Your Data-Driven Application Development Using SQL Server Centric.NET Code Generator Pascal Belaud Microsoft France.

© 2003 Microsoft Corporation. All rights reserved.© 2003 Microsoft Corporation. All rights reserved.This presentation is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS SUMMARY.This presentation is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS SUMMARY.