/Home /Archive /Syndicate /Blog /Support /About /Contact  
All Visual Basic Feeds in one place!





Amanda Silver gave some great insight into what we are going to see for VB in VS 2008 (aka Orcas).

With LINQ and XML we finally get some embedded Object Mapping for the most common Database requirements for building applications.  To date I have relied on Code Generation for building the CRUD code and business rule stubs to tramsform our Database Schema into Object for Type Safety.  The biggest hassle with this has been that we needed to create templates that were not always optimal when applied to every object and then there was the need for a DQE (Dynamic Query Engine).   Two companies providing this are LLBLGEN and EntitySpaces.  I have used both and they have definite pluses and minuses which are beyond the scope of this entry.

Will LINQ make Code Generation Obsolete? in a word... NO.  It will however give us a built in framework to use so we can eliminate the DQE if we want to.  This is vital because it will give us an optimized approach to creating and receiving queries aganst our DB with static type checking.  We still need to separate business objects and business logic from our presentation for clarity and efficiency.

Consider the following: (excuse the images...)

Here you see the intellisense for Query Syntax.  Also it shows how easy it becomes to Infer a bindable type from a query.

Creating business logic with this is a snap.  Creating Templates is no longer really necessary, that would be to do some genric I/O with a custom DQE, The approach I will be taking is to create some basic Partial Classes and Partial Methods that create the stubs for the logic, then quickly go through the business logic and create my rules with intellisense.  This will lead to a much more customizable approach than trying to generate everything from templates.  I am sure the 3rd party tools will be adapting to this approach quickly.  I can see a real need for a VS Add-In that creates the business logic stubs for your project with a single click.

One nice thing is that you can inspect the exact SQL which LINQ creates:

 

On to XML...

Have you every tried to combine XML Fragments?  How about inserting Elements and/or attributes in an XML Document... Painful huh?

Take a look at this:

Yes, that's right; Infer a document or fragment from RAW XML... Notice the <% %> syntax, these are "Expression Holes" in which you can insert VB variables, Infered fragments, etc.  Want more control?  Create an XSD for static types. Awesome stuff.  So Awesome are these two features alone; it compelled me to build http://VisualBasic.Net with VB9.  So while there is no "Go Live" license available yet, be assured that shortly after there is (Beta 2...), the site will GO LIVE.

I will have more about LINQ and some better code samples up soon, also watch the VB Team Blog for more details and samples.

© 2005 Serge Baranovsky. All rights reserved.
All feed content is property of original publisher. Designated trademarks and brands are the property of their respective owners.

This site is maintained by SubMain(), a division of vbCity.com, LLC