(VB, C#) Role specific tools for designers / developers Efficient ...

peruvianwageslaveInternet και Εφαρμογές Web

5 Φεβ 2013 (πριν από 5 χρόνια και 9 μήνες)

104 εμφανίσεις

Programmiersprache

Entwickeln mit Visual Basic .NET?

Agenda

Feature

Overview

Comparison to VFP


Data

Data binding

N
-
tier Applications


DataSets, Local Data Store and automatic replication

LINQ

Project Jasper

Cross Platform

Compact Framework

Silverlight

Dynamic Languages

DLR

Data Binding

LINQ

XML

N
-
tier DataSets

Local Data Store and automatic replication with SQLCE

Project Jasper


Data Binding

Current version of Visual Studio

Drag/drop binding

Custom controls

MVC Pattern

Comparison to VFP

VFP

Assign controls to field types

Drag/drop to create the form

VB Data Binding

Same thing

Drag drop for combo boxes

Uses MVC design pattern

N
-
Tier Applications

Coming in VB9

N
-
Tier DataSets

Take existing designers, make them output to
multiple assemblies.

Adapter in one assembly, dataset in another

WCF Type Sharing

Strict objects transferred across boundaries.

SQLCE

Local data store and in
-
process cache


Comparison to VFP

VFP

Direct support for Client/Server development

COM objects for n
-
tier development

No tooling, create your own transfer approach

Excellent local data store

N
-
Tier DataSets, WCF and SQLCE

Direct tooling for Client/Server and n
-
tier development. Dataset with rules migrates cross
-
tier


data access does not.

Excellent local caching store

Single user, in process only

Works on devices as well

Direct cache to database or via service for n
-
tier

LINQ

Coming in VB9

Simplify querying data

Integrate query operations into any .NET language

Unify querying object, relational, and XML data

Simplify working with XML

Access XML members easily

Impose structure on XML

Produce XML documents quickly


The LINQ Project

LINQ over Objects

Objects

LINQ over SQL

LINQ over XML

<book>


<title/>


<author/>


<year/>


<price/>

</book>

XML

.NET Language Integrated Query

VB

C#

Others…

SQL

N
-
Tier
Applications Made Easier

Business
Logic

Data
Access

Presentation

Database

Service
Reference

DB
Connection

N
-
tier
DataSets

Type
Sharing

LINQ

Local
Cache

LINQ

Comparison to VFP

VFP

Take rectangular data into cursor

Work on the cursor

Take data out of cursor if required

LINQ

Take rectangular or hierarchical data as objects

Work on enumeration of objects

Write back from objects if required

XML Literals (VB Only)

Shorthand for object creation

Dim emp = _


<employee>


<name>Joe</name>


<age>28</age>


<department id="432">


<deptname>Engineering</deptname>


</department>


</employee>

Dim emp = _


New XElement("employee", _


New XElement("name", "Joe"), _


New XElement("age", 28), _


New XElement("department", _


New XElement("name", "Engineering"), _


New XAttribute("id", 432)))

Comparison to VFP

VFP

Take XML data into cursor

Work on the cursor

Take data out of cursor if required

Treat XML as text (TEXT...ENDTEXT)

LINQ

Work directly on XML

XSD if it exists is used to verify

Intellisense and color coding

<% %> similar to << >>

Project Jasper

Built on ADO.NET Entity Framework

Dynamic language binding to the database



Sample Jasper Code

Create a Connection to a SQL Server
Database

Dim
connectionString

As String =


"Provider='
System.Data.SqlClient
‘;


Data Source=.
\
SQLExpress
;


Initial Catalog=
Northwind;Integrated

Security=True;


Generate Default EDM=True;“


context =
DynamicContext.CreateDynamicContext
(
connectionString
)

More Sample Jasper Code

Iterate thru some rows


For Each customer In
context.Customers


Console.WriteLine
("Customer “ &
customer.ContactName

& _


" from " &
customer.Region

& " has the following orders:")



For Each order In
customer.Orders


Console.WriteLine
(
vbTab

& "Order was placed on " & _


order.OrderDate

& "and needs to be delivered by " & _


order.RequiredDate
)


Next

Next

More Sample Jasper Code

Writing Data

‘Create new Customer

Dim
NewCust

=
Northwind.Customers.Create
()


NewCust.CustomerID

= “GHTHG”

NewCust.CompanyName

= “George’s Hats”


Northwind.SaveChanges
()

Comparison to VFP

VFP

Create a view and USE it

APPEND BLANK or INSERT INTO and TableUpdate()

SCAN…ENDSCAN

SQL SELECT on the cursor

VB with Jasper

Create a DataContext onto a Database

.Create() and .SaveChanges()

FOR EACH

LINQ Query

Compact Framework

Silverlight


Compact Framework

Available Today

Phones, Devices, XBOX 360

Same Language, Data Binding


Silverlight Overview

Compelling Cross
-
Platform, Cross
-
Browser UIs


Immersive media experiences & RIA


Seamless, fast installation for end users


Consistent experiences on Mac / Windows


Flexible programming model with collaborative tools


Integration with Web technologies


Based on the .NET Framework


Code in .NET languages (VB, C#)


Role specific tools for designers / developers



Efficient, lower cost delivery, and more capable
media


HD to Mobile w/ SMPTE VC
-
1


Broad media ecosystem


Tools for live and on
-
demand publishing


Legend

V1.1

Legend

V1.0

CLR Execution Engine

.NET for
Silverlight

Framework

JavaScript

Engine

XAML

Presentation
Core

Networking

JSON

REST

POX

RSS

Data

LINQ

XLINQ

DLR

Ruby

Python

WPF

Extensible Controls

BCL

Generics

Collections

Inputs

Keyboard

Mouse

Ink

Media

VC1

WMA

MP3

Browser Host

Integrated

Networking

Stack

DOM

Integration

Installer

Application

Services

MS AJAX

Library

UI Core

Images

Vector

Text

Animation

DRM

Media

Controls

Layout

Editing

3
rd

Party Services

Silverlight Architecture

VB 10

Comparison to VFP

VFP

Not cross platform

Was Dos/Windows/Mac/Unix

VB with Compact Framework and Silverlight

Windows/Mac/*NIX (mono)/Devices/XBOX

Same language

VB on DLR will allow passing of VB Code to
client for compilation

DLR Support


Interactivity

Dynamic extensions

Where do we go from here?

VB 7.x

VB 9.0

VB 8.0

Moved to .NET

Query

XML integration

Finished move to .NET

Generics

VB x.x

???

Why VB as a Dynamic Language?

Dynamic Languages Enable:

Meta
-
data programming styles

Interactive, iterative development

Runtime realization of types, methods, events

Late binding on steroids

Visual Basic is Static and Dynamic at the same time

Static whenever possible, dynamic when necessary

Best of both worlds in one approachable language




Dynamic Language Architecture

CLR Execution Engine

Dynamic Language Runtime

Ruby

Python

VB

Others…

Comparison to VFP

A little early to tell

VFP

Command Window allows single lines

Multiple lines with Ctrl+Enter copies to temp PRG
and runs

Intellisense

VB10

Command Windows allows single or multiple lines

Can bind a method to an event on the fly

Intellisense


Summary

VB 8 added data binding using good design patterns

VB 9 simplifies querying with a unified, integrated query
model for objects, XML and relational data

VB 9 simplifies working with XML by imposing structure,
enabling quick access to members and supporting XML
literals directly in the language

VB 9 makes it easy to create n
-
tier applications without
fighting the tools

Silverlight = Small cross
-
browser, cross
-
platform, cross
-
language runtime. VB running on a Mac!

VB 10 and the DLR will enable dynamic programming
when necessary but VB programmers will still benefit
from static typing when possible, allowing the best of
both worlds in one single language