Re: Multiple Database Support - .NET 2.0
- From: "Frans Bouma [C# MVP]" <perseus.usenetNOSPAM@xxxxxxxxx>
- Date: Tue, 06 Sep 2005 00:29:31 -0700
David Browne wrote:
>
> "Rasheed" <Rasheed@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:A6FD97EC-4BE2-42AE-9913-718E94A3A7BF@xxxxxxxxxxxxxxxx
> > We are in the inception phase of architecting a .NET based multi
> > tier application. Due to the .NET technology advancements, we have
> > decided to go
> > with .NET 2.0 beta 2 for development.
> >
> > One of the objectives is to support multiple databases (SQL,
> > SYBASE, ORACLE
> > and DB 2).
> >
> > We are considering few ORM tools to accomplish the above
> > (nHibernate and gentle.NET). However, we would like to know if
> > there is anything available in
> > .NET 2.0 that we should consider (other than DAAB). I remember,
> > Microsoft was
> > working on object spaces and not sure of this will be available in
> > .NET 2.0.
> >
>
> There's much better support in ADO.NET 2.0 for transparently
> operating with multiple databases. There's a much more complete set
> of abstract interfaces and classes to let you write data access code
> that's not bound to any particular database. See:
>
> Generic Coding with the ADO.NET 2.0 Base Classes and Factories
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvs0
> 5/html/vsgenerics.asp
Yeah, and that falls apart as soon as you're trying to insert a row
into a table... for example: sqlserver has named parameters, DB2
doesn't. sqlserver uses SCOPE_IDENTITY() for identity fields, oracle /
firebird use sequences.
i.o.w.: the SQL is not database generic. So the classes are, but that
will not bring you very far.
> This is something different than Object-Relational Mapping (ORM).
> Generic ADO.NET coding just lets you write database code without
> targeting a particular database platform. ORM is intended to
> eliminate writing database-oriented code entirely. It hides not only
> which database, but the fact that there's a database at all.
it moves the focus from tables + queries to object sets and filters.
> Consequently ORM is very difficult to "get right", and using ORM for
> data-intensive applications can have a significant impact on the
> performance, concurrency and complexity of your application.
huh? Not at all. After all: O/R mappers generate SQL, so instead you
typing it, it's generated for you. And often smarter than you could do
it.
> So the promise of ORM is that you can forget about the database, and
> live in OO land. But in reality, you often have to become an expert
> in your particular ORM technology AND your database to work around its
> limitations.
nonsense. That is: if you use the proper O/R mapper of course. For
example, with LLBLGen Pro you can write pure db generic code, without a
single SQL statement, all typed. Read a customer object from oracle,
change some fields, and save it in sqlserver, without hassle.
And you don't need to become a true expert or fight with limitations.
Within a month (it's going beta this week) we're releasing our Type
converter technology which allows you to use entities with for example
boolean and for example GUID fields on sqlserver AND oracle (or any
other db we support), where the framework will take care of converting
int16 (or char1 or whatever) to bool and back, so you can keep your
sqlserver entities and work with them on oracle as well, without
worrying about the limitations of _oracle_ in the type department
(oracle doesn't support guid or bit types)
> For instance in Oracle when you compare a VARCHAR to a CHAR, they
> will not match unless the VARCHAR is right-padded with spaces to the
> length of the CHAR.
That's with every db. CHAR's are padded with spaces. Though from .NET,
with a parameterized query, you will be able to compare "Foo" with a
char(20) field and a varchar(15) field and get expected results (e.g.
no need for padding)
FB
--
------------------------------------------------------------------------
Get LLBLGen Pro, productive O/R mapping for .NET: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------
.
- Follow-Ups:
- Re: Multiple Database Support - .NET 2.0
- From: Rasheed
- Re: Multiple Database Support - .NET 2.0
- References:
- Multiple Database Support - .NET 2.0
- From: Rasheed
- Re: Multiple Database Support - .NET 2.0
- From: David Browne
- Multiple Database Support - .NET 2.0
- Prev by Date: Regular Expression required
- Next by Date: Re: port or bag it and start over
- Previous by thread: Re: Multiple Database Support - .NET 2.0
- Next by thread: Re: Multiple Database Support - .NET 2.0
- Index(es):
Relevant Pages
|