You can do all of this - but it takes a lot more code.
It is like to say that you can do all of this is assembler. What I
meant is that you can not work with tables as you can work with
scalars or arrays.
Do any of the major RDMS vendors currently support these features and have
an interface into .NET for this?
SQL Server Yukon.
Oracle support these features but I don't know if you have an
interface into .NET for that.
Perhaps - but it is the now widely adopted standard. You will find it
difficult to persuade developers to ditch the database independance this
gives them (although far from complete or perfect) and bind themselves
tightly to one vendors view of the world.
IMO DBMS independance is a myth. I have seen projects which changed
the application language 5 or 6 times and the DBMS was always the
same.
BTW SQL Server is not very faithful to the ISO standards.
I think this is part of the
problem that OO databases have had in getting developers to adopt them.
I don't think it is the problem of OO databases. If you try to use an
OO DBMS you will realize soon that you need a lot more code.
CREATE DOMAIN name [AS] data_type
[ DEFAULT expression ]
[ constraint [ ... ] ]
I have to plead ignorance here. I am by no means a DBMS guru - but I was
unable to find any reference to this in MSDN - so I am assuming that SQL
Server does not support them.
No, it does not support the standard SQL syntax. The equivalent in
Transact SQL is: sp_addtype
From the documentation I could find on
sql.org it looks like this is restricted to defining primitive datatypes
with constraints and defaults.
It was in SQL 92, but not in the modern versions.
But few products follow the standards.
To claim that this is the only possible mapping to classes seems to me to be
The only correct mapping. But we need decent user defined type support
to do a good mapping.
With SQL Server Yukon we don't need to map anything because you can
use the same classes (the same code) in the DBMS and in the
applications.
like designing a language which only supported classes derived from
primitive types.
It was a problem in the past. That's why many people did the mistake
of identifying classes with tables. But now they have not excuse. All
major DBMSs support classes and not only primitive types.
But OO classes do not equal primitive types. In fact in general an OO class
equals type consisting of member variables and member functions
I think this was already clarified.
But table definititions or schemas are not variables and could easily be
equated with classes
No, table definitions are variable definitions and they can not be
equated to type definitions (other of the meanings of class).
For instance:
Create table X (A Integer, Primary Key(A));
is the equivalent of;
type
T = table (A Integer, Primary Key(A));
var
X: T;
But the SQL syntax do both steps together. You are creating a type and
a variable at the same time.
With SQL you can not define relational types. You can generate them
only. The SQL's "CREATE TABLE" construct is called a "type generator"
in the jargon.
The closest thing in OO languages are the array type generators.
var X: array[1..100] of integer;
Here you are generating a type and creating a variable at the same
time.
On the other hand if you create a class:
class Customer
{
public int ID;
public string Name;
}
You are creating a type only. You can not insert or delete anything on
the class.
You have to create variables and pointer based lists, and then you
have returned to the prehistory of the data management.
Well this depends on your definition of business logic.
What is yours?
I agree more or less with this:
http://www.awprofessional.com/articles/article.asp?p=98832&seqNum=2
And I agree a lot with this:
http://www.versata-deutschland.de/p...ei_der_Software_Entwicklung_by_Chris_Date.pdf
http://itmanagement.earthweb.com/entdev/article.php/622991
I'd be more than
happy to use the database to enforce as much business logic and constraints
as possible. However in my experience there are some things that I would
classify as busines logic that you can't do in a RDMS.
I agree with you if you change RDBMS by SQL DBMS. This is one of the
reasons because SQL DBMSs are not RDBMSs
It is a big problem, and what we need is better DBMSs that can enforce
any kind of business rule declaratively. But the industry is not
moving in that direction.
For instance Dataphor is very good on this, and most of the
theoretically updateable views are updateable.
Oracle is inferior but it can implement many business rules
declaratively.
Unfortunately SQL Server is even very inferior.
On the other hand the OO community is doing all the contrary, to
implement ALL the business rules in the applications like our fathers
did on the 50's and the 60's.
OOAD is a clear technological regression.
Regards
Alfredo