<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://msmvps.com/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>Runtime vs. Design/Compile Time</title><link>http://msmvps.com/blogs/kathleen/archive/2008/02/14/runtime-vs-design-compile-time.aspx</link><description>Chris asks: At what point with code gen / templating do you start to think about doing all this codegen at runtime instead of compile time? And if we were to be doing it at runtime would be be better served by using a dynamic language such as ruby to</description><dc:language>en</dc:language><generator>CommunityServer 2008.5 SP2 (Build: 40407.4157)</generator><item><title>re: Runtime vs. Design/Compile Time</title><link>http://msmvps.com/blogs/kathleen/archive/2008/02/14/runtime-vs-design-compile-time.aspx#1519022</link><pubDate>Tue, 19 Feb 2008 12:33:05 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1519022</guid><dc:creator>Chris Ortman</dc:creator><description>&lt;p&gt;I don&amp;#39;t know if you ever really need to know that it is one to one.&lt;/p&gt;
&lt;p&gt;If I have a customer object and I can call Customer.Name from other code then I can, whether or not there is a column behind there shouldn&amp;#39;t matter. If there does happen to be a column in a Customers table called name, then I never needed to declare a property, if not then I did. &lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1519022" width="1" height="1"&gt;</description></item><item><title>re: Runtime vs. Design/Compile Time</title><link>http://msmvps.com/blogs/kathleen/archive/2008/02/14/runtime-vs-design-compile-time.aspx#1517090</link><pubDate>Sun, 17 Feb 2008 15:13:33 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1517090</guid><dc:creator>Kathleen</dc:creator><description>&lt;p&gt;Chris,&lt;/p&gt;
&lt;p&gt;How do you know which are one to one and which are not, and how that will evolve? How would you create a system where the code accessing teh business object would not need to know anything about its one to one nature so that it oculd change over time?&lt;/p&gt;
&lt;p&gt;I never create a class that iterates over the table columns. It always iterates over the definition of a business object which may or may not map directly to the database.&lt;/p&gt;
&lt;p&gt;The templates are all design time. By the time we get to runtime, we have a rather large pile of static language code. I'm not sure how that will evolve as I better understand dynamic langauges. &lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1517090" width="1" height="1"&gt;</description></item><item><title>re: Runtime vs. Design/Compile Time</title><link>http://msmvps.com/blogs/kathleen/archive/2008/02/14/runtime-vs-design-compile-time.aspx#1516448</link><pubDate>Sat, 16 Feb 2008 22:43:24 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1516448</guid><dc:creator>Chris Ortman</dc:creator><description>&lt;p&gt;I don&amp;#39;t think that a business object need map 1:1 with a database. But for cases where you would have a template like&lt;/p&gt;
&lt;p&gt;public class &amp;lt;%= table.ToClassName %&amp;gt; {&lt;/p&gt;
&lt;p&gt;&amp;lt;% for column in table.columns %&amp;gt;&lt;/p&gt;
&lt;p&gt;public &amp;lt;%= column.CLRType %&amp;gt; &amp;lt;%= column.ToPropertyName %&amp;gt; {get; set;}&lt;/p&gt;
&lt;p&gt;&amp;lt;% end %&amp;gt;&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;Why do you need to have the template? why not just have the class query the DB and whatever columns it finds those are the properties. Also if I want to add / modify the behavior of a column I can just do that as part of the class.&lt;/p&gt;
&lt;p&gt;My example was trying to say that I tell the UI how to lay things out, grid / flow etc. In this case I said grid, so I would need to tell it what goes in each row. When I call input it should look at what :cities refers to and generate an appropriate input field.&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t know that I&amp;#39;d say a dynamic language is required, but with as sophisticated as your code gen system seems to be it is almost as if you are building your own language on top of VB . If that&amp;#39;s the case it seems like why fight with VB when there are languages that have better support for metaprogramming.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1516448" width="1" height="1"&gt;</description></item><item><title>re: Runtime vs. Design/Compile Time</title><link>http://msmvps.com/blogs/kathleen/archive/2008/02/14/runtime-vs-design-compile-time.aspx#1515189</link><pubDate>Fri, 15 Feb 2008 14:32:32 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1515189</guid><dc:creator>Kathleen</dc:creator><description>&lt;p&gt;Steve,&lt;/p&gt;
&lt;p&gt;I see the big picture of deveopment as a huge mess that we divide and conquer. Attacking the biggest problems and removing them leaves room for a better understanding of the next round of simplification if that makes sense.&lt;/p&gt;
&lt;p&gt;I think we've got the main extension points for the plumbing pretty well down. Moving into the broader application there is a not to do. I'm not sure of the relative contributions of static langauges, dynamic languages, workflow plug ins, rules engines and other techniques. We, rather obviously, won't solve it all with code generation. And we will definitely be doing a lot with handcrafted code for now. But I'm also excited about the next round which needs to address both bigger and smaller issues than the block of things code generation does a good job with. &lt;/p&gt;
&lt;p&gt;Kathleen&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1515189" width="1" height="1"&gt;</description></item><item><title>re: Runtime vs. Design/Compile Time</title><link>http://msmvps.com/blogs/kathleen/archive/2008/02/14/runtime-vs-design-compile-time.aspx#1515185</link><pubDate>Fri, 15 Feb 2008 14:27:42 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1515185</guid><dc:creator>Kathleen</dc:creator><description>&lt;p&gt;Chris,&lt;/p&gt;
&lt;p&gt;Thanks for your comments!&lt;/p&gt;
&lt;p&gt;I agree on the JavaScript perhaps getting a bad rap due to implementations. It's good to see both efforts to fix that and focus on real tools with the other dynamic languages.&lt;/p&gt;
&lt;p&gt;OR/M - whether design or runtime - exists precisely becuase we can't map directly to databases. I know Ruby on Rails does a pretty direct mapping (last I checked it did provide an option for mapping but I never looked under the hood for that. I think demanding databases and business objects directly syncrhonize is a bad idea. &lt;/p&gt;
&lt;p&gt;Did you have in mind the lines in your code that are&amp;quot;input cities&amp;quot; etc to manage or something different? I am generating UI's but I'd like to wait that discussion until I get through the current round of stuff and a round of harness stuff. I think there is a lot more interchange of ideas still needed for UI generation.&lt;/p&gt;
&lt;p&gt;Is there anything in what you are thinking here that requires a dynamic language to simplify?&lt;/p&gt;
&lt;p&gt;Kathleen&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1515185" width="1" height="1"&gt;</description></item><item><title>re: Runtime vs. Design/Compile Time</title><link>http://msmvps.com/blogs/kathleen/archive/2008/02/14/runtime-vs-design-compile-time.aspx#1514642</link><pubDate>Thu, 14 Feb 2008 22:37:29 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1514642</guid><dc:creator>Steve Campbell</dc:creator><description>&lt;p&gt;I agree completely that we want as much as possible in metadata. &amp;nbsp;I actually think we have progressed significantly in our capability to do that. &amp;nbsp;Code-generation tools are much more accessible than they used to be, as is our ability to make that generation dynamic rather than static.&lt;/p&gt;
&lt;p&gt;There is always a line though, between what we want the freedom to express in code, and what we want to be the default (unspecified, generated) behavior. &amp;nbsp;It seems like understanding that relationship, and providing natural extension points is still somewhat of a black art. &amp;nbsp;Do Dynamic languages help in doing that? &amp;nbsp;&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1514642" width="1" height="1"&gt;</description></item><item><title>re: Runtime vs. Design/Compile Time</title><link>http://msmvps.com/blogs/kathleen/archive/2008/02/14/runtime-vs-design-compile-time.aspx#1514541</link><pubDate>Thu, 14 Feb 2008 20:10:39 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1514541</guid><dc:creator>Chris Ortman</dc:creator><description>&lt;p&gt;&amp;gt; everyone I know varies between mild distaste and downright hatred for it.&lt;/p&gt;
&lt;p&gt;Were people&amp;#39;s frustrations with javascript with javascript the language or the poor implementation on the part of browser vendors + the lack of a good debugger?&lt;/p&gt;
&lt;p&gt;I think in a dynamic world you don&amp;#39;t really need an OR/M...or maybe just a very thin one, because the database itself is used to build the model.&lt;/p&gt;
&lt;p&gt;But I think getting the object to the database is just a very small piece. I&amp;#39;m not sure how you would build a GUI, but my vision would be something like:&lt;/p&gt;
&lt;p&gt;Entity Address&lt;/p&gt;
&lt;p&gt; &amp;nbsp; #custom behaviors, but don&amp;#39;t need to declare properties&lt;/p&gt;
&lt;p&gt;end&lt;/p&gt;
&lt;p&gt;UserInterface AddressForm&lt;/p&gt;
&lt;p&gt; &amp;nbsp;layout :grid&lt;/p&gt;
&lt;p&gt; &amp;nbsp;row do &lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;input :states, :on_change =&amp;gt; :update_cities&lt;/p&gt;
&lt;p&gt; &amp;nbsp;end&lt;/p&gt;
&lt;p&gt; &amp;nbsp;row do&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;input :cities&lt;/p&gt;
&lt;p&gt; &amp;nbsp;end&lt;/p&gt;
&lt;p&gt; &amp;nbsp;row do&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;command :save, :execute =&amp;gt; :save_address&lt;/p&gt;
&lt;p&gt; &amp;nbsp;end&lt;/p&gt;
&lt;p&gt; &amp;nbsp;def update_cities&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; cities = Cities.find_for_state :state&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; reload_input :cities, cities&lt;/p&gt;
&lt;p&gt; &amp;nbsp;end&lt;/p&gt;
&lt;p&gt; &amp;nbsp;def save_address&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; Address.save&lt;/p&gt;
&lt;p&gt; &amp;nbsp;end&lt;/p&gt;
&lt;p&gt;end&lt;/p&gt;
&lt;p&gt;So I totally just made that up, but the idea is that I&amp;#39;m still programming in metadata, but the behind the scenes stuff could figure out to generate WPF form or HTML. I think we&amp;#39;re both trying to get to the same place, but I would rather have a programming language *be* my template syntax instead of some form of XML or &amp;#39;template&amp;#39;&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1514541" width="1" height="1"&gt;</description></item></channel></rss>