In the past there have been many attempts to remove
the impedance mismatch. In the late ’80s and early ’90s,
object databases and persistent programming languages
tried to bridge that gap and were successful—maybe
not from the business point of view, but from a technical point of view. They were able to provide a seamless
experience between the world of the program, the type
system of the programming language, and the world of
persistence.
Object database systems
failed because they didn’t
have strong support for
queries, query optimization, and execution, and
they didn’t have strong,
well-engineered support for
transactions. At the same
time relational databases
grew their capabilities and
the world continued to
gravitate around relational
database systems.
Later on, various kinds
of technology tried to
bridge that gap. ORM
systems try to generalize
that mapping problem
by providing tools that
do it automatically on behalf of the user. The Entity
Framework is an object-relational mapping technology
that provides a general solution to the complex mapping
problem to enable the user to focus on the core business
problem and not on the system and infrastructure aspects
of the problem.
TC You mentioned object-relational mappers. A certain
portion of our audience has worked with products such as
Hibernate or NHibernate and other commercial ORM systems. One of the interesting characteristics of LINQ and
the Entity Framework is that they divide traditional ORM
into two pieces: one part handling mapping and one part
handling querying. Is that a correct view, and why is this
separation reasonable?
JB Several OR mappers bundle these two concerns
together, and that actually makes sense when the only
problem you’re trying to solve is how to bridge the gap
between the application and the database.
But we should also look at another very broad class
of mapping scenarios. We are building database manage-
ment systems and data services around SQL Server—data
services such as replication, reporting services, and OLAP
(online analytical processing). These all provide services
at higher semantic levels of abstraction than does the
relational model.
For example, many years ago SQL Server Replication
introduced the concept of logical records. When you are
setting up a configuration to replicate customers, their
orders, and line items, you want to be able to replicate
not just orders and not just line items, but the relationship that exists between the two. We invented logical
records to address that issue and provide a more convenient solution to the users of the replication component.
In a similar manner, Microsoft SQL Server Reporting
Services enables users to define reports in terms that are
at higher levels of abstraction than the tables and relations. They actually have a model in terms of entities and
relationships, because if you are trying to build a report
that has many parts to it, you want to be able to model
those relationships before producing the report. In the
guts of the reporting services system is a data model and
mapping technology that allows us to solve that mapping
problem.
The tools to manage SQL Server are another example.
SQL Server Management Studio, for example, allows you
to build a user interface over the objects in the database—
your servers, your tables, your views—and to browse
through different database schemas.
That particular set of tools contains an object-relational mapping component. If you look at each one of
these data services as an instance of an application, yet
again we find that we have to build special object-relational mappings to meet the needs of those data services.