LINQ to SQL
You have heard about LINQ and LINQ to SQL and might get confused and wondering, why to consider Vanatec OpenAccess. This page should help you to distinguish between the three.
What is LINQ?
LINQ (Language Integrated Query Language) is a new and great Microsoft Query language finally adding object-oriented query capabilities to the .NET framework.
How does OpenAccess support LINQ?
OpenAccess always had a standard based object query language (OQL). LINQ is already integrated into OpenAccess and is an alternative way to OQL. So you can use LINQ, OQL or SQL to query your data. You can use all three in parallel, but only LINQ and OQL bring you the object-oriented advantage you are looking for.
So what is the difference between LINQ and OQL?
LINQ enables you to check your queries at compile time, since they are fully integrated into your code. The disadvantage is that you can hardly implement user defined or runtime dependent queries. With OQL the query is string-based, so you are more flexible at runtime, but you need to make sure that the queries would work. In order to help you with that, OpenAccess provides an OQL browser, which lets you test your OQL statements.
What is LINQ to SQL?
LINQ to SQL provides object-relational mapping functionality.
So does it compete with OpenAccess?
Yes, somewhat ...
LINQ to SQL has its origin at an older project called Objectspaces, which was cancelled 3 years ago. So there was no appropriate solution for object-oriented data access. In addition, ADO.NET is not object-oriented and considered to be a rather very unproductive overhead of work. That's why we said "Stop Hacking. Start Mapping." with Vanatec OpenAccess.
Based on years of standard based object-relational mapping in the Java world we did have the right code base for the functionality needed. Since we focused on the .NET platform, we have built a very tight integration into .NET (1.1, 2.0, 3 and 3.5) and Visual Studio (2005, 2008).
Major distinctive features
LINQ to SQL supports only reverse mapping
This means you need to continue thinking in relations and to know your database. This might be still okay for a lot of projects and engineers being used to develop that way, but it dilutes the productivity advantage you should gain by using o/r mapping.
OpenAccess allows you to map forward and reverse and you can change direction. This means you can start with your object model, which might come out of your UML tool or Class Designer and you just make your classes persistent. You don't have to think about the database schema etc. We generate an optimized database and data access layer for you. Nevertheless you can go ahead and go into your database, change a table or column and then let OpenAccess update your object model.
Note: LINQ to SQL allows you to generate a database schema based on your object model, but only once. If you change your object model, you need to delete your database to get a new schema. So this is basically a one way with no return and seems to be pretty unpractical. We call our approach Roundtrip-Mapping as described above.
LINQ to SQL supports only Microsoft SQL Server
This is pretty clear and obvious. Even other database vendor or 3rd parties might add other database providers, it will never be the same level of support. With OpenAccess you get the same seamless support for all supported databases and we can easily add other relational databases. So you can deploy on different systems and schemas without changing your code.
LINQ to SQL supports only simple object-oriented concepts and common use case in a client/server scenario
OpenAccess helps the programmer with
- Polymorphism
- Flexible Mapping
With OpenAccess, the mapping between the database schema and the class hierarchy can be more flexible than with LINQ to SQL. Various mapping strategies (flat, horizontal, vertical and mixtures) can be used by simply declaring them in the configuration file. This is of great value when different class hierarchy members expose size and cardinality differences and is a means for optimization and database tuning. LINQ to SQL can store a whole class hierarchy only in the flat model (one table fits all).
OpenAccess provides features and tools for Enterprise applications like
- FetchPlans for use-case specific optimized performance.
- Distributed Caching for unlimited scalability.
- ObjectContainer for disconnected or distributed data access scenarios.
In summary, with Vanatec OpenAccess you are getting surpassing o/r mapping functionality, highest level of productivity improvements, enterprise readiness and database independence.
With LINQ to SQL you can do simple projects based on your Microsoft SQL Server centric application.
Last not least, Vanatec is also able to implement short term product enhancements based on your requirements.
|