The ILOG Rules for .NET 3.0.3 trial was recently made available from the BRMS Resource Center. This update includes a new session provider for RES.NET that some of you may be interested in. The RES.NET team added a session provider named “DirectRuleSessionProvider”. As the name implies, this provider gives the developer a direct means to use RES.NET for in-process invocation. The provider bypasses WCF and does not incur the penalty of serialization. However, at the same time, it lacks some of the WCF features as well—its trade off between light-weight performance and manageability.
The good news is that by using the RES.NET API, your code does not change dramatically between the WCF-based providers and this one. The DriectRuleSessionProvider follows the same calls you might use for the LocalRuleSessionProvider and covers some of the same use cases. Here is a sample code fragment:
… DirectRuleSessionProvider provider = DirectRuleSessionProvider.Provider; // Create a direct rule session. Console.WriteLine("- Create a direct rule session."); IRuleSessionContract session = provider.CreateSession(); …
When using the provider, you have to make some changes to your calling application. They are as follows:
1. Deploy the XOM with your application along with other referenced DLLs.
2. The [Serialization] attribute is no longer required for your XOM classes; however, we recommend keeping them in the event you need to support the WCF-based providers in the future.
Here is a reference to an earlier blog entry about the existing WCF providers (click here).