How cool is that? We have a provider architecture that allows mere mortals to 
take part in the LINQ translation, we have facilities that allow us to do that 
without source code modification (within a few hours!) - ain't that the 
NHibernate we love?

Now all we need to do to make that fly is to facilitate technical discussions 
about the new LINQ stuff, be it in the dev list or anywhere else. The provider 
is still in its infancy, and newbies will have a hard time understanding why 
certain things are the way they are, why certain limitations exist, or how hard 
it would be to make a certain extension. In many cases, people will simply not 
know whether a missing feature was an explicit design decision, an oversight, a 
welcome feature that just waits for a coder to build it, or simply more 
difficult than it seems. Same with bugs: Does a bug want to be worked around in 
the trunk, or does the team consider a certain workaround too complicated to 
justify its existence there? Some people will need help, others, like Frans, 
are happy to give good advice. Hey, this is supposed to be fun, too!

________________________________
From: [email protected] 
[[email protected]] on behalf of Fabio Maulo 
[[email protected]]
Sent: Wednesday, July 28, 2010 23:12
To: [email protected]
Subject: [nhibernate-development] Ready for reviewers: NH-2256 Add support for 
user-provided extensions to the Linq provider

Now you have a way to inject the translators of your own LINQ extensions or a 
way to switch from default implementations, for some known methods/properties, 
to your own implementations.

You can configure the LinqToHqlGeneratorsRegistry through XML
      <property 
name="linqtohql.generatorsregistry">YourLinqToHqlGeneratorsRegistry assembly 
qualified name</property>

You can use your implementation per Dialect through the constructor of your 
custom dialect
DefaultProperties[Environment.LinqToHqlGeneratorsRegistry] = 
"YourLinqToHqlGeneratorsRegistry assembly qualified name";

You can configure the LinqToHqlGeneratorsRegistry by code with
configuration.Properties.Add(Environment.LinqToHqlGeneratorsRegistry, 
typeof(YourLinqToHqlGeneratorsRegistry).AssemblyQualifiedName)
or
configuration.SetProperty(Environment.LinqToHqlGeneratorsRegistry, 
typeof(YourLinqToHqlGeneratorsRegistry).AssemblyQualifiedName);
or
configure.LinqToHqlGeneratorsRegistry<YourLinqToHqlGeneratorsRegistry>();


And, as usual, if you want, YourLinqToHqlGeneratorsRegistry can be injected 
with whatever you want if you have a custom implementation of IObjectsFactory 
inside your own BytecodeProvider.

Welcome to the world of options, Welcome to NHibernate!!

--
Fabio Maulo

Reply via email to