<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-32922167</id><updated>2011-10-24T12:43:09.837-07:00</updated><category term='visual studio'/><category term='source of truth'/><category term='RC1'/><category term='2'/><category term='v2.0'/><category term='meta data'/><category term='release'/><category term='codeplex'/><category term='NBusiness'/><category term='ORM'/><category term='ROM'/><title type='text'>justnbusiness</title><subtitle type='html'>This blog is about my open source project NBusiness. To find out more head on over to http://www.codeplex.com/nbusiness</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://justnbusiness.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/32922167/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://justnbusiness.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Justin Chase</name><uri>http://www.blogger.com/profile/09465842474543801600</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_pcncuUNsA3Q/S2yelxM5vjI/AAAAAAAAAM0/nLIYJ8r-IQI/s1600-R/764863923_1f807d6ab3_m.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>18</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-32922167.post-7137421756208470605</id><published>2007-08-31T06:26:00.000-07:00</published><updated>2007-08-31T06:32:59.389-07:00</updated><title type='text'>Moving to a new blog</title><content type='html'>I've decided to create my own blog site. I'ts called &lt;a href="http://www.justnbusiness.com/"&gt;justnbusiness&lt;/a&gt; and that is where I'll be posting from now on. I did it for a couple reasons, one was because I was tired of not being able to upload zip files to blogger. It's great that they let you do images but I really want to be able to do zip files since I regularly want to post code snippets along with the blog. Another reason is because I wanted to have a visible working example of NBusiness in action (even if it is a simple one). I wanted to '&lt;a href="http://en.wikipedia.org/wiki/Eat_one"&gt;eat my own dog food&lt;/a&gt;', if you will.&lt;br /&gt;&lt;br /&gt;So if you have subscribed to this RSS feed (why do I hear crickets chirping?) feel free to delete it and head over to &lt;a href="http://www.justnbusiness.com/"&gt;http://www.justnbusiness.com&lt;/a&gt; and subscribe there instead! This will likely be my last post to this blog.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32922167-7137421756208470605?l=justnbusiness.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://justnbusiness.blogspot.com/feeds/7137421756208470605/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=32922167&amp;postID=7137421756208470605' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/32922167/posts/default/7137421756208470605'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/32922167/posts/default/7137421756208470605'/><link rel='alternate' type='text/html' href='http://justnbusiness.blogspot.com/2007/08/moving-to-new-blog.html' title='Moving to a new blog'/><author><name>Justin Chase</name><uri>http://www.blogger.com/profile/09465842474543801600</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_pcncuUNsA3Q/S2yelxM5vjI/AAAAAAAAAM0/nLIYJ8r-IQI/s1600-R/764863923_1f807d6ab3_m.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-32922167.post-4036157949719011131</id><published>2007-08-27T08:03:00.000-07:00</published><updated>2007-08-27T08:14:24.829-07:00</updated><title type='text'>RC2 Available</title><content type='html'>I just uploaded &lt;a href="http://www.codeplex.com/NBusiness/Release/ProjectReleases.aspx?ReleaseId=1062"&gt;a new release candidate &lt;/a&gt;this weekend, cleverly dubbed 'RC2'. This is the first v2 build that will actually install as visual studio plugin and work correctly without requiring the Visual Studio SDK. Be sure to read the README.txt that comes with the build. There were two tricks with fixing the problems with that last RC.&lt;br /&gt;&lt;ol&gt;&lt;li&gt;If you don't have the SDK you at least need the ProjectAggregator2.msi, which is a redistributable that comes with the SDK. &lt;/li&gt;&lt;li&gt;I had to get the version information in the registry keys of the installer up to date with the new assemblies. This version has a new PLK that I got off of the Microsoft VSIP website as well. I had been adjusting it in code but forgot the installer required some manual updates.&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;I plan on upgrading the installer project to a WIX projects as soon as possible. I don't like that the project aggregator redist. isn't part of the automatic install process and it's practically impossible to figure out how to do that with the old school install process. I'm not really looking forward to redoing the installer but I want a double click-next-next-next install process and anything less is unworthy.&lt;/p&gt;&lt;p&gt;There are a few known issues with this release, most of them are listed on the Issues List on &lt;a href="http://www.codeplex.com/NBusiness"&gt;codeplex&lt;/a&gt;, for example the oh so annoying error message about not being able to get references for your assembly despite the fact that your project will successfully build. I've never seen an error message that lets you build still before. But this is a known bug in the VS SDK, hopefully it'll be fixed on the next release. I guess I'll have to try to get this thing working with VS2008 sometimes soon as well.&lt;/p&gt;&lt;p&gt;Anyway download RC2 and let me know what you think! Someone start up another good thread on the forums!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32922167-4036157949719011131?l=justnbusiness.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://justnbusiness.blogspot.com/feeds/4036157949719011131/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=32922167&amp;postID=4036157949719011131' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/32922167/posts/default/4036157949719011131'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/32922167/posts/default/4036157949719011131'/><link rel='alternate' type='text/html' href='http://justnbusiness.blogspot.com/2007/08/rc2-available.html' title='RC2 Available'/><author><name>Justin Chase</name><uri>http://www.blogger.com/profile/09465842474543801600</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_pcncuUNsA3Q/S2yelxM5vjI/AAAAAAAAAM0/nLIYJ8r-IQI/s1600-R/764863923_1f807d6ab3_m.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-32922167.post-6881583925272211301</id><published>2007-07-31T14:18:00.000-07:00</published><updated>2007-07-31T14:53:25.514-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='visual studio'/><category scheme='http://www.blogger.com/atom/ns#' term='RC1'/><category scheme='http://www.blogger.com/atom/ns#' term='codeplex'/><category scheme='http://www.blogger.com/atom/ns#' term='v2.0'/><category scheme='http://www.blogger.com/atom/ns#' term='release'/><category scheme='http://www.blogger.com/atom/ns#' term='NBusiness'/><category scheme='http://www.blogger.com/atom/ns#' term='2'/><title type='text'>NBusiness v2.0 RC1</title><content type='html'>So it's here at last! This is the not quite officially released version of NBusiness 2.0. Here is the link:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.codeplex.com/NBusiness/Release/ProjectReleases.aspx?ReleaseId=1062"&gt;http://www.codeplex.com/NBusiness/Release/ProjectReleases.aspx?ReleaseId=1062&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;For those of you who have tried out my Alpha/Beta versions of 2.0 in the past I'll say that this is a much easier install to get working. This is the real-deal, no experimental mode BS to have to deal with. Full integration baby!&lt;br /&gt;&lt;br /&gt;I should say that you should expect some bugs for now but it should be "mostly" working. Meaning, simply firing up a new project should just build right out of the box.&lt;br /&gt;&lt;br /&gt;Most core features should be working just as you'd expect but I haven't tested out the VB side of things thoroughly enough yet so don't expect much from there. If you test it out and find some bugs please enter an issue in the &lt;a href="http://www.blogger.com/www.codeplex.com/NBusiness/WorkItem/List.aspx"&gt;issue list&lt;/a&gt;! I'd really appreciate it.&lt;br /&gt;&lt;br /&gt;After doing some thinking about the time spent getting to this point I realized that I haven’t been recording hours at all and it doesn’t seem like TFS keeps track of checkout times so there probably is no way to know for sure but I’d estimate that it has taken me an average of 10h/week (not including the time spent working on the XNA game I made recently too!) for 10 months which is about:&lt;br /&gt;&lt;br /&gt;10 * 4 * 10 = 400 hrs (or 16.7 days)&lt;br /&gt;&lt;br /&gt;If I was billing at $90/h that would be $32,400!&lt;br /&gt;&lt;br /&gt;Of which I’ve made approximately $0 total. I’m hoping there will be some intangible benefits down the road but the main reasons why I did it were A.) to satisfy my thoughts on how to make a code generator and B.) I wanted to make a website and resented writing the data access layer by hand. So basically it’s taken me almost a year to write some code that would have taken me just a couple days if I wasn’t so damn crazy. Talk about taking the long route to solve a problem!&lt;br /&gt;&lt;br /&gt;After squaring up the VB side of things I need to make sure the Getting Started doc is better and I have to update the wiki pages so they're in line with the current version. This is pretty exciting! Be sure to tell your friends!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32922167-6881583925272211301?l=justnbusiness.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://justnbusiness.blogspot.com/feeds/6881583925272211301/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=32922167&amp;postID=6881583925272211301' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/32922167/posts/default/6881583925272211301'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/32922167/posts/default/6881583925272211301'/><link rel='alternate' type='text/html' href='http://justnbusiness.blogspot.com/2007/07/nbusiness-v20-rc1.html' title='NBusiness v2.0 RC1'/><author><name>Justin Chase</name><uri>http://www.blogger.com/profile/09465842474543801600</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_pcncuUNsA3Q/S2yelxM5vjI/AAAAAAAAAM0/nLIYJ8r-IQI/s1600-R/764863923_1f807d6ab3_m.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-32922167.post-2609354264597166936</id><published>2007-07-27T17:57:00.000-07:00</published><updated>2007-07-27T18:15:54.302-07:00</updated><title type='text'>Ghetto Alarm</title><content type='html'>Last night I found myself without a cellphone or an alarm clock, I needed to get up by 8am so I had to come up with something. Of course, being the nerd that I am, I decided to write up a quick alarm clock application before I fell asleep. I just plugged in my laptop and changed my power settings so that it would never go into sleep mode and executed the following program:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Text;&lt;br /&gt;using System.Threading;&lt;br /&gt;using System.Runtime.InteropServices;&lt;br /&gt;&lt;br /&gt;namespace GhettoAlarm&lt;br /&gt;{&lt;br /&gt;    class Program&lt;br /&gt;    {&lt;br /&gt;        [DllImport("Kernel32.dll")]&lt;br /&gt;        public static extern bool Beep(UInt32 frequency, UInt32 duration);&lt;br /&gt;&lt;br /&gt;        static void Main(string[] args)&lt;br /&gt;        {&lt;br /&gt;            DateTime alarm = new DateTime(2007, 7, 27, 8, 0, 0);&lt;br /&gt;            while (true)&lt;br /&gt;            {&lt;br /&gt;                Console.Write("\rTime: " + DateTime.Now.ToShortTimeString());&lt;br /&gt;                Thread.Sleep(500);&lt;br /&gt;                if (DateTime.Now &gt; alarm)&lt;br /&gt;                {&lt;br /&gt;                    Beep(500, 250);&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Needless to say it worked perfect! I'm not sure what would have happened if the laptop power mode was set to fall asleep but I think it probably would still work.&lt;br /&gt;&lt;br /&gt;I think the interesting thing here though is how easy it is to just write up a little something to do what you want in C#. I know there is some talk going around about the new dynamic languages and how they are great for rapid prototyping but I just want to say with C# you can change which line of code is executing on the fly, change it and recompile on the fly and even change values in memory on the fly. I'm pretty happy with the rapid prototyping capabilities of C# and I'm a little skeptical of the value of dynamic languages in general... One of these days I'll have to try python again before being too certain about this though.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32922167-2609354264597166936?l=justnbusiness.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://justnbusiness.blogspot.com/feeds/2609354264597166936/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=32922167&amp;postID=2609354264597166936' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/32922167/posts/default/2609354264597166936'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/32922167/posts/default/2609354264597166936'/><link rel='alternate' type='text/html' href='http://justnbusiness.blogspot.com/2007/07/ghetto-alarm.html' title='Ghetto Alarm'/><author><name>Justin Chase</name><uri>http://www.blogger.com/profile/09465842474543801600</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_pcncuUNsA3Q/S2yelxM5vjI/AAAAAAAAAM0/nLIYJ8r-IQI/s1600-R/764863923_1f807d6ab3_m.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-32922167.post-6622650005682255065</id><published>2007-07-09T12:32:00.000-07:00</published><updated>2007-07-09T13:04:47.596-07:00</updated><title type='text'>CodeSnippetExpression is evil</title><content type='html'>By the way, to anyone thinking about doing some &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;CodeDom&lt;/span&gt; development be sure to avoid the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;CodeSnippetExpression&lt;/span&gt; class like the plague. It turns out there is (at least) two legitimate usages of the class that I have encountered but otherwise it is evil.&lt;br /&gt;&lt;br /&gt;I can say this because I just spent a couple weeks re-doing all of my templates so that the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;CodeSnippetExpression&lt;/span&gt; class was completely removed from my templates. This was only the beginning of the headache of making my &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;CodeDom&lt;/span&gt; code language agnostic but it was the most painful. For the record I'll add my two legitimate usages of snippets and some examples of how I got burned by just saying to myself "&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;Meh&lt;/span&gt;, I'll only be generating C# anyway...".&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Legitimate use #1 - Calling the default base class constructor&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;//Example&lt;br /&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;CodeConstructor&lt;/span&gt; c = new &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;CodeConstructor&lt;/span&gt;();&lt;br /&gt;c.Name = "Example";&lt;br /&gt;c.Attributes = &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_7"&gt;MemberAttributes&lt;/span&gt;.Public;&lt;br /&gt;c.BaseConstructorArgs.Add(new &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_8"&gt;CodeSnippetExpression&lt;/span&gt;(""));&lt;br /&gt;&lt;br /&gt;//Output&lt;br /&gt;Example() : base() { }&lt;br /&gt;&lt;br /&gt;For some reason you have to add a parameter to the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_9"&gt;BaseConstructorArgs&lt;/span&gt; collection to get this functionality and if you want to call the &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_10"&gt;parameterless&lt;/span&gt; constructor you have to add an expression that generates nothing. I suppose you *might* be able to use the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_11"&gt;CodePrimitiveExpression&lt;/span&gt;(null) but I haven't tried that. I can confirm that the empty &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_12"&gt;CodeSnippetExpression&lt;/span&gt;("") does work however.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Legitimate use #2 - Fake while loops&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;//Example&lt;br /&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_13"&gt;CodeIterationStatement&lt;/span&gt; i = new &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_14"&gt;CodeIterationStatement&lt;/span&gt;(&lt;br /&gt;   new &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_15"&gt;CodeSnippetStatement&lt;/span&gt;(""),&lt;br /&gt;   new &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_16"&gt;CodePrimitiveExpression&lt;/span&gt;(true),&lt;br /&gt;   new &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_17"&gt;CodeSnippetStatement&lt;/span&gt;(""));&lt;br /&gt;&lt;br /&gt;//Output&lt;br /&gt;for(;true;) { }&lt;br /&gt;&lt;br /&gt;Now I realize that this looks stupid but I assure you, it's legitimate. It turns out there is no "while" loop in the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_18"&gt;CodeDom&lt;/span&gt; all you get is the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_19"&gt;CodeIterationStatement&lt;/span&gt; which in turn generates a for loop. However if you think about it what is a for loop? Essentially you're saying "for some initial value, while some condition is true, do this". A for loop with only the condition evaluation is essentially a while loop and the only way to do that with the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_20"&gt;CodeDom&lt;/span&gt; is to print out empty snippets.&lt;br /&gt;&lt;br /&gt;So it's ironic that the only legitimate usages of the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_21"&gt;CodeSnippetExpression&lt;/span&gt; objects are simply empty strings. This makes me think that they're utterly evil and should instead be replaced with a &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_22"&gt;CodeEmptyExpression&lt;/span&gt;() object or something similar. I welcome any comments about how else they could be properly used.&lt;br /&gt;&lt;br /&gt;Here are a few simple &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_23"&gt;examples&lt;/span&gt; about how I decided to use them then found it to be very painful to undo them:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Bad idea: "using"&lt;/strong&gt;&lt;br /&gt;Yes I know the "using" feature in C# is lovely and wonderful and all of that but in reality it is simply &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_24"&gt;syntactic&lt;/span&gt; sugar. It is not part of the underlying .net framework.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Proper Alternative:&lt;/strong&gt;&lt;br /&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_25"&gt;IDisposable&lt;/span&gt; d = ...;&lt;br /&gt;try&lt;br /&gt;{&lt;br /&gt;   //do something to d.&lt;br /&gt;}&lt;br /&gt;finally&lt;br /&gt;{&lt;br /&gt;   d.Dispose();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;This is essentially what the "using" statement is doing under the hood. Unfortunately you have to implement this using the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_26"&gt;CodeDom&lt;/span&gt; this robustly. There are no language agnostic shortcuts!&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Bad Idea: "anonymous delegates"&lt;/strong&gt;&lt;br /&gt;Anonymous delegates, oh anonymous delegates, how I love thee... unfortunately you are simply an illusion! Once again more C# syntactic sugar. What's going on under the hood is that a private member is getting generated and a delegate pointing to that method is being generated for you. You're going to have to do it all yourself! Additionally, simply passing method names as parameters for delegates isn't good enough either, more damn syntactic sugar! You're going to have to do it all the hard way.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Proper Alternative:&lt;/strong&gt;&lt;br /&gt;void Test()&lt;br /&gt;{&lt;br /&gt;   &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_27"&gt;EventHandler&lt;/span&gt; e = new &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_28"&gt;EventHandler&lt;/span&gt;(Test);&lt;br /&gt;   e.Invoke(this, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_29"&gt;EventArgs&lt;/span&gt;.Empty);&lt;br /&gt;}&lt;br /&gt;void &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_30"&gt;MyDelegateMethod&lt;/span&gt;(object sender, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_31"&gt;EventArgs&lt;/span&gt; e)&lt;br /&gt;{&lt;br /&gt;  //do something.&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;This goes for asynchronous methods as well. In stead of simply passing in Method names for parameters you'll need to use the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_32"&gt;CodeObjectCreate&lt;/span&gt; class to create an instance of your delegate (&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_33"&gt;EventHandler&lt;/span&gt; or whatever) and pass in the Method name to that. Make sure you use all the proper &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_34"&gt;CodeDom&lt;/span&gt; classes to get this language agnostic.&lt;br /&gt;&lt;br /&gt;Those were really the biggest gotchas that I found out. You should start out assuming you're going to be generating for multiple languages and do it right the first time. Be sure to find the right class for the right job too!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32922167-6622650005682255065?l=justnbusiness.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://justnbusiness.blogspot.com/feeds/6622650005682255065/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=32922167&amp;postID=6622650005682255065' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/32922167/posts/default/6622650005682255065'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/32922167/posts/default/6622650005682255065'/><link rel='alternate' type='text/html' href='http://justnbusiness.blogspot.com/2007/07/codesnippetexpression-is-evil.html' title='CodeSnippetExpression is evil'/><author><name>Justin Chase</name><uri>http://www.blogger.com/profile/09465842474543801600</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_pcncuUNsA3Q/S2yelxM5vjI/AAAAAAAAAM0/nLIYJ8r-IQI/s1600-R/764863923_1f807d6ab3_m.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-32922167.post-1463416103445303963</id><published>2007-06-19T08:10:00.000-07:00</published><updated>2007-06-23T09:11:36.456-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ROM'/><category scheme='http://www.blogger.com/atom/ns#' term='meta data'/><category scheme='http://www.blogger.com/atom/ns#' term='source of truth'/><category scheme='http://www.blogger.com/atom/ns#' term='ORM'/><title type='text'>Nearing v2.0 Release</title><content type='html'>I only have 2.5 work items left before the release of v2.0. And I may defer one completely. I'm having a bit of a hangup regarding whether or not to implement a feature where you can generate E# based on a database schema. It's not the technical challenge of it, though it would be a fair amount of work, I have done it before and know exactly what it would take to do it again. It's the whole idea of it that I'm debating with. Yesterday at work I was giving a Lunch-and-Learn presentation about code generation and one slide of my power point presentation I have labeled "Source of Truth". This slide prompts me to talk about how I view the meta data as a source of truth and, really, this is the main difference between NBusiness and all other code generators. I'll explain what I mean a little better.&lt;br /&gt;&lt;br /&gt;To me with code generation it is possible to end up with a somewhat schizophrenic code generator when it comes to keeping track of it's meta data. This is what I mean by the "Source of Truth", where does the meta-data really reside? For most other code generators they start with extracting the schema from a database as the source of truth and this is the primary problem. However, I question the value of pulling in the schema from the database as a source of truth.&lt;br /&gt;&lt;br /&gt;The main problem is really that, since you're pulling it in from a database you are trying to map Objects based on a relational model. This is a well known process known as ORM and as we all know it is a very complicated and tricky problem. However, no matter how well you do ORM, it simply isn't possible to express everything you need in an object in your relational database (at least in a way that translates into an interpretable schema) and inevitably there is a need to customize or add to your meta data. And here is where the problems begin, you have two sources of truth suddenly. How do you handle it so they merge together smoothly, how do you keep customizations while trying to recognize changes in the database, how do you effectively retrieve a subset of the database schema, how do you give things a more friendly name while trying to keep them mapped to the original column and more questions? I mean most of these problems have solutions but they are complicated and difficult and imperfect at best. You might include not allowing customization at all and just forcing the user to deal, you could use some mechanism to merge customizations in with extracted schema meta data.&lt;br /&gt;&lt;br /&gt;SO with all that said I should explain how NBusiness differs. NBusiness is a reversal of where the source of truth resides because your E# files are actually your source of truth. They are the 1 and only source of meta data, and to complete the reversal it turns out it is FAR easier to generate your database schema based on objects than the reverse. You could say ROM is much easier than ORM. So for starting up a new project, hands down I'd say the model of authoring your meta-data (entities) without being dependent on a database for extracting schema is far superior. What it comes down to is tooling at that point, which is where I believe NBusiness is unique and valuable. That is, rather than a graphical Visio style development tool you have E#, which is a very easy and intuitive (or strives to be!) language to describe meta data. I think this is why most people have gone the ORM route, because most databases already have a rich and familiar tool for creating tables and columns and relationships, why reinvent the wheel? Well it's my main supposition that E# turns out to be much easier and productive for describing authoring meta-data and you also end up becoming independent from the database as a source of truth which is very valuable.&lt;br /&gt;&lt;br /&gt;While I believe all this is true, there is still the situation where you have an existing database. Also, it may be fairly large and manually creating all these entities may be more work than you really want to have to do. That alone could be a critical enough point where using a different tool than NBusiness is a superior choice. So it still might make sense to have the capability to generate some entities based on a schema to really get you started at least. If I did it I'd do it with the focus on keeping your entities as your primary source of truth still. I sort of want to do it but I don't want to degenerate into just another ORM tool. Though, I suppose, if I provide that feature than it will really put my theory to the test. If you have the ability to generate your entities from a database AND the ability to define your entities as the single source of truth then which ever method is truly superior will be the way people use it. If authoring E# manually is not actually better than that tool will be helpful, if it is then it will be helpful sometimes and not other times.&lt;br /&gt;&lt;br /&gt;I think I'm sort of talking myself into this even though I set out to talk myself out of it! Dang it.&lt;br /&gt;&lt;br /&gt;Maybe I should speak to how I envision NBusiness to handle the situation where you have a set of entities that do not map 1:1 to a database. I imagine this problem will crop up often and I haven't fully tested out the system yet but this is how I imagine it will go. Essentially, when you generate your code you may optionally generate SQL, this sql you get for free and if you're working on an existing project it's really helpful. However if you're not and you have an existing database you may end up in a situation where you don't get to use any of that sql at all. So with NBusiness all of the code it generates (with the default templates and the default framework) you end up with code that uses Stored Procedures as the bridge between the objects and the relational data. All NBusiness code ends up calling a stored procedure such as "PurchaseCollectionFetchByPerson", which when authored would give you a PersonId parameter and expect a set of data related to a collection of Purchase objects. That stored procedure may query tables that look nothing like the purchase entity you have declared so it is the responsibility of the stored procedure to be that bridge. You would have to manually create this in this circumstance.&lt;br /&gt;&lt;br /&gt;This get's us 90% of the way there very effectively I think, optimally even. Though there is still the situation where you have a terrible database schema that is not what you want to map to your entities 1:1 AND you don't have the ability to create stored procedures. Maybe your database doesn't have the capability (like older versions of MySql) or perhaps it's just a policy of your company for some reason. For this, unfortunately I'm not sure what to do exactly. I can think of two solutions, one would be to create a custom database provider and translate those stored proc names into some sort of sql but this stinks of a hack. The other solution might be some sort of [Attribute] system in your entity definitions that tell the code generator how to formulate non-standard queries. Actually, I rather like that idea... It probably wouldn't be that hard at all. Well there's something for me to noodle on for a while. v3.0 maybe, LOL.&lt;br /&gt;&lt;br /&gt;Anyway, back to enjoying my summer afternoon (or just before noon)!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32922167-1463416103445303963?l=justnbusiness.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://justnbusiness.blogspot.com/feeds/1463416103445303963/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=32922167&amp;postID=1463416103445303963' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/32922167/posts/default/1463416103445303963'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/32922167/posts/default/1463416103445303963'/><link rel='alternate' type='text/html' href='http://justnbusiness.blogspot.com/2007/06/nearing-v20-release.html' title='Nearing v2.0 Release'/><author><name>Justin Chase</name><uri>http://www.blogger.com/profile/09465842474543801600</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_pcncuUNsA3Q/S2yelxM5vjI/AAAAAAAAAM0/nLIYJ8r-IQI/s1600-R/764863923_1f807d6ab3_m.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-32922167.post-7481963112152631647</id><published>2007-06-07T08:14:00.001-07:00</published><updated>2007-06-07T22:17:19.475-07:00</updated><title type='text'>The 5 Laws of Code Generation</title><content type='html'>A colleague of mine from Magenic has written an blog about code generation which summarizes a conversation we've been having:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://blog.magenic.com/blogs/jons/archive/2007/06/06/Thinking-about-Code-Generation.aspx"&gt;http://blog.magenic.com/blogs/jons/archive/2007/06/06/Thinking-about-Code-Generation.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I really like this post because it nicely lists all of the aspects of code generation that I have been thinking about but haven't been able to put into words. What's nice is that I've tried to address each of these problems with NBusiness in one way or another. Some of these solutions are somewhat unique, especially in terms of the Template system. The following are descriptions of how NBusines resolves the issues outlined by Jon in his post.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;em&gt;CSLA places most of the "heavy lifting" in a set of common base classes&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;NBusiness does not use &lt;a href="http://www.lhotka.net/Area.aspx?id=4"&gt;CSLA&lt;/a&gt;, instead it comes with a light weight, medium-trust, business object framework. It mirrors most of the core features of CSLA as a business object framework but does so in a very different way (due to the need for medium trust). However there is no reason why NBusiness couldn't be used in conjunction with CSLA (or any other framework) since it is template driven but I wanted the official distribution to be completely self contained for now.&lt;br /&gt;&lt;br /&gt;&lt;em&gt;I have some fairly specific "technical requirements" that I think that code generation has to to provide:&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;To me this list is like the "10 commandments" of code generation. Only there are 5, so let's go with the "5 laws of code generation". I'll summarize his list and try to explain how NBusiness conforms to these laws.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;em&gt;1. Code generation is controlled through modifiable templates. &lt;/em&gt;&lt;br /&gt;&lt;br /&gt;In NBusiness everything is generated by a template. Rather than using any of the existing template schemes (as far as I know) NBusiness takes a unique, more object oriented, approach. The templates themselves are actual classes that inherit from a Template base class. They contain a single method with the signature "ResourceFile[] Generate(Entity[] entities)". The resource files contain a byte[] and path for the resulting files (you could concievably generate images or other binary resources based on entities this way). Of course what goes on in the Generate method is completely up to the template developer. Furthermore, this scheme allows for inheritance in templates. So, for example, if you decided to use one of the templates that came with NBusiness but you just don't quite like one line of the output, you can create your own template and override an appropriate virtual method and customize the output yourself without destroying the original template. This more object oriented approach brings forth some interesting possiblities.&lt;br /&gt;&lt;br /&gt;There is also a notion of template "dependencies", which allows you to selectively generate code if an Entity contains a template that fulfills a dependency. For example if you have a template for generating an EntityBaseCollection object, you'll naturally need an EntityBase object to be generated as well. Therefore the EntityBaseCollectionTemplate is dependent on the EntityBaseTemplate. This problem arises quite a bit and this solution is very helpful for solving these issues. Without it you end up getting to a point where you might as well just make one giant template and apply it to all of your entities rather than selectively implementing only what a particular entity needs.&lt;br /&gt;&lt;br /&gt;&lt;em&gt;2. Code generation is done during the build process.&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;This law is one of NBusiness' best features. Not only is done during the build process the NBusiness engine is actually a compiler. In fact the artifact that NBusiness produces is a class library rather than simply a set of classes to be loaded into a seperate class library project. In v2.0 this is automated fully by means of Visual Studio Integration. You litterally have an E# project that can be referenced by your other projects as intuitively as you would any normal class library.&lt;br /&gt;&lt;br /&gt;&lt;em&gt;3. Code generation is done from an intermediate format.&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;This law is very important to me. NBusiness goes one step further than what Jon is suggesting as the optimal solution however. Jon suggests using XML that is (optionally) generated from a database schema, which I couldn't agree more as the right solution to the problem. However instead of XML NBusiness features an Entity Definition Language known as E#. It is essentially the same thing: a set of meta data that describes your entities. However it is my belief that XML really isn't as developer friendly as what is really needed. Rather than creating all sorts of grahpical development tools that allows a developer to manipulate this XML what is really optimal is to have a model that is the same as what most developers are currently most familiar and productive with, which is code. E# (in v2.0) has visual studio integration which comes complete with syntax hilighting and intellisense and allows a developer to build their entity meta data in a style similar to what they are already familiar with. The only barrier is that you have to learn "yet another language" to do it. E# strives to be extremely simple by having syntax similar to C# and it is also fairly VB-ish in how the keywords flow. Intellisense helps quite a bit as well of course.&lt;br /&gt;&lt;br /&gt;&lt;em&gt;4. The intermediate format is under source code control with versioning. &lt;/em&gt;&lt;br /&gt;&lt;br /&gt;This law is helpful for restricting the definition of what the intermediate format is. I would suggest an ammendment to this law that states the intermediate format must also be such that it is compatible with "merging" features of source code control. This will promote the ideal of having this data as plain text rather than a custom binary format. Of course, since E# is defined in source code files it meets this law fully.&lt;br /&gt;&lt;br /&gt;&lt;em&gt;5. The code generation templates are also under source code control.&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;Again I would ammend this with the mergability rules from #4. In the case of NBusiness the base templates are source code files currently under source control at CodePlex while custom templates would simply be class files somewhere in your project, which is absolutely compatible with source code control.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The next section of Jon's post addresses more of the features required of a business object framework as they relate to code generators. This is an important distinction because, while NBusiness has such a framework, it could certainly be used to target any 3rd party business object framework which may or may not conform to these rules. This is mostly a concern of the templates but there are definitely accommodations for a particular style that need to be taken in the framework itself. NBusiness' default business object framework takes the second style, where partial classes are used to accomodate custom code.&lt;br /&gt;&lt;br /&gt;To me the main benefit of this is the cleanliness of the resulting object model. While I'd concede that the base/child style is functionally fine, I would argue that having fewer classes is far superior. The tradeoff, is that you end up having to expose many events in order to provide extensibility points for the other parts but this is ok to me. In fact in NBusiness there is a feature called "&lt;a href="http://www.codeplex.com/NBusiness/Wiki/View.aspx?title=Specifying%20actions"&gt;actions&lt;/a&gt;" that allow you to define the behavior of an entity as a method. These actions can optionally be attached to these extensibility events and even be automatically executed asynchronously. This action method is implemented by the developer in a partial class or even as a static method on another class entirely. So these events would be there anyway.&lt;br /&gt;&lt;br /&gt;An example of this might be a "TransferMoney" action on a BankAccount entity. Or a Log method attached to the "persisting" event, etc. You can envision how useful it is to define your entites behaviours in the entity definition itself. The architect can define everything and the code monkey can implement it.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;So with Jon's post in mind I propose the 5 laws of code generation:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;&lt;em&gt;Code generation is controlled through modifiable templates. &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;em&gt;Code generation is done during the build process.&lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;em&gt;Code generation is done from an intermediate format.&lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;em&gt;The intermediate format must be versionable and mergeable.&lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;em&gt;The code generation templates must be versionable and mergeable.&lt;/em&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32922167-7481963112152631647?l=justnbusiness.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://justnbusiness.blogspot.com/feeds/7481963112152631647/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=32922167&amp;postID=7481963112152631647' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/32922167/posts/default/7481963112152631647'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/32922167/posts/default/7481963112152631647'/><link rel='alternate' type='text/html' href='http://justnbusiness.blogspot.com/2007/06/5-laws-of-code-generation.html' title='The 5 Laws of Code Generation'/><author><name>Justin Chase</name><uri>http://www.blogger.com/profile/09465842474543801600</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_pcncuUNsA3Q/S2yelxM5vjI/AAAAAAAAAM0/nLIYJ8r-IQI/s1600-R/764863923_1f807d6ab3_m.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-32922167.post-3650529649402925908</id><published>2007-05-12T00:38:00.000-07:00</published><updated>2007-05-12T10:45:44.706-07:00</updated><title type='text'>Bugsville</title><content type='html'>&lt;div&gt;&lt;div&gt;&lt;br /&gt;&lt;div&gt;&lt;strong&gt;DOH!&lt;/strong&gt; &lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;I have been stumped on my VSIP work for the last week or so. Progress has been very slow fixing the code I &lt;em&gt;stole&lt;/em&gt; from the IronPython project to get my "simple" language project working. It's very hard to debug and the code get's very dense very quickly. I learned something new today too, which is pretty surprising: don't rely on quotes when searching google. &lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;I had been searching for a quoted block of text for my error message [&lt;a href="http://www.google.com/search?q=%22Could+not+get+dependencies+for+project+reference%22&amp;rls=com.microsoft:*&amp;amp;amp;amp;amp;ie=UTF-8&amp;oe=UTF-8&amp;amp;startIndex=&amp;startPage=1"&gt;"Could not get dependencies for project reference"&lt;/a&gt;] to try to locate some information about this mystery bug. This is the literal text of the error message. You'll notice there are about 5 results, none of which are very helpful. After a week of digging through code and yielding nothing I scrapped together a different query [&lt;a href="http://www.google.com/search?q=could+not+get+project+reference+web&amp;amp;hl=en&amp;rls=com.microsoft:*&amp;amp;start=10&amp;sa=N"&gt;Could not get project reference web&lt;/a&gt;], I got rid of 'dependencies' and 'for' and added the word web and low and behold we get &lt;a href="https://connect.microsoft.com/feedback/viewfeedback.aspx?FeedbackID=276380&amp;amp;wa=wsignin1.0&amp;siteid=210"&gt;this link&lt;/a&gt; in the first page. If you check out the "actual results" section on the bug report you'll see the quoted string "Could not get dependencies for project reference"! Which was my EXACT quoted query to google. Yet it did not yield results. Just goes to show you, a few select words is really the sweet spot for google. Their advanced query options aren't very good.&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;This might be an ok time to continue griping about Google. Don't get me wrong I really like Google overall and their website is still my home page but I do have a few gripes. &lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;1.) When I was in college I had an &lt;a href="http://www.d.umn.edu/~chas0084/UROP/"&gt;undergraduate research project&lt;/a&gt; (don't laugh, I don't have permissions to edit that page anymore :-P ) that used the Google API. It was fun and a really great way to learn about web services and .NET and at one point in time I was featured on &lt;a href="http://code.google.com/"&gt;http://code.google.com/&lt;/a&gt; as the featured project since their API was relatively new (this was just before Google maps API) and the project attempted to use Mono as well. Anyrate, so because I was featured on their page they offered to send me a Google T-Shirt as a gift. I thought that was pretty cool but no tshirt ever came. After harassing Chris DiBona at Google for almost a year he finally sent me the shirt as well as a spiffy lava lamp (that was the year of lava lamps since I inherited one from a friend, got one from Google and got one from my dad for Christmas... go figure). So they made some amends, which is good, but it's worth mentioning that waiting for a year for a Google T-Shirt is torture.&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;2.) The Google API is a scam. It's essentially a marketing ploy. As I mentioned in number 1 I worked on the Google API for an undergraduate research project but beyond that, if you go to the Google API usenet group you'll notice that I'm the #1 &lt;a href="http://groups.google.com/group/google.public.web-apis/about"&gt;all time poster&lt;/a&gt; by far. Actually Manfred seems to be catching up. But anyway, the first half of the posts were me geniunely caring but the second half were me pretty much answering the same 3 questions over and over again:&lt;/div&gt;&lt;ol&gt;&lt;li&gt;"I can't download the Google API zip file, can someone email it to me?"&lt;/li&gt;&lt;li&gt;"Why are the search results different from the API than from the web site?"&lt;/li&gt;&lt;li&gt;"How do I use the webservice in language X?"&lt;/li&gt;&lt;/ol&gt;&lt;div&gt;Ok, #2 is the real problem. Why are they different? Well because they don't use the same databases for the API as they do for production. Which is incredibly lame, what is the point of only being able to query a subset of the data? There was one guy who was running the exact same query over and over every day and tracking the changes, the API never changed and the website was changing dramatically every day. The were essentially just using a set of junk data they ripped from their main databases but was never updated. Anyrate, there is a (relatively) new development you can read in &lt;a href="http://groups.google.com/group/google.public.web-apis/browse_thread/thread/60e1cf592a9c1410/58c5a90057fc8588?lnk=gst&amp;amp;amp;q=query+every+day&amp;rnum=4#58c5a90057fc8588"&gt;this thread&lt;/a&gt; saying that the Google SOAP API has officially been shutdown in place of some AJAX search API. I'm not sure what the difference is... anyway it was really dissapointing to realize how lame the search API was after putting so much effort into it.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;3.) What the hell is up with their desktop application suite? Is it just me or is it the biggest pile of crap? It &lt;em&gt;totally&lt;/em&gt; goes against their sacred standards of simplicity. It is one of the most monstrous conglomerates of useless applications. In fact this has been a Google theme of late. Their &lt;a href="http://www.google.com/ig"&gt;iGoogle&lt;/a&gt; homepage site has become more and more bloated by widgets and tabs and themes and what not... UGH, please make it stop! The only reason I use that iGoogle site is so I can get a quick link to my gmail inbox and a quick wikipedia search box. Please Google, return to blissful simplicity! Let Microsoft bumble around with their bloated search home page, if you don't I'll be forced to switch to live.com, which doesn't quite have the quality search results but it loads up as a homepage much faster. I don't want a million javascript widgets that drag and expand and move and crap all over my homepage! I want it to load quickly and provide me an opportunity to get where I want in a few clicks. &lt;/div&gt;&lt;br /&gt;&lt;div&gt;I feel like an old man complaining like this :) Anyway, I do have some great news to report for NBusiness (other than that damn SDK error). I have rudimentary intellisense and syntax hilighting working, I have the ability to add a reference to NBusiness through the ".net" tab of add a reference dialog and I have nested .cs files based on the names of the files (notice the expanded Company.es file in the solution explorer. I haven't quite figured out how to hook up the icons to the filetypes however. It seems to be pretty tricky, lot's of registry keys that are very strange. There are plenty of things left to resolve but hopefully I'll get a &lt;a href="http://www.codeplex.com/NBusiness/Release/ProjectReleases.aspx?ReleaseId=3900"&gt;usable beta&lt;/a&gt; up on codeplex this weekend. Here are some screens:&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;a href="http://3.bp.blogspot.com/_pcncuUNsA3Q/RkX6g_pw-MI/AAAAAAAAAIw/pMAhJ6J9R_o/s1600-h/addref.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5063728800797358274" style="CURSOR: hand" alt="" src="http://3.bp.blogspot.com/_pcncuUNsA3Q/RkX6g_pw-MI/AAAAAAAAAIw/pMAhJ6J9R_o/s400/addref.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;a href="http://1.bp.blogspot.com/_pcncuUNsA3Q/RkX6rfpw-NI/AAAAAAAAAI4/WvZjIYkxw9c/s1600-h/intellisense1.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5063728981185984722" style="CURSOR: hand" alt="" src="http://1.bp.blogspot.com/_pcncuUNsA3Q/RkX6rfpw-NI/AAAAAAAAAI4/WvZjIYkxw9c/s400/intellisense1.png" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://4.bp.blogspot.com/_pcncuUNsA3Q/RkX6yPpw-OI/AAAAAAAAAJA/jRxhm8tr4cs/s1600-h/intellisense2.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5063729097150101730" style="CURSOR: hand" alt="" src="http://4.bp.blogspot.com/_pcncuUNsA3Q/RkX6yPpw-OI/AAAAAAAAAJA/jRxhm8tr4cs/s400/intellisense2.png" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32922167-3650529649402925908?l=justnbusiness.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://justnbusiness.blogspot.com/feeds/3650529649402925908/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=32922167&amp;postID=3650529649402925908' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/32922167/posts/default/3650529649402925908'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/32922167/posts/default/3650529649402925908'/><link rel='alternate' type='text/html' href='http://justnbusiness.blogspot.com/2007/05/bugsville.html' title='Bugsville'/><author><name>Justin Chase</name><uri>http://www.blogger.com/profile/09465842474543801600</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_pcncuUNsA3Q/S2yelxM5vjI/AAAAAAAAAM0/nLIYJ8r-IQI/s1600-R/764863923_1f807d6ab3_m.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_pcncuUNsA3Q/RkX6g_pw-MI/AAAAAAAAAIw/pMAhJ6J9R_o/s72-c/addref.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-32922167.post-377060967905170760</id><published>2007-04-12T19:41:00.000-07:00</published><updated>2007-04-12T20:16:11.131-07:00</updated><title type='text'>Visual Studio Plugin Breakthrough</title><content type='html'>Well I've been working on a visual studio plugin for NBusiness here since v1 was released. I've encountered a few small bugs and have a host of changes I hope to make to the compiler for v2 but I've mainly just been focused on getting this plugin "working". There is a seemingly infinte list of things I need to fix still but I had a major breakthrough today in my progress! &lt;div&gt; &lt;/div&gt;&lt;div&gt;I'll try to lay out what I'm hoping the plugin will do and give a few nice little screen shots of my current development environment then I'll spend a bit of time ranting about the process of creating VS plugins and I'll even try to drop a few gems of advice for anyone trying to do something similar.&lt;br /&gt;&lt;/div&gt;&lt;div&gt;First I'll give the most basic requirements I had for this plugin:&lt;/div&gt;&lt;ol&gt;&lt;li&gt;I want to be able to click File-&gt;Project-&gt;Visual E#-&gt;Entity Library&lt;/li&gt;&lt;li&gt;I want to be able to add and edit es/cs files directly to my entity library. (Also add embedded files).&lt;/li&gt;&lt;li&gt;I want to be able to add references to my entity library project from other projects.&lt;/li&gt;&lt;li&gt;When I click build the end result yields a .dll that other projects get by reference.&lt;/li&gt;&lt;li&gt;I want intellisense and syntax hilighting.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;Here is a snapshot of me adding an Entity Library via the File-&gt;Add New-&gt;Project menu!&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_pcncuUNsA3Q/Rh7vzkrvlpI/AAAAAAAAAIQ/IBoE09cDp6k/s1600-h/EntityProject2.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5052739501255792274" style="CURSOR: hand" alt="" src="http://2.bp.blogspot.com/_pcncuUNsA3Q/Rh7vzkrvlpI/AAAAAAAAAIQ/IBoE09cDp6k/s320/EntityProject2.png" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Here is a snapshot of my dev environment with everything else hooked up (except intellisense and syntax hilighting): &lt;/p&gt;&lt;div&gt;&lt;a href="http://1.bp.blogspot.com/_pcncuUNsA3Q/Rh7wSUrvlqI/AAAAAAAAAIY/6g2HKtnmcIk/s1600-h/EntityProject.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5052740029536769698" style="CURSOR: hand" alt="" src="http://1.bp.blogspot.com/_pcncuUNsA3Q/Rh7wSUrvlqI/AAAAAAAAAIY/6g2HKtnmcIk/s400/EntityProject.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;So to get this far I basically just opened up the IronPython example that comes with the visual studio SDK and looked over every square inch of code. There were a couple minor areas of confusion that ended up turning into extreme time delays that I'll warn you about here. &lt;/p&gt;&lt;p&gt;For one thing beware the confusion of naming your language! I had "Visual E#" and "ESharp" and "NBusiness" here and there and nothing seemed to work right. In certain areas it expects the names to match up and if they don't then good luck figuring out what is wrong... Basically I would reccomend simply picking one name (like "ESharp") and using that everywhere. Then after things are working right start tentatively renaming things so they look pretty. That will save you enormous amounts of time.&lt;/p&gt;&lt;p&gt;Another extreme area of confusion was how the heck you get the .zip templates into the right location! Well I was a little lucky because I know a thing or two about MSBuild but in case you weren't aware, it turns out that it is possible to put custom MSBuild tasks &lt;em&gt;manually&lt;/em&gt; into your project file (via notepad for example). This is what they did in IronPython and unless you're really paying attention it almost seems like magic how things end up where they do. This is also how they get the .targets file in the right location during build time.&lt;/p&gt;&lt;p&gt;Also, I know it seems ridiculous how Microsoft developed the bulk of their (useful) managed API for VS as plain C# files rather than compiling it for us into an Assembly but trust me, it's worth just adding the damn files to your project and building them. The sheer amount of code you would have to write is staggering, so much seemingly useless cookie cutter code... I have no idea why it isn't just an assembly you reference. But also beware that some of those project files litterally have python specific strings in them! Watch out for embedded resources being loaded by invalid paths due to namespace differences and do a vigorous "Find All" for "py". Get it all out of there!&lt;/p&gt;&lt;p&gt;I'm trying to look over the carnage that is my Visual Studio plugin to see if I can relay anything else useful but all I can think of to say is that if you're planning on creating a custom language for Visual Studio be sure to either have someone who already knows how to make them help you or plan about a month of hard core hacking to get the basics working. This has probably been the hardest (managed, I've seen nastier C++) code I've ever had to work with... I'm going to lose sleep just thinking about what I'll need to do to get intellisense and syntax hilighting to work!&lt;/p&gt;&lt;p&gt;Oh yeah I'll probably be cooking up a beta installer for this pretty soon if anyone wants to try it out. Stay tuned for new blogs or just IM me.&lt;/p&gt;&lt;p&gt;All bitching aside I would just like to say that having this power integrated directly into VS is pretty exciting. When I first got it to build my entity I was litterally shaking slightly afterwards. This really opens up a whole new world for this project and will hopefully bring some legitimacy to the idea of it really being viable. I definitely look forward getting this plugin out the door!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32922167-377060967905170760?l=justnbusiness.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://justnbusiness.blogspot.com/feeds/377060967905170760/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=32922167&amp;postID=377060967905170760' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/32922167/posts/default/377060967905170760'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/32922167/posts/default/377060967905170760'/><link rel='alternate' type='text/html' href='http://justnbusiness.blogspot.com/2007/04/visual-studio-plugin-breakthrough.html' title='Visual Studio Plugin Breakthrough'/><author><name>Justin Chase</name><uri>http://www.blogger.com/profile/09465842474543801600</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_pcncuUNsA3Q/S2yelxM5vjI/AAAAAAAAAM0/nLIYJ8r-IQI/s1600-R/764863923_1f807d6ab3_m.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_pcncuUNsA3Q/Rh7vzkrvlpI/AAAAAAAAAIQ/IBoE09cDp6k/s72-c/EntityProject2.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-32922167.post-1696211569875027671</id><published>2007-03-20T19:49:00.000-07:00</published><updated>2007-03-24T07:29:32.565-07:00</updated><title type='text'>Version 1.0 Released!</title><content type='html'>Finally!&lt;br /&gt;&lt;br /&gt;Head over to &lt;a href="http://www.codeplex.com/nbusiness"&gt;http://www.codeplex.com/nbusiness&lt;/a&gt; to check it out.&lt;br /&gt;&lt;br /&gt;After touching up little issues here and there for the last couple of weeks (and getting side tracked by XNA) I have finally managed to roll out a v1.0 release of NBusiness! This version is useable but almost certainly not perfect. I can already see a few areas in need of improvement such as the cacheable collection and even optimizing the compiler itself. No doubt the templates will be endlessly configurable, not to mention creating entirely new templates.&lt;br /&gt;&lt;br /&gt;Despite how happy I am to have this project at this stage ,so I can finally start some of the more interesting features I've been putting off, I am mostly glad because I actually want to USE NBusiness for my own projects (I have a &lt;a href="http://kegbot.org"&gt;kegbot&lt;/a&gt; project in process). In fact this is why I started this project to begin with, I had been kicking around the idea in my head for a while because of some of the things I had been doing at work (working on a business object code generator), reading a compiler book at some point and then realizing that I wasn't going to be able to use CSLA (&lt;a href="http://www.lhotka.net"&gt;www.lhotka.net&lt;/a&gt;) on my go daddy website because of medium trust issues. I then decided to just do it, I wrote almost all of the business objects for that site by hand and just got tired of it and started making the compiler. Now I could crank them all out (sql included) in less than a day. And look it only took me about 6 months longer than if I had just done them all by hand! But seriously, I feel pretty good about NBusiness, and I hope others do too.&lt;br /&gt;&lt;br /&gt;I've made a branch for v2 already (in anticipation of bug fixes for v1) and have begun work on a Visual Studio plugin. If anyone has had any experience working with language services and custom project types for visual studio please let me know! This is unbelieveably complicated stuff and I am wading through it all by myself at this point. It would be really nice to see Microsoft produce a purely .NET visual studio SDK. The plethora of COM interfaces is absolutely mind boggling... The Iron Python example is enormously helpful but it is also enormously complex. I would like to see a step by step example of how to get a &lt;em&gt;simple&lt;/em&gt; Iron Python like project created.&lt;br /&gt;&lt;br /&gt;Also, I would like to give a special thanks to Kyle Leneau, who did all of the artwork and helped make the example site look a lot better. Also his interst helped fuel my interest, which is very helpful when you're working on something as long as I have been. Also, thanks to Rocky Lhotka for helping bend my mind which drove me into creating this project to begin with and thanks to Ben Reichelt for taking moments here and there to discuss some of the more arcane aspects of business objects and databases. But no thanks to Beau Crawford for holding onto the managed data access layer he promised me! :-P Also, thanks to everyone else who tried it out at various stages and gave me feedback.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32922167-1696211569875027671?l=justnbusiness.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://justnbusiness.blogspot.com/feeds/1696211569875027671/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=32922167&amp;postID=1696211569875027671' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/32922167/posts/default/1696211569875027671'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/32922167/posts/default/1696211569875027671'/><link rel='alternate' type='text/html' href='http://justnbusiness.blogspot.com/2007/03/version-10-released.html' title='Version 1.0 Released!'/><author><name>Justin Chase</name><uri>http://www.blogger.com/profile/09465842474543801600</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_pcncuUNsA3Q/S2yelxM5vjI/AAAAAAAAAM0/nLIYJ8r-IQI/s1600-R/764863923_1f807d6ab3_m.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-32922167.post-116968783991989394</id><published>2007-01-24T16:34:00.000-08:00</published><updated>2007-02-15T09:01:31.360-08:00</updated><title type='text'>Custom Actions</title><content type='html'>So I just finished adding in the final main feature of the E# language. I've been kicking around a few other ideas but have discarded them (at least for now) and I'm pretty sure that this is it. Actually, I still have to add the ability to declare an "expression" but that should be pretty simple compared to everything else.&lt;br /&gt;&lt;br /&gt;So the new feature I'm talking about of course is the "action" declaration feature. This brings me one step closer to the philosophy that Rocky Lhotka has been talking about, which is that business objects should be defined by behavior and not data. In this case, as you're designing your entities you can specify the behavior in a lot of ways and one of them is by declaring an action. Here is an example:&lt;br /&gt;&lt;pre&gt;family Business&lt;br /&gt;{&lt;br /&gt;    entity Example&lt;br /&gt;    {&lt;br /&gt;        action DoWork when changed;&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;In the above example we declare the action "DoWork" and specify it to be executed when the entity has been changed. There are about 20 reserved event keywords (such as deleting, deleted, fetching, fetched, persisting, validating, accessed, etc.) that you can attach your actions to. Also you can choose to not attach them to anything at all by leaving off the when clause entirely. So here are some other examples of declaring actions:&lt;br /&gt;&lt;br /&gt;action Log on Business.Custom.Utilities when changed;&lt;br /&gt;action ProcessMessage when persisted async;&lt;br /&gt;&lt;br /&gt;The "on ..." syntax specifies the object in which the expected method of this action is to be found. This requires the actions method to be static, whereas not specifying an "on" clause requires the method to be part of "this", which means it must be defined in a partial class. Also the "async" specifier will execute that event asynchronously rather than the standard synchronous execution. The "async" keyword only applies to actions with a when clause.&lt;br /&gt;&lt;br /&gt;So you might ask yourself why you would want to specify actions? Well it's pretty nice really, the whole point is that when you are wearing the architect hat you want to think about your problem not so much as just what types of data you need to pass around but as what types of behavior you want fulfilled. In this case as you are architecting your entities you would be able to specify which actions are exepcted of it, beyond the behaviors implied by persistence, validation etc. The methods that these actions attach to are not generated by the E# compiler but instead they must be manually created. If they do not exist the compiler will complain and tell you that a method is missing. So as the architect you can specify the actions that the developers then have to go and implement them.&lt;br /&gt;&lt;br /&gt;Next you might ask, well what is going on under the hood? It turns out to be pretty simple really. The hardest part is just getting all the dang events coded and executing at the right times in the EntityBase class but what ends up happening from the templates perspective is that a method is implemented called Load_Actions and in there event handlers are added to the various events pointing to the specified methods which gets called at construction time. So if the method is not implemented the C# compiler will complain about it. The only trick is for actions that have no when clause specified. For this case I have added a protected event called Never, which the methods get attached to. The Never event never gets called (as you can imagine) but it will get the C# compiler to complain about missing methods! So that's my little hack of the day.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32922167-116968783991989394?l=justnbusiness.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://justnbusiness.blogspot.com/feeds/116968783991989394/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=32922167&amp;postID=116968783991989394' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/32922167/posts/default/116968783991989394'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/32922167/posts/default/116968783991989394'/><link rel='alternate' type='text/html' href='http://justnbusiness.blogspot.com/2007/01/custom-actions.html' title='Custom Actions'/><author><name>Justin Chase</name><uri>http://www.blogger.com/profile/09465842474543801600</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_pcncuUNsA3Q/S2yelxM5vjI/AAAAAAAAAM0/nLIYJ8r-IQI/s1600-R/764863923_1f807d6ab3_m.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-32922167.post-116841116919293436</id><published>2007-01-09T22:29:00.000-08:00</published><updated>2007-01-09T22:39:29.203-08:00</updated><title type='text'>Template Dependencies</title><content type='html'>So I decided to implement a template dependency system. The idea is that templates are sometimes dependent on other templates so rather than just having the whole thing blowup whenever the dependent template does not implement something I decided to create interfaces that would act as "contracts" between templates. So for example the EntityInfoTemplate implements the IInfoObject contract interface, which has the signature:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;namespace NBusiness.Templates.Contracts&lt;br /&gt;{&lt;br /&gt;    public interface IInfoObject&lt;br /&gt;    {&lt;br /&gt;        CodeMemberMethod GetInfoObjectMethod(Entity entity);&lt;br /&gt;&lt;br /&gt;        CodeMemberMethod ToInfoArrayMethod(Entity entity);&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;And since the EntityBaseTemplate is dependent on the presence of the EntityInfoTemplate in order to implement the GetInfoObject() method it can now use the Dependency.GetContract( ... ) method to determine if the EntityInfo template was assigned to the given entity and if that template implements the IEntityInfo method as required. So in templates where a template is dependent on an entity to have certain other methods/fields/properties/classes you can use the Dependency object. For example:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;#region Create GetInfoObject&lt;br /&gt;protected virtual void CreateGetInfoObject(Entity entity, CodeTypeDeclaration Declaration)&lt;br /&gt;{&lt;br /&gt;     IInfoObject getInfoObject = (IInfoObject)Dependency.GetContract("EntityInfo", typeof(IInfoObject), entity);&lt;br /&gt;     if(getInfoObject != null)&lt;br /&gt;     {&lt;br /&gt;          CodeMemberMethod m = getInfoObject.GetInfoObjectMethod(entity);&lt;br /&gt;          Declaration.Members.Add(m);&lt;br /&gt;     }&lt;br /&gt;     else&lt;br /&gt;     {&lt;br /&gt;          OnWarning(new TemplateWarning(&lt;br /&gt;               this,&lt;br /&gt;               this.GetType().GetMethod("CreateGetInfoObject", BindingFlags.NonPublic  BindingFlags.Instance),&lt;br /&gt;               Resources.IGetInfoObjectWarning));&lt;br /&gt;     }&lt;br /&gt;}&lt;br /&gt;#endregion&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32922167-116841116919293436?l=justnbusiness.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://justnbusiness.blogspot.com/feeds/116841116919293436/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=32922167&amp;postID=116841116919293436' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/32922167/posts/default/116841116919293436'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/32922167/posts/default/116841116919293436'/><link rel='alternate' type='text/html' href='http://justnbusiness.blogspot.com/2007/01/template-dependencies.html' title='Template Dependencies'/><author><name>Justin Chase</name><uri>http://www.blogger.com/profile/09465842474543801600</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_pcncuUNsA3Q/S2yelxM5vjI/AAAAAAAAAM0/nLIYJ8r-IQI/s1600-R/764863923_1f807d6ab3_m.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-32922167.post-116805351031594239</id><published>2007-01-05T18:43:00.000-08:00</published><updated>2007-01-05T19:19:24.443-08:00</updated><title type='text'>Changes to the templating system</title><content type='html'>So I've been struggling to find the best way to work out the template system and even though I'm not 100% certain that I found the best way to do it I think it is pretty good right now and I actually feel satisfied with it. Though I would like to come up with some ways to have a "control" like system for templates (reusable parts of templates) I'm just not sure how to do this yet so I'm still happy with 1 big template. So I made some fundamental syntax changes with the language and I sorta like it.&lt;br /&gt;&lt;br /&gt;Previously you would have to specify which templates you wanted to use at compile time, then it would take all of your Entities and put them into each template. I toyed with having different template types such as a Family template and an Entity template where it would put each family or each entity into the template but I just never liked that much. Not only was it not elegant enough but it also ended up being a bit confusing and didn't solve any issues of strong coupling between templates or limitations with wanting a template to apply to only specific entities. So here is an example of the new system:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;family Example&lt;br /&gt;{&lt;br /&gt;     template Custom as Example.Templates.Custome in Example.Templates;&lt;br /&gt;&lt;br /&gt;     entity Test as Custom&lt;br /&gt;     { }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;In this example the template is explictly declared in the family,&lt;br /&gt;this is one of the new changes. Additionally, the entity is assigned templates using the "as" clause. Currently it must only use templates found in the same family, though it might make sense to allow you to specify the fullname of the template to get to templates in other families.&lt;br /&gt;&lt;br /&gt;So during compile time the template will be created by the Activator class and the list of all entities defined for that template are passed into it. This gives the developer the ability to specify which entities specifically get passed to the template rather than an all or none sort of deal. Additionally it gives the template developer the ability to see what templates an entity is assigned to as well as entities in relationships. So if, for example, a particular entity does not use a "list" template then your template should not create a list property for a type that will not be generated.&lt;br /&gt;&lt;br /&gt;For example, suppose you want to create a method on your EntityBase classes GetInfoObject(), which will return a simple Info object representation of your class. Now in the old system you've just coupled your template together with an EntityInfoTemplate, which makes me ask the question why have seperate templates at all? Why not just have one template that spins through the families and generates everything just the way you want it? Well that just isn't as flexible and extensible as I would like. So in this new system you are optionally coupling yourself to the info object template because you can actually look to see if your entity calls for an InfoObject template before you create the method which would return a type that will not be generated.&lt;br /&gt;&lt;br /&gt;Like I said, I'm not 100% certain this is the perfect way to do this but I think it brings me a little bit closer to the nebulous "control" design pattern for the template system that I cannot quite envision yet.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32922167-116805351031594239?l=justnbusiness.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://justnbusiness.blogspot.com/feeds/116805351031594239/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=32922167&amp;postID=116805351031594239' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/32922167/posts/default/116805351031594239'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/32922167/posts/default/116805351031594239'/><link rel='alternate' type='text/html' href='http://justnbusiness.blogspot.com/2007/01/changes-to-templating-system.html' title='Changes to the templating system'/><author><name>Justin Chase</name><uri>http://www.blogger.com/profile/09465842474543801600</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_pcncuUNsA3Q/S2yelxM5vjI/AAAAAAAAAM0/nLIYJ8r-IQI/s1600-R/764863923_1f807d6ab3_m.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-32922167.post-116801427053385284</id><published>2007-01-05T08:21:00.000-08:00</published><updated>2007-01-05T08:24:30.546-08:00</updated><title type='text'>Dynamic sorting and paging</title><content type='html'>I ran into an interesting problem recently, trying to allow my EntityDataSource control to implement dynamic paging and sorting. There are some tricky ways to do either one fairly easily but to do both at the same time? Well let's just say it's not trivial. SO there might be a better way and I'd be happy to find out from others how to do this more simply but here is a snippet of how I got it to work (for sql2005):&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;ALTER PROCEDURE [dbo].[CompanyListFetchByRegion]&lt;br /&gt;@RegionId int,&lt;br /&gt;@StartIndex int = 0,&lt;br /&gt;@MaxRows int = -1,&lt;br /&gt;@SortField varchar(35) = null,&lt;br /&gt;@SortOrder int = 0,&lt;br /&gt;@TotalRows int = 0 output&lt;br /&gt;AS&lt;br /&gt;BEGIN&lt;br /&gt;&lt;br /&gt;SET NOCOUNT ON;&lt;br /&gt;DECLARE @Temp TABLE&lt;br /&gt;(&lt;br /&gt;TempId int IDENTITY(1,1) PRIMARY KEY,&lt;br /&gt;[CompanyId] int,&lt;br /&gt;[Name] varchar(50),&lt;br /&gt;AddressId int,&lt;br /&gt;Url varchar(128),&lt;br /&gt;Phone varchar(16)&lt;br /&gt;)&lt;br /&gt;&lt;br /&gt;IF @SortOrder = 2&lt;br /&gt;BEGIN&lt;br /&gt;INSERT INTO @Temp ([CompanyId],[Name],AddressId,Url,Phone)&lt;br /&gt;SELECT C.*&lt;br /&gt;FROM [Company] AS C INNER JOIN [Address] AS A&lt;br /&gt;ON C.AddressId=A.AddressId&lt;br /&gt;WHERE A.[RegionId]=@RegionId&lt;br /&gt;ORDER BY&lt;br /&gt;CASE @SortField&lt;br /&gt;WHEN 'Name' THEN cast (C.[Name] as sql_variant)&lt;br /&gt;WHEN 'AddressId' THEN C.AddressId&lt;br /&gt;WHEN 'Url' THEN cast (C.Url as sql_variant)&lt;br /&gt;WHEN 'Phone' THEN C.Phone&lt;br /&gt;ELSE C.[CompanyId]&lt;br /&gt;END&lt;br /&gt;DESC -- descending&lt;br /&gt;END&lt;br /&gt;ELSE -- Sort order == 1 or 0&lt;br /&gt;BEGIN&lt;br /&gt;INSERT INTO @Temp ([CompanyId],[Name],AddressId,Url,Phone)&lt;br /&gt;SELECT C.CompanyId, C.[Name], C.AddressId, C.Url, C.Phone&lt;br /&gt;FROM [Company] AS C INNER JOIN [Address] AS A&lt;br /&gt;ON C.AddressId=A.AddressId&lt;br /&gt;WHERE A.[RegionId]=@RegionId&lt;br /&gt;ORDER BY&lt;br /&gt;CASE @SortField&lt;br /&gt;WHEN 'Name' THEN cast ([Name] as sql_variant)&lt;br /&gt;WHEN 'AddressId' THEN C.AddressId&lt;br /&gt;WHEN 'Url' THEN cast (Url as sql_variant)&lt;br /&gt;WHEN 'Phone' THEN Phone&lt;br /&gt;ELSE [CompanyId]&lt;br /&gt;END&lt;br /&gt;ASC -- ascending&lt;br /&gt;END&lt;br /&gt;-- Get the total row count, used for paging.&lt;br /&gt;SET @TotalRows = (SELECT COUNT(TempId) FROM @Temp);&lt;br /&gt;-- If paging is specified&lt;br /&gt;IF (@MaxRows &gt; -1)&lt;br /&gt;BEGIN&lt;br /&gt;SELECT * FROM @Temp&lt;br /&gt;WHERE TempId &gt;= @StartIndex&lt;br /&gt;AND TempId &lt; @StartIndex + @MaxRows + 1&lt;br /&gt;END&lt;br /&gt;-- Else return it all!&lt;br /&gt;ELSE SELECT * FROM @Temp;&lt;br /&gt;END&lt;br /&gt;&lt;br /&gt;Good luck!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32922167-116801427053385284?l=justnbusiness.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://justnbusiness.blogspot.com/feeds/116801427053385284/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=32922167&amp;postID=116801427053385284' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/32922167/posts/default/116801427053385284'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/32922167/posts/default/116801427053385284'/><link rel='alternate' type='text/html' href='http://justnbusiness.blogspot.com/2007/01/dynamic-sorting-and-paging.html' title='Dynamic sorting and paging'/><author><name>Justin Chase</name><uri>http://www.blogger.com/profile/09465842474543801600</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_pcncuUNsA3Q/S2yelxM5vjI/AAAAAAAAAM0/nLIYJ8r-IQI/s1600-R/764863923_1f807d6ab3_m.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-32922167.post-116689120760366587</id><published>2006-12-23T07:39:00.000-08:00</published><updated>2006-12-23T08:28:31.733-08:00</updated><title type='text'></title><content type='html'>So I'm coming down to a real beta1 release. I've been polishing things up and trying to get some bug fixes for everything I can find and stream line the example web site for demo purposes. I even cooked up some graphics and a logo! Check this out:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://photos1.blogger.com/x/blogger/327/378/1600/953358/logo.png"&gt;&lt;img style="FLOAT: left; MARGIN: 0px 10px 10px 0px; CURSOR: hand" alt="" src="http://photos1.blogger.com/x/blogger/327/378/320/611861/logo.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;So I'm planning on using this as the new logo for now, I like the pleasantly corny one liner "Now we're NBusiness". I am no artist by any stretch but I'm reasonably happy with it so far I'm thinking that the N should maybe be twisted just a little so that it appears to be printed on the briefcase rather than floating on it... but i don't have the tools or the skillz to do that. If anyone thought that they might want to try it out let me know and I can email you the layers (you can also get them out of the source code at &lt;a href="http://www.codeplex.com/NBusiness/SourceControl/ListDownloadableCommits.aspx"&gt;Code Plex&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;I'll probably release the beta on tuesday, after christmas to help maximize exposure on codeplex... but then again maybe no one else would be releasing for the next couple days and it would remain on the newly released list longer. But if no one is even looking... hmm.&lt;br /&gt;&lt;br /&gt;So I had a realy interesting problem spring up the other day that turned out to be pretty tricky to solve. I haven't had a fresh computer science problem in a while! It turns out that when you have even a moderately complex object graph it is pretty easy to end up in a never ending loop during persistence. Meaning if you call Save() on a particular entity it will then save all of its parents, itself then all of its children. Which is what you want really but then the children try to save their parents and parents their children etc. So you can end up going round and round forever if your ancestors share a common parent with you. I'll show a diagram of the DB scheme from the Example website to illustrate what I'm talking about.&lt;br /&gt;&lt;a href="http://photos1.blogger.com/x/blogger/327/378/1600/3249/layout.png"&gt;&lt;img style="FLOAT: left; MARGIN: 0px 10px 10px 0px; CURSOR: hand" alt="" src="http://photos1.blogger.com/x/blogger/327/378/400/840781/layout.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;So you can see there if you're saving a Company entity it circles back around to it's parent Address and you get stuck in an infinite loop.&lt;/p&gt;&lt;p&gt;So to resolve this I had some ideas where I tried to add check to not update something twice (which is good still) but the problem was with an entity needing to also persist its relationships and the loop would never be solved or we'd end up with only a partial (and unpredictable) persist of the object graph. So I thought about it pretty hard and came up with what I think is the solution.&lt;/p&gt;&lt;p&gt;So the idea is basically like a depth first search. Only since we're using the metaphor of parent/child/sibling its more like a height first search. The problem is that this isn't exatly a strict tree, the relationships are seemingly random and branches can go from any node to any other node however two nodes cannot be parents of each other or children of each other. Furthermore, you cannot make any assumptions about which node begins the persist! So the rules I came up with are pretty simple:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Always persist upwards first.&lt;/li&gt;&lt;li&gt;Persist yourself.&lt;/li&gt;&lt;li&gt;If being persisted from above the persist downwards.&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;That's it essentially. So what happens is that the first nod persists its parents then they persist their parents etc. all the way to the top. Then since they were persisted from below and not from above they do not cascade persists downwards. It will wind back down to the original node then begin going downwards. Each downward node will persist all parents and then go further down the tree. &lt;/p&gt;&lt;p&gt;In this scenario you may have some nodes that will not get persisted (children of parents who do not have any other relations with the original persister), however this is &lt;em&gt;predictable. &lt;/em&gt;Meaning, that when you do a persist you can readily know ahead of time what will not get persisted due to the relationships then call a persist on the other entities as needed. So I went from an endless loop to persisting 1720 entities in about .3 seconds by implementing those rules. So that made me happy.&lt;/p&gt;&lt;p&gt;Though now that I think more about it I'm not sure I handled it correctly for the sibling relationship scenario. It should be possible I just don't think I hooked it up yet. I'll take a look at it tonight.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32922167-116689120760366587?l=justnbusiness.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://justnbusiness.blogspot.com/feeds/116689120760366587/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=32922167&amp;postID=116689120760366587' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/32922167/posts/default/116689120760366587'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/32922167/posts/default/116689120760366587'/><link rel='alternate' type='text/html' href='http://justnbusiness.blogspot.com/2006/12/so-im-coming-down-to-real-beta1.html' title=''/><author><name>Justin Chase</name><uri>http://www.blogger.com/profile/09465842474543801600</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_pcncuUNsA3Q/S2yelxM5vjI/AAAAAAAAAM0/nLIYJ8r-IQI/s1600-R/764863923_1f807d6ab3_m.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-32922167.post-116345868159634379</id><published>2006-11-13T14:07:00.000-08:00</published><updated>2006-11-13T14:58:10.763-08:00</updated><title type='text'>Getting ready for a Beta 1</title><content type='html'>I'm in the process of tidying up some things in preperation for a beta 1 build. I finally have the compiler and templates producing a dll that builds and "works". I'm sure there are bugs and issues still but for the most part it creates all of the data access and relationships and access / authorization / validation rules properly. I'm working on the Example website right now to try and get that a bit cleaner. I'm writing up an install page that will add the schema and default test data to a database.&lt;br /&gt;&lt;br /&gt;I'm trying to decide whether or not to add the "action" syntax into the language before this next release. I've also been discussing things a little with others and I'm thinking about modifying the syntax to group validation/access rules in with fields. For example:&lt;br /&gt;&lt;br /&gt;Currently the syntax looks like this:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;family Test&lt;br /&gt;{&lt;br /&gt;    entity Blah&lt;br /&gt;    {&lt;br /&gt;        field string value;&lt;br /&gt;&lt;br /&gt;        access deny * set value;&lt;br /&gt;        validate value maxlength 64;&lt;br /&gt;        validate value regex "\d{3}-\d{5}";&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;But I'm thinking about grouping the rules into something a bit more logical so it might look more like this:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;family Test&lt;br /&gt;{&lt;br /&gt;    entity Blah&lt;br /&gt;    {&lt;br /&gt;        field string value[9] = "\d{3}-\d{5}"&lt;br /&gt;       {&lt;br /&gt;           access deny * set;&lt;br /&gt;       }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;I've also been thinking about more logical ways to specify what types of Entities you might want, such as readonly, info, etc. I'm thinking beyond just declaring an "Entity" you could declare a readonly entity or an info entity or something else perhaps. Also it might be good to be able to declare an "expression" which could be a reusable regular expression rule that you could use for validation rules on multiple entities. Also for custom rules I'm thinking some syntax such as this:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;validate value Blah.Test.MyCustomRule in Blah.Test.dll&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Which might require some way to add assembly references then call into the custom .dll to run the specified rule and you could put optional arguments into a dictionary and pass that in perhaps, or something like that.&lt;br /&gt;&lt;br /&gt;So the big thing right now is trying to balance adding these features with getting a release out the door. I don't really have any other developers contributing here so getting anything done is not real fast but I would like to produce something not only useable but something that is actually beneficial! So the question is whcih features do I add in? Right now I'm shooting for only what I have done so far plus (perhaps) the action syntax. Then evaluate which features to add in for subsequent versions.&lt;br /&gt;&lt;br /&gt;If anyone has any ideas or questions (or anything!) about entity languages and would like to discuss this please feel free to join the google group and start up a discussion or add an entry to the codeplex forum. I'm really ready for some feedback / critiques and some thought provoking discussion to help me get some of these ideas straight. Also if you think you could use something like this for an application of your own let me know because I'm looking for some contributors for sure.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32922167-116345868159634379?l=justnbusiness.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://justnbusiness.blogspot.com/feeds/116345868159634379/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=32922167&amp;postID=116345868159634379' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/32922167/posts/default/116345868159634379'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/32922167/posts/default/116345868159634379'/><link rel='alternate' type='text/html' href='http://justnbusiness.blogspot.com/2006/11/getting-ready-for-beta-1.html' title='Getting ready for a Beta 1'/><author><name>Justin Chase</name><uri>http://www.blogger.com/profile/09465842474543801600</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_pcncuUNsA3Q/S2yelxM5vjI/AAAAAAAAAM0/nLIYJ8r-IQI/s1600-R/764863923_1f807d6ab3_m.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-32922167.post-116071772529240895</id><published>2006-10-12T22:17:00.000-07:00</published><updated>2006-10-12T22:35:25.303-07:00</updated><title type='text'></title><content type='html'>I'm making some good progress I believe. The project is looking good and I'm still very motivated to continue onward. The last couple days have been pretty interesting, 3 things have really happened.&lt;br /&gt;&lt;br /&gt;The first thing that happened, which is very tangible, was that I moved the source code away from the Google code Subversion repository and into a project site hosted at &lt;a href="http://www.codeplex.com"&gt;Code Plex&lt;/a&gt;. I'm thinking this is a good move so far. The issue management and integrated discussion capabilities is FAR superior. Not to mention the Team Explorer integrated source control software is pretty sweet as well. I'm digging the free wiki pages built in and built in release storage locations. I'm very happy for this upgrade so far.&lt;br /&gt;&lt;br /&gt;The second thing is that I watched a &lt;a href="http://www.wekeroad.com/actionpackintro.html"&gt;very interesting video &lt;/a&gt;about the SubSonic "Actionpack" the other day, which is a very interesting library that is similar in purpose to NBusiness and got some good ideas. For one thing the Build Provider section was way cool though it seems like it could be trouble to tie your build proccess to a database too extensively. However I must say I LOVED the "Query" class structure they built. I'm definitely thinking that we should so something like that as well. It would be a nice touch to allow a developer to add custom queries so easily.&lt;br /&gt;&lt;br /&gt;The third thing that happened was that I have been talking to a friend of mine (Beau) about this project and he has always been especially interested in Data Access Code and database related things, after watching the Actionpack video he seemed pretty pumped to help me work on some of this stuff. He seemed to be happy to do it because he himself would like to use that code for some projects of his own and maybe at work. So finally getting some help would be great! I'd love some extra feedback for one thing but I'd also like to make some progress faster. This project is coming along nicely but its also got a lot of work left.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Status updates:&lt;/strong&gt;&lt;br /&gt;- esc is building and compiling output that builds&lt;br /&gt;- NBusiness is templatized and Providerized&lt;br /&gt;- demo is gone and is replaced with Example&lt;br /&gt;- Example is a web app and an NUnit test project&lt;br /&gt;- Installer will install, esc and NBusiness.dll into GAC&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32922167-116071772529240895?l=justnbusiness.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://justnbusiness.blogspot.com/feeds/116071772529240895/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=32922167&amp;postID=116071772529240895' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/32922167/posts/default/116071772529240895'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/32922167/posts/default/116071772529240895'/><link rel='alternate' type='text/html' href='http://justnbusiness.blogspot.com/2006/10/im-making-some-good-progress-i-believe.html' title=''/><author><name>Justin Chase</name><uri>http://www.blogger.com/profile/09465842474543801600</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_pcncuUNsA3Q/S2yelxM5vjI/AAAAAAAAAM0/nLIYJ8r-IQI/s1600-R/764863923_1f807d6ab3_m.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-32922167.post-115586530402316621</id><published>2006-08-17T18:17:00.000-07:00</published><updated>2006-08-17T19:04:43.503-07:00</updated><title type='text'>First post!</title><content type='html'>I've hit a sort of milestone today. I have end to end generation happening (as imperfect as it is) and it seems to be working quite well. I made some tough decisions today and trimmed quite a bit of fat but for the better I believe. The code is looking pretty good and I already have lots of ideas how to make it better. I also packaged everything you would need to start generating entities into a single demo zipfile here:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://nbusiness.googlecode.com/svn/trunk/demo/NBusinessDemo.zip"&gt;http://nbusiness.googlecode.com/svn/trunk/demo/NBusinessDemo.zip&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The most important milestone of today, though, is probably solidly defining how relationships work. I started by really breaking down all of the possible relationship types, here is what I came up with:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;1:M (one to many)&lt;/li&gt;&lt;li&gt;M:1 (many to one)&lt;/li&gt;&lt;li&gt;M:M (many to many)&lt;/li&gt;&lt;li&gt;1:1 (one to one)&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;After thinking about these relationships a bit I wrote up these little diagrams:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://photos1.blogger.com/blogger/327/378/1600/digrams.png"&gt;&lt;img style="MARGIN: 0px 10px 10px 0px; CURSOR: hand" alt="" src="http://photos1.blogger.com/blogger/327/378/320/digrams.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Basically this shows that the 1:M and the M:1 relationships are the same but just from different perspectives. In these relationships you have a Parent and a Child. The parent can have multiple children but the Children can only have 1 parent. So if you have two entities, A{aid} and B{bid, aid} you can establish a 1:M relationship with this syntax on A:&lt;/p&gt;&lt;p&gt;relationship BList with B on aid as child;&lt;/p&gt;&lt;p&gt;This establishes a child relationship called BList with B using the aid field to link them. And now for the M:1 on B:&lt;/p&gt;&lt;p&gt;relationship A with A on aid as parent;&lt;/p&gt;&lt;p&gt;Now the M:M relationship is significantly different. The idea here is that A can have many B's and B can have many A's. In this scenario neither one can be considered a parent or a child so instead we use the term 'sibling'. So if we have entities A{aid} and B{bid} then we can create a M:M relationship with this syntax:&lt;/p&gt;&lt;p&gt;on A: "relationship BList with B as sibling;"&lt;/p&gt;&lt;p&gt;on B: "relationship AList with A as sibling;"&lt;/p&gt;&lt;p&gt;Its important that both entities have the sibling relationship in this case and that they do not declare which fields to link on. In this case the Compiler will generate an internal intermediate type known as AB with fields for each id field in both entities. When adding an instance of B to the BList on A you will actually be adding an instance of AB but this is transparent to the developer.&lt;/p&gt;&lt;p&gt;It's also interesting to note that the 1:1 relationship never really comes up... Or at least this is what I'm thinking at this point. Typically in order to establish a 1:1 relationship at least one of the entities would have to have a field that corresponds to another entity but if only one has the field then that's just a 1:M, if they both have id's for each other then you could have a true 1:1 but that begs to have the question "why bother?" asked. If you had a 1:1 entity relationship you might as well just consider combining the two entities into 1. Consider this 1:1 relationship:&lt;/p&gt;&lt;p&gt;A{aid,bid,c} , B{bid,aid,d}&lt;/p&gt;&lt;p&gt;How is this actually different than just having:&lt;/p&gt;&lt;p&gt;A{aid,bid,c,d}&lt;/p&gt;&lt;p&gt;Its really not, therefore a 1:1 is useless and should be avoided and is intentionally left out of the semantics of E#. If I'm making a huge logic flaw here someone please let me know! &lt;/p&gt;&lt;p&gt;Anyrate I'm onto working on some better debugging for the compiler and then implementing the output of the relationships!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32922167-115586530402316621?l=justnbusiness.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://justnbusiness.blogspot.com/feeds/115586530402316621/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=32922167&amp;postID=115586530402316621' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/32922167/posts/default/115586530402316621'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/32922167/posts/default/115586530402316621'/><link rel='alternate' type='text/html' href='http://justnbusiness.blogspot.com/2006/08/first-post.html' title='First post!'/><author><name>Justin Chase</name><uri>http://www.blogger.com/profile/09465842474543801600</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_pcncuUNsA3Q/S2yelxM5vjI/AAAAAAAAAM0/nLIYJ8r-IQI/s1600-R/764863923_1f807d6ab3_m.jpg'/></author><thr:total>0</thr:total></entry></feed>
