<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://bloggingabout.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Search results matching tags 'Active Record', 'Subsonic', 'dOOdads', and 'DAL'</title><link>http://bloggingabout.net/search/SearchResults.aspx?a=1&amp;o=DateDescending&amp;tag=Active+Record,Subsonic,dOOdads,DAL&amp;orTags=0</link><description>Search results matching tags 'Active Record', 'Subsonic', 'dOOdads', and 'DAL'</description><dc:language>en-US</dc:language><generator>CommunityServer 2008.5 SP2 (Build: 40407.4157)</generator><item><title>SubSonic v1 (ActionPack) vs dOOdads vs Castle ActiveRecord</title><link>http://bloggingabout.net/blogs/mischa/archive/2007/05/07/subsonic-v1-actionpack-vs-doodads-vs-castle-activerecord.aspx</link><pubDate>Mon, 07 May 2007 05:05:00 GMT</pubDate><guid isPermaLink="false">813b6dfd-644e-4573-a816-eebab56ba0d0:190887</guid><dc:creator>Mischa Kroon</dc:creator><description>&lt;H1&gt;SubSonic Vs dOOdads Vs ActiveRecord&lt;/H1&gt;
&lt;P&gt;Let's meet our contenders:&lt;/P&gt;
&lt;H3&gt;dOOdads&lt;/H3&gt;
&lt;P&gt;An ORM framework which was provided by the people who also gave us &lt;A href="http://www.mygenerationsoftware.com/"&gt;MyGeneration&lt;/A&gt;.&lt;BR&gt;It's built with a couple of things in mind:&lt;/P&gt;
&lt;P&gt;- Ease of use&lt;BR&gt;- Supporting a large amount of DBMS systems &lt;BR&gt;&lt;BR&gt;&lt;B&gt;Summary&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.mygenerationsoftware.com/"&gt;MyGeneration&lt;/A&gt; presents dOOdads, an elegant .NET architecture available in C# and VB.NET and capable of supporting any .NET managed data provider. Currently dOOdads are available for Microsoft SQL, Oracle, Firebird, Access, PostgreSQL, VistaDB, SQLite, and MySQL. &lt;BR&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3&gt;Castle's ActiveRecord &lt;/H3&gt;
&lt;P&gt;ActiveRecord is the DAL which is supplied with the Castle project.&lt;/P&gt;
&lt;P&gt;&lt;B&gt;Summary&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;The Castle ActiveRecord project is an implementation of the ActiveRecord pattern for .NET. The ActiveRecord pattern consists on instance properties representing a record in the database, instance methods acting on that specific record and static methods acting on all records. &lt;BR&gt;&lt;BR&gt;Castle ActiveRecord is built on top of NHibernate, but its attribute-based mapping free the developer of writing XML for database-to-object mapping, which is needed when using NHibernate directly.&lt;/P&gt;
&lt;H3&gt;SubSonic&lt;/H3&gt;
&lt;P&gt;The first public DAL which employed Build Providers that I know off :)&lt;/P&gt;
&lt;P&gt;&lt;B&gt;Summary&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;A Data Access Layer (DAL) builder that requires no code on your part, it builds itself at compile-time with a full object layer and strongly-typed Collections&lt;BR&gt;A complete utility toolset, complete with Rails-like scaffolding, migrations (DB Versioning), and code generators&lt;BR&gt;A dynamic query tool, that lets you use SQL Server and the Enterprise Library without having to know SQL&lt;BR&gt;An OR Mapper that extends to views and stored procedures so you're not locked into the OR/M thing &lt;/P&gt;
&lt;HR&gt;

&lt;P&gt;The syntax / setup by ORM:&lt;/P&gt;
&lt;P&gt;&lt;B&gt;Setup dOOdads&lt;/B&gt;:&lt;/P&gt;
&lt;P&gt;Install MyGeneration code generator Create stored procedures ( optrional ), Create DAL. &lt;BR&gt;Copy files to current project folder. &lt;/P&gt;
&lt;P&gt;Copy DLL and your done. &lt;BR&gt;Setting the connectionstring can be done in the appsettings: "dbconnection" is it's default. &lt;/P&gt;
&lt;P&gt;&lt;B&gt;Setup Active Record:&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;Generate Classes using Active Record Generator (Sql Server only), or through several other methods. Generating the classes is pretty wrist friendly. &lt;BR&gt;Just setting property's for every column and defining it's relationship is enough. b&lt;/P&gt;
&lt;P&gt;It also needs a section in the web.config or a bit of code to set it up and a couple of DLL's&lt;/P&gt;
&lt;P&gt;&lt;B&gt;Setup SubSonic:&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;Classes can be generated by using a build provider, which means as much as have let VS.Net create the classes at build time which means you don't have to manually have to update the classes. ( Needs full trust )&lt;/P&gt;
&lt;P&gt;Classes can also be generated trough the supplied templates which are called through a web interface. &lt;/P&gt;
&lt;P&gt;It also needs a section in the web.config or a bit of code to set it up and a single DLL. &lt;/P&gt;
&lt;P&gt;&lt;B&gt;Setup Conclusion:&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;All have different approaches with none of them actually having a leg up on the others at least not for me. &lt;/P&gt;
&lt;P&gt;They can all be set up within 10 - 20 minutes and are thus also usable for small projects. &lt;/P&gt;
&lt;P&gt;-----&lt;/P&gt;
&lt;P&gt;The Code for some standard actions:&lt;/P&gt;
&lt;P&gt;In this table the code for the active record solutions is missing this is because I couldn't really find any documentation in a downloadable form for this framework on how to do these things. (which doesn't mean that it's not out there :)&lt;/P&gt;
&lt;TABLE id=AutoNumber1 cellSpacing=0 cellPadding=0&gt;

&lt;TR&gt;
&lt;TD align=middle&gt;&lt;B&gt;dOOdads&lt;/B&gt;&lt;/TD&gt;
&lt;TD align=middle&gt;&lt;B&gt;Active Record&lt;/B&gt;&lt;/TD&gt;
&lt;TD align=middle&gt;&lt;B&gt;SubSonic&lt;/B&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD colSpan=3&gt;
&lt;P&gt;&lt;B&gt;Retrieving all records of a table&lt;/B&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class=code&gt;Dim emps As New Employees &lt;BR&gt;emps.LoadAll &lt;/TD&gt;
&lt;TD class=code&gt;&amp;nbsp; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class=code&gt;&amp;nbsp; 
&lt;P&gt;Employees.FetchAll(); &lt;BR&gt;or sorted:&lt;BR&gt;GridView1.DataSource = &lt;BR&gt;Employees.FetchAll(SubSonic.OrderBy.Asc(Employees.Columns.LastName));&lt;BR&gt;or in a collection:&lt;BR&gt;EmployeesCollection products = new ProductCollection(); &lt;BR&gt;Employees.OrderByAsc(Employees.Columns.LastName); &lt;BR&gt;Employees.Load(); &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD colSpan=3&gt;&lt;B&gt;Retrieving a single record&lt;/B&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR class=code&gt;
&lt;TD class=code&gt;Dim emps As New Employees&lt;BR&gt;emps.LoadByPrimaryKey(EmpID) &lt;/TD&gt;
&lt;TD class=code&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD class=code&gt;&amp;nbsp; 
&lt;P&gt;Employees employees = new Employees(id);&lt;BR&gt;or:&lt;BR&gt;Employees employees = Employees.FetchByID(id); &lt;BR&gt;or:&lt;BR&gt;Employees employees = new Product(Product.Columns.LastName, "Chai"); &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD colSpan=3&gt;&lt;B&gt;Adding a record&lt;/B&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class=code&gt;Dim emps As New Employees 
&lt;P&gt;emps.AddNew() &lt;BR&gt;emps.LastName = "Smith" &lt;BR&gt;emps.HireDate = Now &lt;BR&gt;emps.Save() &lt;/P&gt;
&lt;P&gt;'return new key value &lt;BR&gt;EmpID = emps.ID &lt;BR&gt;&amp;nbsp;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class=code&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD class=code&gt;&amp;nbsp; 
&lt;P&gt;Dim emps As New Employees &lt;/P&gt;
&lt;P&gt;emps.LastName = "Smith" &lt;BR&gt;emps.HireDate = Now &lt;BR&gt;emps.Save() &lt;/P&gt;
&lt;P&gt;'return new key value &lt;BR&gt;EmpID = emps.EM_ID &lt;BR&gt;&amp;nbsp; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD colSpan=3&gt;&lt;B&gt;Editing a record&lt;/B&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class=code&gt;&amp;nbsp; 
&lt;P&gt;Dim emps As New Employees &lt;/P&gt;
&lt;P&gt;emps.LoadByPrimaryKey(EmpID) &lt;BR&gt;emps.LastName = "Smith" &lt;BR&gt;emps.HireDate = Now &lt;BR&gt;emps.Save() &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class=code&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD class=code&gt;Dim emps As New Employees (key value) 
&lt;P&gt;emps.LastName = "Smith" &lt;BR&gt;emps.HireDate = Now &lt;BR&gt;emps.Save() &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD colSpan=3&gt;&lt;B&gt;Deleting a record&lt;/B&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class=code&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Dim emps As New Employees &lt;BR&gt;&lt;BR&gt;emps.LoadByPrimaryKey(EmpID) &lt;BR&gt;emps.MarkAsDeleted() &lt;BR&gt;emps.Save() &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;Employees.Destroy(key value)&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD colSpan=3&gt;&lt;B&gt;More complex query: select top 10 firstname, lastname from employees where salary &amp;gt; 1000 order by lastname asc&lt;/B&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class=code&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Dim emps As New Employees &lt;BR&gt;&lt;BR&gt;With emps&lt;/P&gt;
&lt;P&gt;.Query.Top = 10 .Query.AddResultColumn(.ColumnNames.firstname) &lt;BR&gt;.Query.AddResultColumn(.ColumnNames.lastname)&amp;nbsp; &lt;BR&gt;.Where.salary.Value = "1000" &lt;BR&gt;.Where.salary.Operator =&amp;nbsp; WhereParameter.Operand.GreaterThan &lt;BR&gt;.Query.AddOrderBy(.ColumnNames.lastname, WhereParameter.Dir.DESC) &lt;/P&gt;
&lt;P&gt;End With&lt;/P&gt;
&lt;P&gt;emps.Load()&lt;BR&gt;GridView1.DataSource = emps.defaultview&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class=code&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD class=code&gt;dim q as New SubSonic.Query(Employees.TableName) 
&lt;P&gt;q.top = "10"&lt;BR&gt;q.SelectList = Employees.Columns.firstname + ", " + &lt;BR&gt;Employees.Columns.lastname &lt;BR&gt;q.AddWhere(employees.Columns.salary, &lt;BR&gt;SubSonic.Comparison.GreaterThan, 1000); &lt;BR&gt;q.OrderBy = SubSonic.OrderBy.Asc(Employees.Columns.lastname) &lt;/P&gt;
&lt;P&gt;GridView1.DataSource = q.ExecuteReader()&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TABLE&gt;
&lt;P&gt;Strengths / Weaknesses:&lt;/P&gt;
&lt;P&gt;&lt;B&gt;dOOdads &lt;/B&gt;&lt;/P&gt;
&lt;P&gt;The good:&lt;/P&gt;
&lt;P&gt;- has been around for a while &lt;BR&gt;- has support for a large amount of databases &lt;BR&gt;- has super easy aliassing built into it through the user of MyGeneration&lt;BR&gt;- source in C# and VB.Net&lt;BR&gt;- simplest framework of the lot (even I understood some of it :P)&lt;BR&gt;- active support forum &lt;BR&gt;- has a silly name :)&lt;BR&gt;&lt;BR&gt;The bad:&lt;/P&gt;
&lt;P&gt;- no active development at this time&lt;BR&gt;- no templates support for dynamic SQL from MyGeneration itself &lt;BR&gt;&amp;nbsp;&lt;BR&gt;&lt;B&gt;Subsonic&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;The good:&lt;/P&gt;
&lt;P&gt;- least amount of code to do stuff &lt;BR&gt;- build providers can mean: almost zero todo to get it working&lt;BR&gt;- very rapid development of the framework &lt;BR&gt;- free helpers:&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; - auditing (created by, created on, modified by, modified when)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; - scaffolding (control using subsonic)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; - html report of tables&lt;BR&gt;- it feels "smart" &lt;BR&gt;&lt;BR&gt;The bad:&lt;/P&gt;
&lt;P&gt;- it hasn't been around for very long&lt;BR&gt;- very rapid development of the framework &lt;BR&gt;- bombs on database tables with spaces in them amongst other things.&lt;BR&gt;&lt;BR&gt;&lt;B&gt;Castle Active Record&lt;/B&gt;&lt;BR&gt;&lt;BR&gt;The good:&lt;/P&gt;
&lt;P&gt;- it's built around the NHibernate engine &lt;BR&gt;- it has support for the Hibernate query language&lt;BR&gt;- it has a built in validation framework&lt;BR&gt;- tables can be created from the classes&lt;BR&gt;- it has support for joins &lt;/P&gt;
&lt;P&gt;The bad:&lt;/P&gt;
&lt;P&gt;- it's built around the NHibernate engine &lt;BR&gt;- it's a probably a lot more complex then the other 2 &lt;BR&gt;&lt;B&gt;&lt;BR&gt;Conclusion&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;I myself have used dOOdads with a number of projects and was very pleased with it's performance and it's easy of use and speed to set up. &lt;BR&gt;For another project I used SubSonic and I was even more pleased with it's syntax + being able to use asp.net pages to generate te classes was a big plus for me. &lt;/P&gt;
&lt;P&gt;Allthough it's possible to generate dOOdads classes through the command line I never got that far into MyGeneration to pull that off. &lt;BR&gt;For me I'll be going for SubSonic for my future projects. &lt;/P&gt;
&lt;P&gt;With dOOdads as a backup ORM.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PS. If anyone has a very easy to set up ORM which he / she thinks is better then the ones in this comparison please let me know :)&lt;/P&gt;</description></item></channel></rss>