1 / 33

Sponsoren

Sponsoren. Softwaresponsoren. Mediasponsoren. VB 9 & LINQ. Agenda. Vorstellung KnowledgeCenter Neue Sprachfeautres in VB 9.0 LINQ to SQL in der Praxis. LINQ mit VB 9.0 in der Praxis. Agenda. Vorstellung Die Anwendung: KnowledgeBase Motivation, Architektur & Technologie

tamal
Download Presentation

Sponsoren

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Sponsoren Softwaresponsoren Mediasponsoren

  2. VB 9 & LINQ

  3. Agenda • Vorstellung KnowledgeCenter • Neue Sprachfeautres in VB 9.0 • LINQ to SQL in der Praxis

  4. LINQ mit VB 9.0 in der Praxis

  5. Agenda • Vorstellung • Die Anwendung: KnowledgeBase • Motivation, Architektur & Technologie • Die neuen Sprachfeatures in VB 9.0 • LINQ im Einsatz • Tipp & Tricks zu Performance und Wartbarkeit

  6. Motivation • Vorhandene KnowledgeBase bereits seit 4 Jahren im Einsatz • Keine Erweiterungsmöglichkeiten, da closedsource • Hersteller hat keine Updates mehr herausgebracht • Uns fehlte eine .NET 3.5 Referenzanwendung ;-)

  7. Die Anwendung • KnowledgeBase für Artikel und Fachbeiträge • Live im Einsatz auf VB-Magazin.de • Features: • Artikel posten, bearbeiten • Bewerten, kommentieren • Windows Live Writer Anbindung • RSS & XML für alle Bereiche • WebService für externe Datenschnittstellen (Forum)

  8. Technologien • 100 % .NET 3.5 • 100 % Visual Basic! • Entwickelt unter Visual Studio 2008 • WebFrontend • Windows Communication Foundation • Schnittstelle für den Windows Live Writer • Microsoft SQL Server 2005 (auch kompatibel zu 2008) • LINQ to SQL für Verbindung zur Datenbank

  9. Architektur • Klassische 3-Schichten Architektur • Bestehend aus: • WebFrontend • Business Logik • DataAccess • Modularer aufbau

  10. Sprachfeatures VB9 demo

  11. Linq to Sql in der Praxis Jan-Cornelius Molnar

  12. Fazit Linq ist super  Vielen Dank!!!

  13. Agenda • Query Execution • DataContext • Disconnected Data (N-Tier ?) • Query Compilation

  14. LinqToSql • DataContext • Steuert Datenbankzugriff • Mappt Daten auf Objekte • Speichert Änderungen Fromx Indbx.ArticlesWherex.IsPublishedTake5

  15. Linq To Sql demo Name Title Group

  16. LinqExpressions Fromx Indbx.ArticlesWherex.IsPublishedTake5 Compiler dbx.Articles.Where(Function(a As Article)a.IsPublished ).Take(5)

  17. LinqExpressions dbx.Articles.Where(Function(a As Article)a.IsPublished ).Take(5) LinqQueryProvider Articles Select & Tags Where … Take

  18. LinqExpressions Articles Select & Tags Where … Take Expression Visitor SELECT TOP (5) * FROM [dbo].[Articles] WHERE [IsPublished] = 1

  19. Linq To SqlQuery Comprehension demo

  20. DataContextLifetime • Dispose wann immer möglich • Nötig für Ausführung von Queries • Dispose Kein Change-Tracking

  21. DataContext per Unit ofwork + Transparent + Threadsicher • NestedFunctions

  22. SharedDataContext + Einfacher Zugriff + NestedFunctions • Nicht transparent • Änderungen verwerfen? • Nicht threadsicher

  23. AmbientDataContext + Mehr Transparenz + NestedFunctions + Threadsicher • Dispose? • Änderungen bei mehreren Operationen

  24. DataContext per BusinessObject + Transparent + Threadsicher + Änderungen pro Instanz ? NestedFunctions

  25. Disconnected Data • ASP.NET, WCF, … • DataContext = ConnectedObject • Problem:Update mit „alten“ Daten

  26. Disconnected Data demo

  27. Query Compilation dbx.Articles.Where( … ) … Expression Tree Sql

  28. Query Compilation demo

  29. Query Compilation • Spart bis zu 30% der Ausführungszeit • Gewinnt immer 

  30. Summary • Gutes R.A.D. Tool • “Problemzonen” • DataContext LifeTime • Disconnected Objects • Query Compilation

  31. Q&A

  32. www.justcommunity.de www.dnug-koeln.de

  33. Sponsoren Softwaresponsoren Mediasponsoren

More Related