F
Frans Bouma [C# MVP]
Chad said:But it is automatic. And its not something unique to this system -
you merely regenerate the wrappers. The wrappers are isolated from
any user code.
that's not automatic, you have to re-run a tool. What if I rename a
table, or a field? Then my code breaks as the wrapper class gets a new
name. That's not what a developer wants.
No, you miss the point. Nothing magic fixes up the differences. What
it does is by early binding - you detect all problems at compile time
rather than hoping to find them at run time. Whats unique about this?
nothing.
Well nothing really from most other similar solutions - except that
nearly every other solution is only early bound on some aspects, but
filters etc fail because they use strings.
no they don't. A lot of the O/R mappers out there don't use strings or
offer an object based query system as well.
If you say its not new - please show me another O/R that is fully
early bound, filters and all. Ive seen very few, andt those that
I've seen have quite an ackware syntax.
LLBLGen Pro does, and so do a lot of others. For example Genome uses a
similar approach as you do (with overloaded C# operators).
Please point me to one that is 100% early bound, and has a "native"
type syntax.
#define 'native'. SQL is set-based, C# is imperative, non-set based.
So what's native? SQL-like, C# like or a language/system which
represents what the SQL elements mean semantically?
They are similar yes, but identity fields cannot be obtained until
after an insert.
so? You've to insert the PK side of an FK first anyway, or do you
require that there aren't any FK's?
Read any of the many articles here regarding the issues with identity
fields - they describe the complexities the add much better than I
can. As far as bottlnecks - they can create bottlenecks by forcing
inserts of master rows prematurely and thus forcing premature locks
or even transaction begins.
Best practises say that you should FK constraints on live databases.
FK constraints force you to insert the PK side of the FK first anyway,
then sync the value with the FK side and insert the FK side. That's not
tic-tac-toe indeed: you have to sort the objects which have to be
inserted first, and you have to implement synchronization logic so when
I do:
CustomerEntity newCustomer = new CustomerEntity();
newCustomer.CompanyName = "Solutions Design";
//...
OrderEntity newOrder = new OrderEntity();
newOrder.OrderDate = DateTime.Now;
//...
newCustomer.Orders.Add(newOrder);
adapter.SaveEntity(newOrder);
I get the graph saved in the right order: first Customer, then order,
pk of customer, an identity, properly synced with newOrder.CustomerID,
and all in a single transaction.
Where are the bottlenecks? What's inserted prematurely?
Trivial compared to the complexity identify fields inject into code.
I don't see how. Unless you don't use FK constraints.
Im not referencing that either. I dont care what the values are, my
issue with identity fields is that they are not available utnil after
an insert, and looking at cross DB platforms, sequences are much
easier to simulate than identity fields.
The insert problem isn't a problem, as when FK constraints are used,
you have to insert the PK side of the FK constraint first anyway, so
even with a sequence you first have to insert the PK side, then the FK
side.
FB
--