PDA

View Full Version : subsonic


aepuras
11-24-2006, 02:54 PM
is is possible to use spring with Subsonic OR mapper

Mark Pollack
11-25-2006, 04:46 AM
Hi,

Can you explain more what you mean? From the pure '3rd party library' perspective you can use features from both - just include them as references. Obvioulsy Sonic would be in your data access layer, and if you wanted to use create a controller that did data access you could use Spring's ASP.NET support to configure your page to the controller reference.

As for deeper integration between the two libraries, I took a quick look at how transactions are managed in Sonic and the approach seems to be one in which the code inside your DAL is managing the TX, i.e. you build up a collection of query command objects and then pass that off to an ExecuteTransaction method. In all but the most simple of CRUD DAL layers, I believe it is better to put the transaction control in the business service layer. This lets you mix/match multiple DAL object operations within a single transaction.

To this end, it seems like one could write a 'SpringAdoDataProvider' for Sonic that would use Spring's ADO.NET framework. As such transaction management would be done via Spring and not Sonic. This would let you use the Sonic API and have transaction control in a higher layer than the DAL.

Other integrations maybe possible, but that is what comes to mind. If you have interest in this, let me know and I can help you out.

Cheers,
Mark