SubSonic vs Nettiers
I've recently been working extensively with 2 ORMS. Subsonic and Nettiers. Both really good ORMS. My favourite though without a doubt is Subsonic written and designed by Rob Connery who just coincidentally now works for the ASP.NET team at Microsoft.
Reasons I like Subsonic:
1. Its extremely lightweight. It creates stored procedure objects that return readers or datasets.
eg.
public static
System.Data.DataSet
GetItemTypesForClientTypeSysID(int
clienttypesysid, bool bIsBatch)
{
StoredProcedure
sp = SPs.ProcSelectItemsForClientType(clienttypesysid,
bIsBatch);
return
sp.GetDataSet();
}
2. You can write queries in your code that can do most things including using the SQL where / ordering and only selecting specific columns.
eg
public static int
GetClientTypeSysIDFromDesc(string
clienttypedesc)
{
int
tempID = 0;
Query
query = new Query(TblClientType.Schema.TableName);
query.SelectList = TblClientType.Columns.Sysid;
query.AddWhere(TblClientType.Columns.ClientTypeDesc, Comparison.Equals,
clienttypedesc);
query.QueryType = QueryType.Select;
tempID = (int)query.ExecuteScalar();
return
tempID;
}
3. Its rediculously easy to set up. You need 1) Download the subsonic libraries, 2) Run the install so that VS will pick it up, and then 3) make an update the config file's of the projects which will be using the ORM. Obviously you need to reference the subsonic libraries also.
Reasons I like Nettiers.
1. The documentation is pretty good.
2. Setting up nettiers is also straight forward. 1) Download the templates Codesmith Templates, 2) BUY a copy of codesmith and generate the ORM layer.
The Nettiers templates are written by the author of codesmith.... This.... in my opinion is a sales stunt although any intermediate programmer should use codesmith anyway. It's and awesome template based code generation tool.
3. You can perform DeepSave and DeepLoad actions where you are able to save and load object trees based on relational database mappings.
4. You are able to create a web services layer. With some tinkering you can expose this layer as a WCF service and thus create middle-tier DAL that is accessible using your protocol/security strategy (aka Binding) of choice.
5. Nettiers also has its own cuncurrency functionality built in assuming that all the database tables used to generate the ORM have a timestamp field.
Note: Nettiers does generate a lot of code though, and if you don't use the custom TList collection object (which doesn't lend itself well to databinding) you won't be able to deepsave and deepload. Hopefully this will be fixed in later versions of nettiers.
Jean