1 / 40

Datasets, Business Objects or Just LINQ

Datasets, Business Objects or Just LINQ. Sahil Malik www.winsmarts.com Prerequisites for this presentation: 1) .NET 2) Lots of coffee. Level: Intermediate. Sofia, Bulgaria October 10th. A little bit about me. MVP C# INETA Speaker telerik Evangelist Book Author X 3

nasim-witt
Télécharger la présentation

Datasets, Business Objects or Just LINQ

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. Datasets, Business Objects or Just LINQ SahilMalik www.winsmarts.com Prerequisites for this presentation: 1) .NET 2) Lots of coffee. Level: Intermediate Sofia, Bulgaria October 10th

  2. A little bit about me. • MVP C# • INETA Speaker • telerik Evangelist • Book Author X 3 • Article Author X n • Site: • www.winsmarts.com • Blog: • blah.winsmarts.com

  3. A bit about what I will talk about .. • This presentation is all about practical tips, technology applied rather than technology presented. • The case for disconnected data • Mechanisms to represent disconnected data • DataSets and Business Objects • Stand in .NET 2.0, and compare the two • Code Examples. • And what happens when you throw the future in the mix?

  4. The two halves of data access

  5. The Connected • Pessimistic Concurrency. • Keeping a connection open – while u wait !! • A much lower possibility of concurrency conflicts. • Simpler/More Straightforward.

  6. The Connected – Lets be Practical! • If amazon.com maintained an open database connection, for every visitor on their site. • About 40 million visitors a day • At an average, lets assume that each visitor were to stay online for 5 minutes. • Lets to be fair, assume, no connection pooling.

  7. Connected – GEE WHIZ!! • Total number of average open connections • 40,000,000 / (24 * 60/5) = 312,500 • Total licensing cost on an Oracle database – • Ouch amount of $. • Total licensing cost on SQL Server – • Also an Ouch amount of $. • And don’t forget the nuclear power plant to run your servers.

  8. Connected – But it’s not just about $ • What about a distributed architecture? • Web Services? • Disconnected Salesman? • The whole UDDI concept – a.k.a. Microsoft and IBM’s idea for World “Piece”.

  9. Disconnected • Connect • Read • Disconnect • Others may use your connection. • Work on your data • Re Connect • Submit Changes • Disconnect

  10. Demo #1 The difference connection pooling makes.

  11. Connection Pooling

  12. Disconnected Architecture DATA + ê DATA

  13. Disconnected Data • Two choices • Business Objects • The DataSet family.

  14. Business Objects - Pros • A class instance that holds your data, and represents it in a semi structured hierarchical fashion that is specific to your domain. • You can put “smarts” in your business object. • Your business object “means” something – it’s not a dumb bucket of data.

  15. Business Objects - Cons • You have to write them  • You loose the basic ability to work with data • Sorting • Searching • Filtering • Your business objects, are a complete reinvention, in every system you will ever work on.

  16. The DataSet family - Pros • Built into the framework. • You don’t have to write it. • Comes with a decent ability to search/sort/filter etc. • You can even add limited smarts to your DataSet by adding partial classes or strongly typing the DataSet.

  17. The DataSet family - Cons • “Limited” smarts • It’s really just a dumb bucket of data. • Not semi-structured or hierarchical • Just rows and columns.

  18. Active BO versus Passive Dataset • Passive • Less work • Your application keeps your data clean • Lower impedance mismatch with the database • Easy SOA, more distributed. • Active • More work • Your data keeps your application clean • Higher impedance mismatch with the database • SOA is tougher, less distributed.

  19. DataSet or BO? • So are you more of a DataSet person? Or a Business Object person? • WHAT AN AWFUL CHOICE TO MAKE!! On one hand I loose the ability to validate and represent my data. On the other, I loose searching/sorting, and have to perform a lot of work translating to and from the underlying data store. • Which is why I am looking forward to ADO.NET vNext and LINQ.

  20. Hmmmmm ….. SO WHAT DOES LINQ*.* GIVE YOU?

  21. Tell me, which car do you like better? BEFORE WE ANSWER THAT Ferrari Honda Civic

  22. Tell me, which car do you like better? BEFORE WE ANSWER THAT Business Objects based Architecture Datasets based Architecture

  23. vNext = LINQ, LINQ2SQL, LINQ2Dataset, LINQ2Entity, ADO.NET eF WHAT DOES VNEXT GIVE YOU? Business Objects based Architecture Datasets based Architecture

  24. vNext = LINQ, LINQ2SQL, LINQ2Dataset, LINQ2Entity, ADO.NET eF HOW DOES VNEXT GIVE YOU.. Business Objects based Architecture Datasets based Architecture

  25. vNext • .. Makes working with Business Objects easier. • LINQ • ADO.NET eF • LINQ to Entity • LINQ to SQL • .. Makes working with Datasets easier. • LINQ to DataSet

  26. Demo #2 How LINQ makes working with Business Objects easier.

  27. Demo #3 LINQ to DataSet – How does that help?

  28. ADO.NET vNext –high level overview • It’s about bridging the conceptual and logical model. • The 4 models Physical Logical Conceptual Presentation

  29. ADO.NET vNext –high level overview Database Conceptual Schema / Client Views Your Business Logic

  30. ADO.NET vNext –high level overview • This mapping in done in various XML Files .csdl Conceptual Schema .msl The Mapping .ssdl Logical Schema

  31. EDM – Entity Data Model • Entities • Relationship • Inheritance • “is a” relationship when tested against a base entity type. • Complex Types

  32. Logical Schema - ssdl

  33. Conceptual Schema - csdl

  34. Mapping - msl

  35. What about DLINQ? • It’s called LINQ to SQL now • You can use it where the logical model and the conceptual model are the same. • Further Reading • ADO.NET vNext CTP http://shrinkster.com/i5y • DLINQ and LINQ http://shrinkster.com/i5x

  36. A bit about release dates CLR 2.0 .NET 2.0 .NET 3.0 WF/WCF/WPF/Cardspace SharePoint 2007 Vista All this stuff Orcas, .NET vNext, ADO.NET vNext, LINQ *.* Nov 2005 End 2006ish Future

  37. Clearing a few misconceptions • ADO.NET vNext is unlike other ORMs in the market place. • Minimalist approach, rather than everything and the kitchen sink. • ADO.NET vNext introduces the concept of “Client Views” and thus “set based theory” in object oriented code. • Queries are more sophisticated than simple string matching  • It takes the approach of attacking the conceptual model, rather than get mired in object to relational translation.

  38. Demo #4 LINQ to Entity, ADO.NET vNext – How do they help, (and not help).

  39. Thank You www.winsmarts.com blah.winsmarts.com

More Related