We all know that loosely coupled is better than tightly coupled, but that’s not a principle we’ve been able to follow all the time here at Devexpress. For example, XPO is pretty tightly coupled to ADO.Net, which is not at all ideal. That is something that we are going to change – as far as we can – with the 10.2 release. What that means in reality is that XPO will have no direct reference to most of the ADO.Net providers, but instead it will reference only System.Data.SqlClient, System.Data.OleDb (for MS Access support) and VistaDB. We cannot remove the reference to the later as it provides its own specific interface for working with the schema. However, at the moment, the future of this database is not at all clear, so that problem me disappear over time.
So how do we work with the other providers but maintain a loose coupling? Well, simply, we load these other providers dynamically. This means that you will not be tied to a specific version of the provider, you can easily use the latest version without having to recompile the DevExpress.Xpo.Providers assembly, configuring assembly binding redirections or waiting for updates from us! At last, no more “Could not load file or assembly 'MySql.Data, Version=XXX…or one of its dependencies. ” errors! Having said that, you should still only use the providers that are currently supported by XPO, as only these are tested and guaranteed to work.
Of course, these changes wont affect performance in any way as we still use the standard ADO.Net interfaces or delegates prepared with the provider. Since all the changes are made internally, you wont have to change any of your code to take advantage of this extra freedom!
That’s all from this short (but sweet) post, until next time, happy XPO’ing 