Hi Ivan, I have some thoughts.&nbsp; I know I&#39;ve been away from this list a while, sorry about that.<br><br><div class="gmail_quote">On Jan 4, 2008 12:07 PM, Ivan Porto Carrero &lt;<a href="mailto:ivan@flanders.co.nz">ivan@flanders.co.nz
</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi<br><br>For the book I&#39;m writing on IronRuby I&#39;m deciding which way to go to demonstrate how IronRuby can leverage the .NET framework.
<br><br>The beginning of the sample application should implement some database layer. My first instinct is to go with Linq-to-SQL and consume those classes from a ruby application.
</blockquote><div><br>Ultimately, we should be able to call any .NET lib from IronRuby.&nbsp; So to an extent I don&#39;t think it matters what your pre-existing data access layer is written in, as long as it is valid .NET code.
<br><br>That said, if I were buying a book on IronRuby, I would want to know how Ruby approaches data access.&nbsp; I already know <a href="http://ADO.NET">ADO.NET</a>, and possibly the various.NET-based ORM frameworks.&nbsp; What I probably don&#39;t know are the Ruby libraries like DBI.
<br>&nbsp;</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">I have a problem with ActiveRecord that comes with Rails, because often it doesn&#39;t allow me to the things I want to do out of the box. And when I&#39;m in App Dev mode I don&#39;t really want to think about customizing the framework I&#39;m using so that it fits my needs. I should just have to configure it and start developing. For this reason I don&#39;t consider ActiveRecord to be sufficient for most enterprise database systems and definitely not legacy ones. I don&#39;t think it would be a good idea to let .NET devs jump to an ORM that won&#39;t handle the more complex enterprise scenario&#39;s out of the box.
</blockquote><div><br>Regardless whether you consider ActiveRecord sufficient, alot of developers will want to know how to use ActiveRecord from IronRuby.&nbsp; I think you are missing an great opportunity if AR isn&#39;t covered, along with what changes might be needed to get it to work with IronRuby.
<br><br>Besides, there are always the other ORM libraries that you can cover which may be a closer to what you think a good ORM should be:<br><br>DataMapper - <a href="http://datamapper.org/">http://datamapper.org/</a><br>
Sequel - <a href="http://sequel.rubyforge.org/">http://sequel.rubyforge.org/</a><br>rBatis - <a href="http://ibatis.apache.org/docs/ruby/">http://ibatis.apache.org/docs/ruby/</a><br>&nbsp;</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I&#39;m thinking of writing a real ORM for Ruby ala NHibernate one that uses a DataMapper with an IdentityMap backed by a Unit Of Work, when I&#39;m finished with the book. It should also have&nbsp; Sql Generation that is highly optimized for each platform it supports (not just say because mssql is from ms we won&#39;t provide the best support for it we can) and maybe make it support linq-to-sql syntax. Obviously I can&#39;t build that in 2 days so I&#39;ll have to drop that idea for a while ;)
<br><br>A second option I have in mind is rolling my own implementation of the ActiveRecord pattern, using database reflection, an <a href="http://ADO.NET" target="_blank">ADO.NET</a> backend and metaprogramming since it has a very limited scope for the book. I&#39;m always much in favor for a unit of work implementation for my dataaccess.
<br><br>At this moment I&#39;m favoring the Linq-to-Sql (C#) approach because it has benefits :<br>1. I demonstrate interop with one of my own project assemblies and how you can extend that using IronRuby.<br>2. I don&#39;t have to write my own ORM
<br>3. I won&#39;t be stopped in my writing by features that haven&#39;t been implemented yet.<br><br>The downside of that approach is that it will be hard to show an example that makes real extensive use of metaprogramming.
<br>A second concern I have for the Linq-to-SQL approach is that that will only work on a windows box, because I don&#39;t think the mono-project has an implementation already.<br><br>Then a last way of doing it would be to use ActiveRecord from the castle project or SubSonic where the ActiveRecord implementation of the CastleProject will be the one that handles most edge cases. The reason I bring these 2 up is that I already got questions from people asking me to put examples up on my blog about using those things&nbsp; from IronRuby. At this point I haven&#39;t put too much on my blog yet because I&#39;m pretty busy writing. And I think every week I wait I&#39;m more close to being able to use as much pure ruby as I can.
<br><br>Any thoughts ?<br></blockquote><div><br>If it were me, I&#39;d avoid anything that required readers to use any language other than IronRuby.&nbsp; Good luck!<br>&nbsp;</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Cheers<br><font color="#888888">Ivan<br><br><br><br>
</font><br>_______________________________________________<br>Ironruby-core mailing list<br><a href="mailto:Ironruby-core@rubyforge.org">Ironruby-core@rubyforge.org</a><br><a href="http://rubyforge.org/mailman/listinfo/ironruby-core" target="_blank">
http://rubyforge.org/mailman/listinfo/ironruby-core</a><br><br></blockquote></div><br>