First, I greatly admire the great work behind SubSonic.
But in the current form, it is almost not practical for me, mainly because of it's command-generation.
1) System.Data.DBConcurrencyException
ADO.NET-DataAdapters are creating UPDATE and DELETE commands using the current data loaded from database in the WHERE-part. This is to prevent inconsistent concurrent changes. I'm not sure if it is incorporated in SubSonic, but a search in source-code and study of the method SqlDataProvider.GetUpdateSql are telling it is not.
Scenario:
- Table Customer: ID, Name, Company, Country
- User A loads object with {1, 'me', 'myCompany', 'US'}
- User B loads the same object, slighly later
- User A changes country to 'DE' and updates record
- User B changes country to 'UK' and updates record
If I only put the PrimaryKey into the WHERE-clause, 5) will NOT fail. And thats a problem. Anything changed by user A is lost, without any message. As a developer, I want to get a System.Data.DBConcurrencyException, optionally checking the value, resync with the database (to get a valid WHERE-condition) and write the changes.
2) TypeConverter
My own DAL-framework makes extensive use of TypConverters, attributable to any type in .NET.
It is possible, to build a data-class with properties declared with types as System.Drawing.Color for example. The DAL converts a string database-field directly into a color-value and vice-versa. This is especially nice, if you are using the PropertyGrid or other component-based controls. Some of my classes make extensive use of XML-serialization. This is also handled by a lovely little TypeConverter. Xml or blob-columns directly into object-instances in properties.
3) Description, Catagory, other Attributes
A further extension in my own DAL is the possibility to dynamically create Attributes as System.ComponentModel.DecriptionAttribute. Another nice feature for using PropertyGrids.
4) Economy
Only transfer CHANGED property values to database. I know of the other thread mentioning it, but the idea of active-flags is not capable of using resnyc-techniques (you must reset something, if you resync; after resync, the changes are not checked against the refreshed data). My idea is to store an exact copy of the dataobject after load. You can compare both instances and get the info, if anything has changed at all and what exactly has changed (you may use this info for change-logging). Then, you can write only the changed values into database.
Just my 2 cents.