290 likes | 379 Views
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.
E N D
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 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 <book> <title/> <author/> <year/> <price/> </book> SQL Objects XML VB C# Others… .NET Language Integrated Query LINQ over Objects LINQ over SQL LINQ over XML
N-Tier Applications Made Easier LINQ LINQ Presentation Business Logic Data Access Database DB Connection Service Reference Type Sharing N-tier DataSets Local Cache
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
Cross Platform 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
Silverlight Architecture JavaScript Engine Framework Browser Host MS AJAX Library Integrated Networking Stack .NET for Silverlight Inputs Controls DRM Media Media Editing VB 10 Keyboard WMA MP3 Mouse Ink VC1 Layout Data DLR BCL WPF UI Core CLR Execution Engine DOM Integration Vector Text Extensible Controls Ruby Generics LINQ Python Collections XLINQ Images Animation XAML Networking Application Services Presentation Core REST POX Legend Legend RSS JSON V1.1 V1.0 Installer 3rd Party Services
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
Dynamic Language DLR Support
Where do we go from here? Moved to .NET VB 7.x Finished move to .NET Generics VB 8.0 Query XML integration VB 9.0 Interactivity Dynamic extensions ??? 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 Dynamic Language Runtime Ruby Python VB Others… CLR Execution Engine
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