Pro LINQ object relational mapping with c# 2008

405 549 0
Pro LINQ object relational mapping with c# 2008

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

It is nearly impossible today to write enterprise software without the use of one or more relational databases. Granted, there are cases when the data is transient and not stored in a database, but for the most part, software needs to consume and manipulate data in a database. It sounds easy, but there are hundreds of ways to connect software systems to databases and thousands of people who think they have the skeleton key for data access layers. Pro LINQ Object Relational Mapping in C# 2008 explains an efficient, repeatable way to apply industry design patterns to build scalable object–oriented data access layers. Object relational mapping (OR/M) has been a gray area in Microsoft development for many years. It’s not that Microsoft language developers don’t understand OR/M; in fact, the opposite is true, as is exemplified by the glut of third–party .NET OR/M tools on the market. The struggle has come more from the lack of native tools with the object–oriented and object persistence capacity to effectively work in this arena. With the inception of .NET, Microsoft overcame the first obstacle by developing an object–oriented environment and framework. The second obstacle, the native object persistence layer, is only now being realized with the introduction of Language Integrated Query (LINQ) and LINQ’s children, the Language Integrated Query for Relational Databases (LINQ to SQL) and the Language Integrated Query for the ADO.NET Entity Framework (LINQ to Entities). The gray area no longer exists, and the .NET developers of the world finally have the native tools required to build modular, reusable data access layers. What you’ll learn The powerful advantages that OR/M can bring to your code The native tools that are now available within Visual Studio 2008 for OR/M How to build scalable object–oriented data access layers that take advantage of OR/M’s flexibility How LINQ fits into this picture, together with the advantages and disadvantages that it can bring How the concepts work in the real world by examining a fully worked and detailed case study, created with an architecture than can be easily applied to a wide range of other situations Who this book is for This book is intended for Microsoft .NET developers who are using or evaluating Microsoft Visual Studio 2008 to build data–aware applications, and it will provide patterns and resources that can be used to build enterprise class software.

this print for content only—size & color not accurate spine = 0.776" 408 page count Books for professionals By professionals ® Pro LINQ Object Relational Mapping with C# 2008 Dear Reader, Anyone developing data-aware software in .NET should read Pro LINQ Object Relational Mapping with C# 2008. My goal for this text is to provide you with the patterns and practices needed to build enterprise-class, data-aware software applications. Although the vehicle for this message is C# 2008 and the two new object-relational mapping (ORM) tools from Microsoft (that is, LINQ to SQL and the ADO.NET Entity Framework), the design patterns and architecture used within this book can be applied to any application requiring interaction with a database. While working with numerous large organizations over the past few years, it has become apparent to me that many programmers in the .NET community do not have a good understanding of object-oriented data access techniques and that even more lack thorough understanding of ORM tools. Conveniently, at the time I was contemplating writing a book on ORM, Microsoft was releasing not just one, but two, ORM tools: LINQ to SQL and the ADO.NET Entity Framework. This could only be fate, and so Pro LINQ Object Relational Mapping with C# 2008 was born. As someone who has worked in the industry, and who has designed and implemented many data access layers, my hope for this book is that it provides you, the reader, with a better understanding of ORM design patterns, LINQ to SQL, and the ADO.NET Entity Framework. Additionally, after you read this book, I hope that you take away a better understanding and appreciation for object-oriented data access layers, and that you spread the word about ORM and how it can simplify your life. Vijay P. Mehta Shelve in C# User level: Intermediate–Advanced Mehta LINQ ORM The eXperT’s Voice ® in .neT Pro LINQ Object Relational Mapping with C# 2008 cyan MaGenTa yelloW Black panTone 123 c Vijay P. Mehta Companion eBook Available THE APRESS ROADMAP Pro LINQ Object Relational Mapping with C# 2008 Pro LINQ: Language Integrated Query in C# Pro C# 2008 and the .NET 3.5 Platform www.apress.com SOURCE CODE ONLINE Companion eBook See last page for details on $10 eBook version ISBN-13: 978-1-59059-965-5 ISBN-10: 1-59059-965-9 9 781590 599655 9 0 0 0 0 Pro with C# 2008 Discover the power that LINQ to SQL and LINQ to Entities can bring to your projects Covers LINQ to SQL and LINQ to Entities Covers LINQ to SQL and LINQ to Entities Covers the ADO.NET Entity Framework [...]... populate a business object In this context, an ORM tool is a third-party tool (for example, LINQ to SQL) that provides you with commercial off-the-shelf mapping functionality According to Wikipedia, Object- relational mapping (a.k.a O/RM, ORM, and O/R mapping) is a programming technique for converting data between incompatible type systems in relational databases and object- oriented programming languages.”... xv Mehta_965-9FRONT.fm Page xvi Thursday, June 12, 2008 8:54 AM Mehta_965-9FRONT.fm Page xvii Thursday, June 12, 2008 8:54 AM Acknowledgments W riting a book is a difficult task, one that cannot be done without the help of a supporting cast Pro LINQ Object Relational Mapping with C# 2008 is not an exception; many people have contributed and made this project possible First, I need to thank the wonderful... Page 3 Friday, February 29, 2008 9:27 AM CHAPTER 1 ■■■ Getting Started with Object- Relational Mapping I n the introduction, I stated that the purpose of this book is to explore object- relational mapping (ORM) by examining the new tools, LINQ to SQL and EF, as well as tried-and-true design patterns Unfortunately, to become a “professional” at ORM development, you have to start with the basics This chapter... metadata mapping This is fundamentally the core of object- relational mapping (and yes, LINQ to SQL and EF support mapping business objects to database tables with metadata) Object caching: As the name indicates, this functionality enables object/ data caching to improve performance in the persistence layer Although query and object caching are available in LINQ to SQL and EF, both require some additional code... February 29, 2008 9:27 AM 8 CHAPTER 1 ■ GETTING STARTED WITH OBJECT- RE LATIONA L MAPPING Stored procedure support: The object purists are going to read this and say that stored procedures serve no purpose in an ORM tool Why on earth would you defile your decoupled model and data layer with the integration of stored procedures? The fact of the matter is, in many large organizations you can’t get away with using... 12 Friday, February 29, 2008 9:27 AM 12 CHAPTER 1 ■ GETTING STARTED WITH OBJECT- RE LATIONA L MAPPING Continuing with the comparison between the object model and the data model, notice that there is significantly more inheritance in the object model in Figure 1-2 as compared to Figure 1-1 This is a common scenario in today’s object- oriented world, with applications designed with multiple layers of inheritance... approach is as it sounds: you start at the bottom, or in this case the database, and work your way up to the object model In the LINQ to SQL designer, this is the most supported approach That isn’t to say that you can’t use the other approaches with LINQ to SQL (because you can), but the quickest and easiest way is to start with the database and generate your object model from your schema EF, like LINQ. .. great features of object- oriented programming and one of the drawbacks to relational databases As seen in the previous examples, without manipulating the object model with Adapters and other SQL data access code, there is no straightforward way to connect the object- oriented model to a relational database model The term Adapters is taken from Design Patterns: Elements of Reusable Object- Oriented Software... have been shocked at how few books address using object- relational mapping patterns with NET The idea for this book has been in the back of my mind for a while, but I was always hesitant because of the deficiency in the native Microsoft tools Now, with the Language-Integrated Query (LINQ) suite and the ADO.NET Entity Framework (EF), the object- relational mapping pattern can finally be realized in the... supports this approach; however, unlike LINQ to SQL, this is not the primary approach for the EF designer Although the DDD people are going to strongly disagree with me, in some situations the Bottom Up approach is as sound as any other development technique However, it does lend 13 Mehta_965-5C01.fm Page 14 Friday, February 29, 2008 9:27 AM 14 CHAPTER 1 ■ GETTING STARTED WITH OBJECT- RE LATIONA L MAPPING itself . Pro LINQ Object Relational Mapping with C# 2008 ■■■ Vijay P. Mehta Mehta_965-9FRONT.fm Page i Thursday, June 12, 2008 8:54 AM Pro LINQ Object Relational Mapping with C# 2008 Copyright © 2008. for professionals By professionals ® Pro LINQ Object Relational Mapping with C# 2008 Dear Reader, Anyone developing data-aware software in .NET should read Pro LINQ Object Relational Mapping with. .neT Pro LINQ Object Relational Mapping with C# 2008 cyan MaGenTa yelloW Black panTone 123 c Vijay P. Mehta Companion eBook Available THE APRESS ROADMAP Pro LINQ Object Relational Mapping with

Ngày đăng: 12/05/2014, 15:53

Từ khóa liên quan

Mục lục

  • Pro LINQ Object Relational Mapping with C# 2008

  • Contents at a Glance

  • Contents

  • About the Author

  • About the Technical Reviewer

  • Acknowledgments

  • Introduction

  • Getting Started with Object-Relational Mapping

    • Introduction to Object-Relational Mapping

      • What Is ORM?

      • Benefits of ORM

      • Qualities of a Good ORM Tool

      • Impedance Mismatch

      • Object Persistence

      • Basic ORM Approach

      • Summary

      • ORM Patterns and Domain-Driven Design

        • Domain-Driven Design

          • UML

          • Domain-Specific Languages and More

          • Domain Model Structure

            • Entities

            • Value Objects

            • Aggregates

            • Services

Tài liệu cùng người dùng

Tài liệu liên quan