<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Mike Christensen: Web Dev Guy : General</title><link>http://blogs.msdn.com/mikechr/archive/tags/General/default.aspx</link><description>Tags: General</description><dc:language>en</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Castle ActiveRecord</title><link>http://blogs.msdn.com/mikechr/archive/2008/03/18/castle-activerecord.aspx</link><pubDate>Tue, 18 Mar 2008 10:07:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8308180</guid><dc:creator>mikechr</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/mikechr/comments/8308180.aspx</comments><wfw:commentRss>http://blogs.msdn.com/mikechr/commentrss.aspx?PostID=8308180</wfw:commentRss><wfw:comment>http://blogs.msdn.com/mikechr/rsscomments.aspx?PostID=8308180</wfw:comment><description>&lt;!--StartFragment--&gt;&lt;p class="MsoNormal"&gt;Lately, I’ve been playing around with Castle ActiveRecord tolearn about this particular technology.&lt;span style="mso-spacerun: yes"&gt; &lt;/span&gt;For those of you who are unaware, Castle ActiveRecord is an open sourceimplementation of the ActiveRecord pattern written in .NET and built onNHibernate.&lt;/p&gt;&lt;p class="MsoNormal"&gt;The ActiveRecord pattern represents rows in a table asinstances of a class (with column values as instance methods) while providingaccess to the table itself as static methods of the class.&lt;/p&gt;&lt;p class="MsoNormal"&gt;For example, a database table named Users might berepresented by a class called User.&lt;span style="mso-spacerun: yes"&gt; &lt;/span&gt;The User class would have a static method called FindRow which takes ina numeric value corresponding to the primary key of that table.&lt;span style="mso-spacerun: yes"&gt;  &lt;/span&gt;User.FindRow(5) would return aninstance of a User object, which would have various properties such as Name.&lt;/p&gt;&lt;p class="MsoNormal"&gt;The benefit of this is it allows developers to access andmanipulate data in a database while providing a layer of abstraction from theactual database syntax.&lt;span style="mso-spacerun: yes"&gt;  &lt;/span&gt;This codecan be database agnostic and hide the user from SQL queries and what not.&lt;span style="mso-spacerun: yes"&gt;  &lt;/span&gt;It also allows simplifying databasecode and being able to perform basic database operations in one or two lines ofcode.&lt;/p&gt;&lt;p class="MsoNormal"&gt;One of the benefits of Castle ActiveRecord is you can defineyour entire database schema using .NET code and even have the engine create thedatabase for you.&lt;span style="mso-spacerun: yes"&gt;  &lt;/span&gt;For example, tocreate a User table, we could use the following code:&lt;/p&gt;&lt;p class="MsoNormal"&gt; &lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;[ActiveRecord(“Users”)]&lt;/p&gt;&lt;p class="MsoNormal"&gt;public class User : ActiveRecordBase&amp;lt;User&amp;gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;{&lt;/p&gt;&lt;p class="MsoNormal"&gt;string name;&lt;/p&gt;&lt;p class="MsoNormal"&gt;[Property(NotNull = true)]&lt;/p&gt;&lt;p class="MsoNormal"&gt;public string Name {get {return name;} set {name = value;}}&lt;/p&gt;&lt;p class="MsoNormal"&gt;}&lt;/p&gt;&lt;p class="MsoNormal"&gt; &lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;Using various attributes, you can specify database typemappings, primary keys, foreign constraints, indexes, etc.&lt;span style="mso-spacerun: yes"&gt;  &lt;/span&gt;When you’re done, you can instructActiveRecord to create the database using a given connection string.&lt;/p&gt;&lt;p class="MsoNormal"&gt;We can now create a row in this table with the followingcode:&lt;/p&gt;&lt;p class="MsoNormal"&gt;User user = new User();&lt;/p&gt;&lt;p class="MsoNormal"&gt;user.Name = “Mike”;&lt;/p&gt;&lt;p class="MsoNormal"&gt;user.Create();&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;This eliminates the need to use ADO.NET or construct SQLstatements or stored procedure calls.&lt;/p&gt;&lt;p class="MsoNormal"&gt;One interesting thing you can do is specify the relationsbetween tables.&lt;span style="mso-spacerun: yes"&gt;  &lt;/span&gt;If I had an Ordertable, I can specify a User that placed the order:&lt;/p&gt;&lt;p class="MsoNormal"&gt; &lt;/p&gt;&lt;p class="MsoNormal"&gt;Public class Order&lt;/p&gt;&lt;p class="MsoNormal"&gt;{&lt;/p&gt;&lt;p class="MsoNormal"&gt;….&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;[BelongsTo(“Name”, NotNull = true)]&lt;/p&gt;&lt;p class="MsoNormal"&gt;public User PlacedBy {get {return _placedby;}}&lt;/p&gt;&lt;p class="MsoNormal"&gt; &lt;/p&gt;&lt;p class="MsoNormal"&gt;You’ll notice this method actually returns a User object, notjust an int or a guid or what not.&lt;span style="mso-spacerun: yes"&gt; &lt;/span&gt;When an Order row is queried, Castle ActiveRecord joins in the Userstable and also populates the PlacedBy instance of the order.&lt;span style="mso-spacerun: yes"&gt;  &lt;/span&gt;You can enable a feature called “lazyloading” which will not query the Users table until the property getter isaccessed.&lt;span style="mso-spacerun: yes"&gt;  &lt;/span&gt;This would prevent thegeneration of queries with lots of joins.&lt;/p&gt;&lt;p class="MsoNormal"&gt;So far, I’ve found Castle ActiveRecord to do a great jobhandling simple database operations for me, however it definitely has itsdrawbacks.&lt;span style="mso-spacerun: yes"&gt;  &lt;/span&gt;I’ve found it lackingin creating any sort of complicated database schema, as it doesn’t seem to beable to create indexes on foreign keys or allow the user to specify clusteredvs non-clustered indexes.&lt;span style="mso-spacerun: yes"&gt;  &lt;/span&gt;However,it can also generate a SQL script to create your database and output to a fileso you can make changes before provisioning your database.&lt;span style="mso-spacerun: yes"&gt;  &lt;/span&gt;For more complicated scenarios, I wouldnot use Castle ActiveRecord for database provisioning.&lt;/p&gt;&lt;p class="MsoNormal"&gt;There were a few instances where I wanted to be able toreturn only certain columns from the database and control exactly what tablesget join’ed in.&lt;span style="mso-spacerun: yes"&gt;  &lt;/span&gt;It seems CastleActiveRecord wants to return all columns all the time, or no columns and generate new SELECTstatements every time you access a property.&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;It would be nice if we could simply specify what columns wewant to query for, and the remaining properties would remain null.&lt;span style="mso-spacerun: yes"&gt;  &lt;/span&gt;For these scenarios, CastleActiveRecord can create an IDbCommand and you can fire off your own storedprocedure or SQL statement.&lt;span style="mso-spacerun: yes"&gt;  &lt;/span&gt;I’vefound using a mix of regular ADO.NET and ActiveRecord calls for the simplerstuff is a great approach for more complicated applications.  The ActiveRecord base class also allows you to override various methods, and pretty much any part of the system can be rewritten.&lt;/p&gt;&lt;p class="MsoNormal"&gt;One thing that has disappointed me is it seems support fortransactions is completely broken!&lt;span style="mso-spacerun: yes"&gt; &lt;/span&gt;I can create a transaction like so:&lt;/p&gt;&lt;p class="MsoNormal"&gt; &lt;/p&gt;&lt;p class="MsoNormal"&gt;using(TransactionScope t = new TransactionScope())&lt;/p&gt;&lt;p class="MsoNormal"&gt;{&lt;/p&gt;&lt;p class="MsoNormal"&gt;//Do some DB calls&lt;/p&gt;&lt;p class="MsoNormal"&gt;t.VoteCommit();&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;}&lt;/p&gt;&lt;p class="MsoNormal"&gt; &lt;/p&gt;&lt;p class="MsoNormal"&gt;In theory, if the code crashes, the transaction will neverbe committed and the Dispose method of TransactionScope will roll thetransaction back.&lt;span style="mso-spacerun: yes"&gt;  &lt;/span&gt;However, when Itried this, I found the SQL code isn’t getting run and no SQL errors would begenerated until the Transaction is disposed, thus making it impossible to rollback the transaction due to database errors.&lt;span style="mso-spacerun: yes"&gt;  &lt;/span&gt;On thesupport forums, I found several other people who ran into this problem but noone had a solution for it yet.&lt;/p&gt;&lt;p class="MsoNormal"&gt;Overall, I think this technology is a great model for dataaccess using .NET applications and works perfectly for web applications aswell.&lt;span style="mso-spacerun: yes"&gt;  &lt;/span&gt;It seems they need to ironout a few minor problems, but they have a large following and an active supportcommunity.&lt;span style="mso-spacerun: yes"&gt;  &lt;/span&gt;It’s also open sourcewith a very flexible license, which would allow large applications to run ontheir own customized version of Castle ActiveRecord.&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;I think the pattern is very solid and at the very least,should give you some ideas for creating a database access layer from scratch for yourweb based applications.&lt;span style="mso-spacerun: yes"&gt;  &lt;/span&gt;I’d bevery interested in hearing from anyone using Castle ActiveRecord in theirapplications and what they like and don’t like about it.&lt;/p&gt;&lt;p class="MsoNormal"&gt;For more information, visit: &lt;a href="http://www.castleproject.org/activerecord/index.html"&gt;http://www.castleproject.org/activerecord/index.html&lt;/a&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;Mike&lt;/p&gt;&lt;!--EndFragment--&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8308180" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/mikechr/archive/tags/.NET+Programming/default.aspx">.NET Programming</category><category domain="http://blogs.msdn.com/mikechr/archive/tags/General/default.aspx">General</category></item><item><title>Housing prices</title><link>http://blogs.msdn.com/mikechr/archive/2006/09/11/750096.aspx</link><pubDate>Tue, 12 Sep 2006 04:42:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:750096</guid><dc:creator>mikechr</dc:creator><slash:comments>10</slash:comments><comments>http://blogs.msdn.com/mikechr/comments/750096.aspx</comments><wfw:commentRss>http://blogs.msdn.com/mikechr/commentrss.aspx?PostID=750096</wfw:commentRss><wfw:comment>http://blogs.msdn.com/mikechr/rsscomments.aspx?PostID=750096</wfw:comment><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Arial color=#808080 size=2&gt;When I moved to the Seattle area over eight years ago, I knew I wanted to make this place my home.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Since it was clear my residence would be permanent, it seemed like a good idea to buy something rather than rent.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Back then, I found a nice condo for around $130,000 in the Redmond area.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;At a decent interest rate, a 30 year fixed rate mortgage with a 20% down payment was about $680/month.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;It was a no brainer!&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;I was paying almost $900/month for an apartment, and had I not moved they were increasing my rent to $1090.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;I could have a bigger place for cheaper, and build equity I could later use as a down payment on a house.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;I also owned the inside walls and could do stuff like remodel the kitchen, paint, install hardwood floors, etc.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Back then, the only reasons most people continued to rent were 1) they didn’t plan on being in the area very long or 2) they had lots of debt or credit problems preventing them from getting a home loan.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Arial color=#808080 size=2&gt;Now days, it’s much different.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;My condo is worth about $240,000 and it’s considered a pretty low end place.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Most of the condos in the Kirkland area are $300k-$400k, and if you want down town Seattle you’ll pay even more.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;With interest rates starting to climb back up, it’s harder to justify paying $2,000/month or more for a condo.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Gone are the days of using a condo as a “stepping stone” between an apartment and a house.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The concept of “owning is cheaper than renting” is gone, which scares away most people – especially those who aren’t too concerned about their financial future.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Arial color=#808080 size=2&gt;It seems the solution to this over the past couple years has been to keep lowing the interest rates until people can afford houses.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;But has this just made the problem worse?&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Most people look at a house in terms of what it costs &lt;I style="mso-bidi-font-style: normal"&gt;them&lt;/I&gt; per month.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;I have x dollars per month that I can afford as a house payment.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;What does this buy me?&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;As interest rates drop, the value of the house that money can buy me goes up.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;This increases the buying power of the average potential home owner.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;With so many people moving into the area over the past few years and more buyers than sellers, this allows people to offer more money on a house and causes the market value of houses to go up.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;We’ve been seeing this for a few years now, and other states like California and New York are also no stranger to this.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;When the point comes where people are having a hard time affording a house, banks do stuff they’ve never done before.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;We have 40 and 50 year mortgages now.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;We have 1-year adjustable rate mortgages.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;We have interest only loans.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Banks do whatever it takes to lower your monthly payments to attract your business, all while housing prices continue to increase.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Arial color=#808080 size=2&gt;Those who cannot afford to buy a home have to rent.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Land lords have to raise rents to afford their mortgages, so rents are going up as well preventing people from saving any money.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;In San Diego, a lot of apartment owners are getting the idea to turn their cheap apartments into low cost condos.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;By low cost, I mean &lt;I style="mso-bidi-font-style: normal"&gt;only&lt;/I&gt; $400,000 or so.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;This lowers the availability of apartments thus driving the cost of other rental units up as well. &lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;This ends up pushing poorer people out of the area.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Arial color=#808080 size=2&gt;So what’s the effect?&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Those who can get their foot into to the real estate market continue to get richer while those who are forced to rent get further and further behind.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Is this creating a wider social gap between the rich and the middle class?&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;What can be done about this?&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Obviously, raising interest rates would be a problem.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;You don’t want the house you bought a year ago for $500k to all of a sudden only fetch you $300k because none of the potential buyers can afford that mortgage.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Is this simply capitalism at work and a normal aspect of our economy, or do all Americans have the right to be able to afford a house some day?&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Arial color=#808080 size=2&gt;I was very lucky to “get in” to the housing game before all this non-sense started, and due to the appreciation of my condo I was able to make a nice 20% down payment on a home and have some extra money left over to invest.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;I think I made a good decision to buy something seven years ago, but what about those who are just starting their lives now?&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Some people push themselves to their financial limits to buy the cheapest possible shack and become “house poor”.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Yes, they have their house but they have to live off dry noodles every night for dinner.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Arial color=#808080 size=2&gt;I was talking to a real estate agent friend of mine and she said the majority of her clients buying their first homesare getting the down payments from their parents, or a family member.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Does this lead to a world where social status is inherited?&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Arial color=#808080 size=2&gt;I’m very interested in any comments you guys have.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Arial color=#808080 size=2&gt;Mike&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=750096" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/mikechr/archive/tags/General/default.aspx">General</category></item><item><title>Housing adventures</title><link>http://blogs.msdn.com/mikechr/archive/2006/09/06/743326.aspx</link><pubDate>Thu, 07 Sep 2006 00:45:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:743326</guid><dc:creator>mikechr</dc:creator><slash:comments>56</slash:comments><comments>http://blogs.msdn.com/mikechr/comments/743326.aspx</comments><wfw:commentRss>http://blogs.msdn.com/mikechr/commentrss.aspx?PostID=743326</wfw:commentRss><wfw:comment>http://blogs.msdn.com/mikechr/rsscomments.aspx?PostID=743326</wfw:comment><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT size=2&gt;&lt;FONT face=Arial&gt;&lt;FONT color=#808080&gt;I must apologize for my recent lack of blogging, but I’ve been most busy attempting to become a home owner.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;This is a dream I’ve had for years now, but it was put on hold for a few years due to the most rediculous litigation surrounding my condo assocation.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;One day, the association realized they were in $9 million dollars in debt and this was a problem.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Due to this unfortunate financial circumstance, my monthly home owners dues went from $117 to $330.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Since the corporate charter said they could not increase the dues by more than 10% a year, they were immediately sued by all sorts of people.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The prices of the condos in this complex plummeted and I was forced to stay unless I wanted to take a $20,000 loss.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;After a few years, the association eventually won all the lawsuits (really good lawyers?) and the prices are finally starting to get back up to the same level as other similar condos in the area.&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT size=2&gt;&lt;FONT face=Arial&gt;&lt;FONT color=#808080&gt;I decided to resume my dream of owning a house, however I became very interested in building it myself.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;That way, I could get it just the way I wanted and use high quality materials. &lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;I wanted something small and nice which is hard to find.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;So I started looking into building a house – the first step is, of course, to find land.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Arial color=#808080 size=2&gt;Now, there’s a difference between a piece of land and a “lot”.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Land is simply any piece of dirt someone is willing to sell you.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;This land might be on a slope, covered with brush, or be in some way totally unable to support any type of construction.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Of course, you don’t know until you actually do a feasibility study, which could costs thousands.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Lots would already be prepped and ready to build on.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;A lot is tough to find unless you want a microscopic little tenth of an acre parsel in the middle of some yuppyville housing community.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Land around here goes for around $120,000 for anything decent.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Figure another $80,000 for leveling, escavation, clearing, permits, environmental studies, bribing public officials, etc.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;So I figured I’d be looking at $200k before I could even start building anything.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;So I called about 6 real estate agents looking for someone who would help me buy land.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;None of them returned my phone calls.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;It seems about 60% of land deals fall through and no one wants to get in that business.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;In fact, the only people that build houses anymore are insanely rich people or major housing development corporations who build &lt;?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" /&gt;&lt;st1:metricconverter w:st="on" ProductID=".1 acre"&gt;.1 acre&lt;/st1:metricconverter&gt; lot yuppyville homes with the cheapest materials and give you a list of about 3 options to choose from.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;This is not my thing.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;So once you have the land, then what?&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Well, you can buy a manufactured home.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;This is by far the cheapest way to go.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;You get these homes from companies such as Hiline Homes (&lt;/FONT&gt;&lt;A href="http://www.hilinehomes.com/"&gt;&lt;FONT face=Arial color=#808080 size=2&gt;www.hilinehomes.com&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Arial color=#808080 size=2&gt;) and they show up one day on the back of a rather large truck.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Those go for about $100k for a decent one, mind you they have incredibly undesirable floor plans.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;If you want something nicer, you can go with a cute little log home from someone like Lindal Cedar Homes (&lt;/FONT&gt;&lt;A href="http://www.lindal.com/"&gt;&lt;FONT face=Arial color=#808080 size=2&gt;www.lindal.com&lt;/FONT&gt;&lt;/A&gt;&lt;FONT size=2&gt;&lt;FONT face=Arial&gt;&lt;FONT color=#808080&gt;).&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;I love these!&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;These things show up on another rather large truck in pieces and you hire someone to put them together for you.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The cost is around $110/sf.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;So figure $200,000 for a good size home.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;However, this is just the outer “shell” of a house.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The walls, ceilings, doors, little metal bracket thingies, etc.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Once you’re done with that you’d have to hire a general contractor to fill in the innards which might cost you another $100k.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Third option - if you really want something nice, you have to hire an architect to design you something from scratch and have it custom built.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Custom built houses in this area go for around $300/sf.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;So figure a nice little 2,000sf home would run you $600,000 just for construction.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Adding up these numbers makes building a house really push the budget of any average person.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;So I decided to give up on this and look for an existing house that I liked.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;One problem, I wanted a basement.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT size=2&gt;&lt;FONT face=Arial&gt;&lt;FONT color=#808080&gt;Why a basement?&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Well, where else are you gonna hide all the dead bodies?&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Actually, being a movie buff I really want to build a home theater.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;It’d be great to have a projector mounted on the ceiling, with a nice &lt;st1:metricconverter w:st="on" ProductID="100”"&gt;100”&lt;/st1:metricconverter&gt; screen, accoustic tile on the ceilings, carpetted walls all in a room you could get pitch black.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Since it’s underground, you wouldn’t have to worry too much about noise.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;And also&amp;nbsp;as a guitar player – well you get the point.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT size=2&gt;&lt;FONT face=Arial&gt;&lt;FONT color=#808080&gt;Here’s the problem with that idea.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;All the basements around here are daylight basements in &lt;st1:City w:st="on"&gt;Kirkland&lt;/st1:City&gt; (not to knock on &lt;st1:City w:st="on"&gt;&lt;st1:place w:st="on"&gt;Kirkland&lt;/st1:place&gt;&lt;/st1:City&gt;, it’s a fine city but split entry houses are sooooo 70s.)&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;A daylight basement really doesn’t adapt well to my dream of having a home theater where I can crank up “The Mummy” and not have to worry about neighboring mobs showing up on my porch wielding pitch forks.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;After looking at dozens of crappy houses, I decided to scrap the idea of having a basement (maybe someday) and start to look out east of &lt;st1:City w:st="on"&gt;&lt;st1:place w:st="on"&gt;Redmond&lt;/st1:place&gt;&lt;/st1:City&gt;.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Out there, you can still get a good amount of land and a decent place without having to give up your first born son.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT size=2&gt;&lt;FONT face=Arial&gt;&lt;FONT color=#808080&gt;&lt;IMG alt="My new house!" src="http://home.comcast.net/~imaudi/House.gif" align=right&gt;Eventually, I found a great house on a big lot that I absolutely loved.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;It has an awesome kitchen, great back yard for parties, plenty of space and a living room wired for home theater stuff.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;I’ll be moving in next weekend if all goes well, and fixing up my condo to put it on the market before the holiday season.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT size=2&gt;&lt;FONT face=Arial&gt;&lt;FONT color=#808080&gt;One thing about looking for homes is it really helps you figure out what you like and what you don’t like in a house.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Walking through houses I absolutely hated was a great exercise and a most valuable experience.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;I started to get really good at narrowing down what kind of house I wanted and what features were the most important, and I eventually found out that having a basement was not as huge of a requirement as I previously thought and wasn’t worth sacrificing other characteristics I wanted.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Having a big lot and a house that didn’t look like everything else on the street was far more important in the end.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;One thing I did was take pictures of every house I visited and started to compile notes on what I liked and what I didn’t like.&amp;nbsp; In somewhat of a "binary search" fassion, I was able to narrow down exactly what I wanted in a house.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT size=2&gt;&lt;FONT face=Arial&gt;&lt;FONT color=#808080&gt;Hopefully when the dust settles, I’ll be able to blog more again.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Stay tuned for my semi-left wing rant on housing prices (I didn’t want to make this entry too long).&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;That’s it for now!&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT size=2&gt;&lt;FONT face=Arial&gt;&lt;FONT color=#808080&gt;Mike&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=743326" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/mikechr/archive/tags/General/default.aspx">General</category></item><item><title>Yay!  Higher gas prices!</title><link>http://blogs.msdn.com/mikechr/archive/2006/07/28/681961.aspx</link><pubDate>Sat, 29 Jul 2006 00:56:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:681961</guid><dc:creator>mikechr</dc:creator><slash:comments>6</slash:comments><comments>http://blogs.msdn.com/mikechr/comments/681961.aspx</comments><wfw:commentRss>http://blogs.msdn.com/mikechr/commentrss.aspx?PostID=681961</wfw:commentRss><wfw:comment>http://blogs.msdn.com/mikechr/rsscomments.aspx?PostID=681961</wfw:comment><description>&lt;P&gt;&lt;FONT face=Arial color=#808080 size=2&gt;Now that I've caught your attention with my post title, let me explain.&amp;nbsp; Unlike most people, I'm a fan of high gas prices.&amp;nbsp; I'm sure there's a point where I'd start walking to work, but the extra 50 cents per gallon costs me maybe $20 dollars per month.&amp;nbsp; It's $20 dollars I could use for other stuff perhaps, but it's not the end of the world and it's not nearly as bad as the thousands I spend&amp;nbsp;on a poorly managed social security program.&amp;nbsp; Now, there are of course the people who 1) fill up their tanks more than I do and spend much more than $20 dollars extra per month, or 2) the people who are working their butts off to barely make ends meet.&amp;nbsp; And, of course, gas prices affect the price of a lot of other stuff.&amp;nbsp; This is painful, but I maintain that gas is simply not a requirement to survive (unlike water and oxygen.)&amp;nbsp; There will come a point where Americans simply won't agree to pay for it anymore - which brings me to my argument.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial color=#808080 size=2&gt;Though it's unfortunate, we happen to live in a country that doesn't &lt;EM&gt;do&lt;/EM&gt; anything about a problem until it actually &lt;EM&gt;becomes&lt;/EM&gt; a problem.&amp;nbsp; Now I don't like it, but that's the mentality we have as a people.&amp;nbsp; So, these high gas prices have started to really make a difference in the priorities of consumers.&amp;nbsp; People are looking for more gas efficient vehicles, which creates demand, which creates a market.&amp;nbsp; Various car companies are spending lots more money on Hybrid technologies, which keep getting better and better.&amp;nbsp; More money is being spent on alternative fuel sources such as this cool little vehicle:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.teslamotors.com/"&gt;&lt;FONT face=Arial size=2&gt;http://www.teslamotors.com/&lt;/FONT&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial color=#808080 size=2&gt;It's a fully electric car that does 0-60 in 4 seconds and can drive 250 miles on a full charge.&amp;nbsp; It can't replace my current car yet, as I like being able to do long road trips, but this is a huge breakthrough on previous electric cars that had a range of about 60 miles.&amp;nbsp; Hopefully this sort of innovation will result in a huge breakthrough in energy storage (better laptop batteries, cell phone batteries, etc.)&amp;nbsp; There will some day be a car that's cheap, does not run off gas, is quick and easy to "recharge", and drives like a Viper - and higher gas prices is going to drive that sort of innovation.&amp;nbsp; It's either that or we wait until we run out of oil completely.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial color=#808080 size=2&gt;So bring on the high gas prices, it hurts now but if it results in a better world I'm all for that.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial color=#808080 size=2&gt;Mike&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=681961" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/mikechr/archive/tags/General/default.aspx">General</category></item><item><title>Great ASP.NET site</title><link>http://blogs.msdn.com/mikechr/archive/2006/06/28/650271.aspx</link><pubDate>Thu, 29 Jun 2006 03:25:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:650271</guid><dc:creator>mikechr</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/mikechr/comments/650271.aspx</comments><wfw:commentRss>http://blogs.msdn.com/mikechr/commentrss.aspx?PostID=650271</wfw:commentRss><wfw:comment>http://blogs.msdn.com/mikechr/rsscomments.aspx?PostID=650271</wfw:comment><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Arial color=#808080 size=2&gt;Here’s a great site for developers that aggregates a bunch of other ASP.NET blogs, making it easy to find new information all on a single site.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Check it out!&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;A href="http://www.dotnetslackers.com/"&gt;http://www.dotnetslackers.com/&lt;/A&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=650271" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/mikechr/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://blogs.msdn.com/mikechr/archive/tags/General/default.aspx">General</category></item><item><title>Question of the day...</title><link>http://blogs.msdn.com/mikechr/archive/2006/06/26/648011.aspx</link><pubDate>Tue, 27 Jun 2006 04:50:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:648011</guid><dc:creator>mikechr</dc:creator><slash:comments>9</slash:comments><comments>http://blogs.msdn.com/mikechr/comments/648011.aspx</comments><wfw:commentRss>http://blogs.msdn.com/mikechr/commentrss.aspx?PostID=648011</wfw:commentRss><wfw:comment>http://blogs.msdn.com/mikechr/rsscomments.aspx?PostID=648011</wfw:comment><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Arial color=#808080 size=2&gt;Here’s a hypothetical situation; you’re sucked into a worm hole and transported back to the year &lt;?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" /&gt;&lt;st1:metricconverter ProductID="1300 A" w:st="on"&gt;1300 A&lt;/st1:metricconverter&gt;.D. in Medieval Europe.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;You didn’t bring back your cell phone, or laptop, or any “more recent” invention.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;What advantages would you have over society at that time?&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Would you be able to survive, and would you be able to influence the course of history?&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Arial color=#808080 size=2&gt;More importantly, could you build anything [from scratch] that&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;hadn’t been invented at the time?&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Arial color=#808080 size=2&gt;I was thinking about this and it occurred to me that there’s very little I’d be able to do.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;I’m pretty sure, given enough time, I could generate electricity using magnetite or lodestone as magnets, and a coil of copper wire made from copper ore.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;This would be something that hadn’t been seen before, but perhaps wouldn’t be useful unless I could harness it for something, perhaps light or heat.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Making a light bulb might be possible given enough time, though it took Thomas Edison quite a while to make one that lasted.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;I’m not sure if I could do it.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Arial color=#808080 size=2&gt;How about a steam engine?&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;It’s a simple concept, but manufacturing the parts might take quite a bit of effort.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Provided you got the electrical current thing going, creating an electric motor might be the next logical step since it’s basically the opposite of an electric generator.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;However, for this to be useful to anyone you’d want a way to store energy when you can’t generate it directly.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Creating a “wet cell” battery might be fairly easy.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;What could you build to harness large amounts of current, such as a windmill or water turbine?&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Arial color=#808080 size=2&gt;What else would be practical?&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Arial color=#808080 size=2&gt;Any ideas?&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Arial color=#808080 size=2&gt;Mike – Web Dev Guy/Modern Technology Specialist&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=648011" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/mikechr/archive/tags/General/default.aspx">General</category></item><item><title>More about type descriptors</title><link>http://blogs.msdn.com/mikechr/archive/2006/05/30/611193.aspx</link><pubDate>Wed, 31 May 2006 02:18:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:611193</guid><dc:creator>mikechr</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/mikechr/comments/611193.aspx</comments><wfw:commentRss>http://blogs.msdn.com/mikechr/commentrss.aspx?PostID=611193</wfw:commentRss><wfw:comment>http://blogs.msdn.com/mikechr/rsscomments.aspx?PostID=611193</wfw:comment><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Arial color=#808080 size=2&gt;The other day, one of my readers posed a question regarding my recent post “&lt;/FONT&gt;&lt;A HREF="/mikechr/archive/2006/05/17/600697.aspx"&gt;&lt;FONT face=Arial color=#808080 size=2&gt;Data Binding to Custom Objects&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Arial color=#808080 size=2&gt;” – The question was essentially “Why are you writing all this code?&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;There’s much simpler ways to do the same thing.”&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Well, the reader is correct.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;There are many ways to do this same thing.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;We’ll go over that in a second.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;First, let me take a shot at defending myself.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;All over the web, there’s thousands of web sites and articles, blogs and newsgroups, discussion lists and bulletin boards all about “how to do stuff in .NET.”&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;This is great, and it helps you find the information you’re looking for to solve the problem that you currently have in front of you in your day to day jobs.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;However, the truly great programmers are the ones who know what’s going on behind the scenes.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Managed languages such as Java, VB and C# get a lot of criticism from the more “pure programmers” who prefer to work more low level with C and assembly.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Some claim there’s an entire generation of programmers who will never write their own memory manager, never create a linked list class from scratch, don’t know how a hash table works internally, don’t know how pointers really work, and don’t know the difference between memory allocated on the stack and memory allocated on the heap.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;I would disagree and say that it’s not the language itself that’s directly responsible for this new “generation” of programmers, but the complexity of the APIs they depend on.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;If you took the .NET framework out of C#, you’d have nothing more than a object-oriented language that still relies on the developer to construct these sorts of collection objects and design algorithms.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; This is no different than the plethora of ready made objects MFC provides for C++ Windows programmers.&amp;nbsp; &lt;/SPAN&gt;A language is simply an abstract way of expressing an idea, but those more familiar with the internal workings of a language will be the ones&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;who can exact their ideas in a clear and more precise manner.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Just because the .NET framework comes with a Hashtable class doesn’t mean you shouldn’t know how to write your own, and just because the .NET framework can take care of property descriptors for you doesn’t mean you shouldn’t learn how they work.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Arial color=#808080 size=2&gt;This new generation is not because of lazy programmers, or programmers who didn’t learn the basics.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Programmers in general will learn what they need to do their job, and no matter how low level you get, there’s always a level of abstraction.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Assembly programmers said this about C, C programmers said this about VB.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Until you want to write everything in pure machine code, running in ring 0, on your own CPU design that you soldered together in your basement, you’re relying on a framework that makes your job easier.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;What’s to blame is this concept of “rapid application design” which VB started.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;It became critical to toss together these quick little applications in a fraction of the time it would take with more low level languages.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;IDEs started doing the boring work for you, which is great as long as you know what’s going on.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Which leads me back to my original point – there’s plenty of places on the net to find out how to do something, this blog is dedicated to explaining how things works underneath.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;There’s only so far you will get memorizing what APIs to use where, but I promise you&amp;nbsp;it’s always worth the time to really dig into something and learn what’s going on, for when you need to modify how something behaves or figure out how to fine tune something, you’ll have a pretty good idea of how to do that.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Arial color=#808080 size=2&gt;So use my article as a learning tool, this is how the data binding code works internally and this is how ADO.NET works inside.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Now, if you’re simply wanting to bind a collection of simple objects to a grid, you can rely on “default type descriptors” rather than generating your own custom type descriptor as described in my article.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Arial color=#808080 size=2&gt;Take the following class:&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;class&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; &lt;SPAN style="COLOR: teal"&gt;Company&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 0.5in; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;private&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; &lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt; _name;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 0.5in; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;private&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; &lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt; _address;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 0.5in; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;public&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; &lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt; Name { &lt;SPAN style="COLOR: blue"&gt;get&lt;/SPAN&gt; { &lt;SPAN style="COLOR: blue"&gt;return&lt;/SPAN&gt; _name; } }&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 0.5in; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;public&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; &lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt; Address { &lt;SPAN style="COLOR: blue"&gt;get&lt;/SPAN&gt; { &lt;SPAN style="COLOR: blue"&gt;return&lt;/SPAN&gt; _address; } }&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 0.5in; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;public&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; Company(&lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt; name, &lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt; address)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 0.5in; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: 0.5in; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;_name = name;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: 0.5in; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;_address = address;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 0.5in; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;BR&gt;&lt;FONT face=Arial color=#808080 size=2&gt;It couldn’t be simpler, it has two string properties and a constructor.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;I can bind it to the Data Grid like so:&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 0.5in; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;protected&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; &lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt; Page_Load(&lt;SPAN style="COLOR: blue"&gt;object&lt;/SPAN&gt; sender, &lt;SPAN style="COLOR: teal"&gt;EventArgs&lt;/SPAN&gt; e)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 0.5in; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: 0.5in; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: teal; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;List&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;lt;&lt;SPAN style="COLOR: teal"&gt;Company&lt;/SPAN&gt;&amp;gt; list = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: teal"&gt;List&lt;/SPAN&gt;&amp;lt;&lt;SPAN style="COLOR: teal"&gt;Company&lt;/SPAN&gt;&amp;gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: 0.5in; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;list.Add(&lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: teal"&gt;Company&lt;/SPAN&gt;(&lt;SPAN style="COLOR: maroon"&gt;"Microsoft"&lt;/SPAN&gt;, &lt;SPAN style="COLOR: maroon"&gt;"123 Main"&lt;/SPAN&gt;));&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: 0.5in; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;list.Add(&lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: teal"&gt;Company&lt;/SPAN&gt;(&lt;SPAN style="COLOR: maroon"&gt;"IBM"&lt;/SPAN&gt;, &lt;SPAN style="COLOR: maroon"&gt;"333 Main"&lt;/SPAN&gt;));&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: 0.5in; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;Grid.DataSource = list;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: 0.5in; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;Grid.DataBind();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 0.5in; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Arial color=#808080 size=2&gt;My grid doesn’t change, it still binds to the “Name” and “Address” property of the object.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Internally, the grid still asks List&amp;lt;&amp;gt; for an enumerator, which List&amp;lt;&amp;gt; provides.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Each “Company” object in the list doesn’t provide a custom type descriptor, so a default type descriptor is used.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;This type descriptor will look for a public method matching the names of the bound fields.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Note this must be a method, not a property (if I mark _name public and bind to that, I’d get a runtime error.)&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;This works great for the simple case, but those who used this method without first writing their own custom type descriptor would have no idea why this works, or how they can manipulate or extend this system to do exactly what they wanted.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Suppose later on, I wanted to provide some dynamic array of properties, such as items created by the user, or retrieved from a database.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;I’d be totally lost and never know how to create my own custom type descriptors.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Hopefully some people out there got some use from my post, and there will be some better, more efficient code out there because of my efforts.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Arial color=#808080 size=2&gt;Thanks for the comments,&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Arial color=#808080 size=2&gt;Mike Christensen – Web Dev Guy&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=611193" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/mikechr/archive/tags/.NET+Programming/default.aspx">.NET Programming</category><category domain="http://blogs.msdn.com/mikechr/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://blogs.msdn.com/mikechr/archive/tags/General/default.aspx">General</category></item><item><title>My thoughts on Monad, the new Windows command line shell</title><link>http://blogs.msdn.com/mikechr/archive/2006/04/28/585885.aspx</link><pubDate>Fri, 28 Apr 2006 11:32:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:585885</guid><dc:creator>mikechr</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/mikechr/comments/585885.aspx</comments><wfw:commentRss>http://blogs.msdn.com/mikechr/commentrss.aspx?PostID=585885</wfw:commentRss><wfw:comment>http://blogs.msdn.com/mikechr/rsscomments.aspx?PostID=585885</wfw:comment><description>&lt;P&gt;&lt;FONT face=Tahoma color=#808080 size=2&gt;Today I decided to install Monad, the new command shell for Windows and I gotta say - this thing is awesome!&amp;nbsp; It's pretty much the most confusing shell I've ever seen, but it combined everything I like from DOS, Bash, Amiga, and the Visual Studio "immediate window"..&amp;nbsp; Basically this thing sits around and creates managed objects in memory and returns instances of those objects..&amp;nbsp; Those instances can be echo'ed to the command line (ToString is called), or piped into another object..&amp;nbsp; You can start with simple expressions such as:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma color=#808080 size=2&gt;1+1&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma color=#808080 size=2&gt;And get back "2"...&amp;nbsp; You can also declare variables such as:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma color=#808080 size=2&gt;$x = 1+1&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma color=#808080 size=2&gt;You can even call into managed objects such as:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma color=#808080 size=2&gt;$curdate = [DateTime]::Now&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma color=#808080 size=2&gt;$curdate is actually a manged System.DateTime object, so you can do stuff like $curdate.Date right on the command line.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma color=#808080 size=2&gt;You can also create an instance of a COM object, such as Internet Explorer:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma color=#808080 size=2&gt;$ie = new-object -com internetexplorer.application&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma color=#808080 size=2&gt;And then call methods off that such as:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma color=#808080 size=2&gt;$ie.navigate2("&lt;/FONT&gt;&lt;A href="http://www.msn.com/"&gt;&lt;FONT face=Tahoma color=#808080 size=2&gt;http://www.msn.com/&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Tahoma color=#808080 size=2&gt;")&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma color=#808080 size=2&gt;The scripting language is pretty nuts and is like nothing I've seen before, but seems to be pretty powerful.&amp;nbsp; However, if you get lost, you can create "CmdLets" which run in process and can be written in managed code.&amp;nbsp; You can easily create CmdLets in Visual Studio, compile them as a DLL, and then call "Add-MshSnapin" on that DLL to register it within the shell.&amp;nbsp; They're easy to debug by attaching to the msh.exe process.&amp;nbsp;&amp;nbsp;When I create a new CmdLet, I specify a verb name (such as Get or Set) and a noun name.&amp;nbsp; I can define parameters for my command as properties of the class.&amp;nbsp; When I run my command from the command line, it's actually creating an instance of that class in memory.&amp;nbsp; If I pipe that command into something else, the actual object is being transferred in memory, not text.&amp;nbsp; Using Reflection, you can also get "tab" command line completion for parameters and what not.&amp;nbsp; You can "capture" all the CmdLets you have active in your shell to an .mcf file so you can easily load them later.&amp;nbsp; In fact, you can create your entire own shell (CmdLets, aliases, script files, etc) and compile the whole thing as an EXE.&amp;nbsp; You can override just about anything you want on the shell, and then just run that EXE as your own person shell with all your customizations that's targetted to your specific need.&amp;nbsp; There's also no reason your shell needs to be command line based.&amp;nbsp; I can make a GUI application that runs on top of Monad as well.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma color=#808080 size=2&gt;Another great feature is a total abstraction within the file system.&amp;nbsp; Before, you were used to interacting with current file system objects and navigating through folders on the file system.&amp;nbsp; Now, you can do all that, as well as navigate using other providers.&amp;nbsp; Various "MshDrives" are installed, and you can see them by typing "Get-MshDrive".&amp;nbsp; By default, you have drives for mounted disk drives, the registry, ActiveDirectory, Certificates, environment variables, and a few other things.&amp;nbsp; This means you can type:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma color=#808080 size=2&gt;cd HKCU:\&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma color=#808080 size=2&gt;And you're now in your HKEY_CURRENT_USER registry node.&amp;nbsp; You can type "dir" to see everything and interact with objects just as if they were files.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma color=#808080 size=2&gt;You can create your own drives as well.&amp;nbsp; I can type:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma color=#808080 size=2&gt;New-MshDrive -name WinDir -MshProvider FileSystem -root C:\WINNT&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma color=#808080 size=2&gt;And now the WinDir:\ drive is mapped to C:\WinNT.&amp;nbsp; This makes it easy to create shortcuts to long paths.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma color=#808080 size=2&gt;Since every command uses the same parser, there's various intrinsic parameters that work any any command.&amp;nbsp; For example, I can add the -whatif parameter to show what my command would have done without actually doing anything.&amp;nbsp; I don't really have to worry about parsing parameters on the command line.&amp;nbsp; For those of you who like wildcards, they're way better now.&amp;nbsp; I can pretty much use full regular expressions and search for items or commands.&amp;nbsp; Since everything is an object that exposes properties, I can do stuff like "group" the files by their manufacturer, or search for any dll made by NVidia.&amp;nbsp; I can also search for all processes that take up more than 5 megs of RAM.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma color=#808080 size=2&gt;Anyway, I could spend hours going on about this and I've only been using this for a day.&amp;nbsp; I've decided to "hide" cmd.exe and use the new shell exclusively, thus forcing myself to get better with it.&amp;nbsp; For a better explanation by the guy who actually designed the thing, go check out:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;A title=http://channel9.msdn.com/ShowPost.aspx?PostID=25506 href="http://channel9.msdn.com/ShowPost.aspx?PostID=25506"&gt;&lt;FONT style="BACKGROUND-COLOR: #ffffff" face=Tahoma color=#800080&gt;http://channel9.msdn.com/ShowPost.aspx?PostID=25506&lt;/FONT&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;FONT face=Tahoma color=#808080&gt;And for an actual demonstration:&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"&gt;&lt;A title=http://channel9.msdn.com/Showpost.aspx?postid=25915 href="http://channel9.msdn.com/Showpost.aspx?postid=25915"&gt;&lt;FONT face=Tahoma color=#800080&gt;http://channel9.msdn.com/Showpost.aspx?postid=25915&lt;/FONT&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"&gt;&lt;FONT face=Tahoma color=#808080&gt;If any of you are using this, I'd love to hear your comments and any tips and tricks you've learned so far.&amp;nbsp; I'm a complete newbie and am still doing a lot of exploring.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"&gt;&lt;FONT face=Tahoma color=#808080&gt;Thanks,&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"&gt;&lt;FONT face=Tahoma color=#808080&gt;Mike&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=585885" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/mikechr/archive/tags/.NET+Programming/default.aspx">.NET Programming</category><category domain="http://blogs.msdn.com/mikechr/archive/tags/General/default.aspx">General</category></item><item><title>Too many tiers?  Writing efficient multi-tier web applications.</title><link>http://blogs.msdn.com/mikechr/archive/2006/04/05/569620.aspx</link><pubDate>Thu, 06 Apr 2006 07:53:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:569620</guid><dc:creator>mikechr</dc:creator><slash:comments>11</slash:comments><comments>http://blogs.msdn.com/mikechr/comments/569620.aspx</comments><wfw:commentRss>http://blogs.msdn.com/mikechr/commentrss.aspx?PostID=569620</wfw:commentRss><wfw:comment>http://blogs.msdn.com/mikechr/rsscomments.aspx?PostID=569620</wfw:comment><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-FAMILY: Tahoma"&gt;&lt;FONT color=#808080 size=2&gt;A while ago, we were all convinced that dividing our applications up into multiple tiers was the way to go.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;This was great because it allowed you to scale up the parts of your application that might represent a bottleneck, and have more control over what resources were allocated to what tier.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Windows DNA was built on this concept, as well as the whole “&lt;/FONT&gt;&lt;A href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dwamish7/html/vtoriArchitecturalOverview.asp"&gt;&lt;FONT color=#800080 size=2&gt;Duwamish&lt;/FONT&gt;&lt;/A&gt;&lt;FONT size=2&gt;&lt;FONT color=#808080&gt;” architecture.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The problem is, this introduces the possibility of a very “sloppy” implementation of this ideal that creates a much larger bottleneck.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;This is especially true when using slower mechanisms to transport data across tiers.&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-FAMILY: Tahoma"&gt;&lt;o:p&gt;&lt;FONT color=#808080 size=2&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-FAMILY: Tahoma"&gt;&lt;FONT size=2&gt;&lt;FONT color=#808080&gt;Suppose you have a SQL Server backend that pretty much spends its time running stored procedures and returning back datasets.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;You’ve written a stored proc for anything anyone might want to do.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;You have a middleware component that connects to your SQL backend, and this provides a programmable API to access your SQL data via web services.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;This abstracts your actual data store from anyone who wants to program against it, and third parties can simply call into managed APIs to get the data they need.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;No one needs to run some SQL statement or stored proc that might change in the next version.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;There are no SQL injection attacks, and other problems with front ends running SQL commands.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Life is great.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-FAMILY: Tahoma"&gt;&lt;o:p&gt;&lt;FONT color=#808080 size=2&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-FAMILY: Tahoma"&gt;&lt;FONT size=2&gt;&lt;FONT color=#808080&gt;Then, you have a front end written in ASP.NET.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;This front end calls into your web services to get the data it needs.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The problem comes along when the front end (web application) is too tightly coupled with the business layer (web services).&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The web application might call several of these web methods during various stages of rendering a page.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;It might call some APIs to validate the user’s credentials, and then call a web method that returns a dataset to bind to a control, also get some menu data, etc.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;For each of these web service calls, a stored procedure is run.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Now, we pretty much have a 1 to 1 mapping between a web service call and stored procedure call.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;For large data sets, a high percentage (like 40-50% of the page rendering time is simply spent deserializing these datasets across the wire.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;This is especially inefficient when the web server is running on the same physical machine as the business layer.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;ASP.NET will open up a socket, connect to IIS, “POST” in a SOAP envelope, get the results, deserializer this back into a DataSet, then return a reference to this object.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;While this is happening, the thread serving your web page request is blocked waiting for this result (unless you’re using synchronous web service calls, but that’s a huge challenge to design properly.)&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Yes, it’s true “remoting” can solve some of these problems, as well as &lt;A HREF="/mikechr/archive/2006/04/03/567781.aspx"&gt;Indigo&lt;/A&gt;.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;If you have more users hitting your site than you have available threads, this can cause all sorts of perf problems.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Mean while, until the next web service call comes along, your business layer machine is sitting around twiddling its thumbs.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-FAMILY: Tahoma"&gt;&lt;o:p&gt;&lt;FONT color=#808080 size=2&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-FAMILY: Tahoma"&gt;&lt;FONT size=2&gt;&lt;FONT color=#808080&gt;When this architecture was designed, the ideal situation was the higher tiers (meaning the data layer and business layer) were also the lesser used tiers.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The business layer would load in all the data it needed to run, cache it and providing an in-memory representation of the data to work with.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;At an appropriate time, the data could be written back to the database.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The presentation layer would request the data it needed from the business layer and then render it into a form suitable to display to the user.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;In other words, calling into your business layer wouldn’t necessarily mean a call into your data layer unless new data was needed.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-FAMILY: Tahoma"&gt;&lt;o:p&gt;&lt;FONT color=#808080 size=2&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-FAMILY: Tahoma"&gt;&lt;FONT size=2&gt;&lt;FONT color=#808080&gt;For load balancing reasons, everyone seems to want their middleware components to be stateless and not have to worry about caching data and data being out of sync with the database.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-FAMILY: Tahoma"&gt;&lt;o:p&gt;&lt;FONT color=#808080 size=2&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-FAMILY: Tahoma"&gt;&lt;FONT size=2&gt;&lt;FONT color=#808080&gt;Using proper abstraction means that a single call doesn’t drill down into 80 different layers every time it’s called, otherwise why even have this abstraction?&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The same works for “abstracting” your application into logical layers.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;If every call is going to drill down into every single layer every time, why have the layers?&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-FAMILY: Tahoma"&gt;&lt;o:p&gt;&lt;FONT color=#808080 size=2&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-FAMILY: Tahoma"&gt;&lt;FONT size=2&gt;&lt;FONT color=#808080&gt;I think a better approach for certain applications, especially those who have very simple business logic (ie: just grab some data from SQL Server) is to write business objects as sort of a “data adapter.”&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;My data adapter knows how to get my data from a SQL connection and provide an API for me to read and manipulate it.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;My data adapter should be in the form of a DLL that my web application links to.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The DLL knows how to connect to the SQL Server that it’s configured to use.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Multiple instances of my web server, each with their “data adapters” connecting to a cluster of SQL back-ends, can be running to scale up to the demands of my users.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;This is still a layer of abstraction, but doesn’t have a massive bottleneck marshalling the data across the wire between tiers.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;If my front end is super dependent on this data access API, each call should be as lightning fast as I can make it, and that means running it in the same process so I can just return a live pointer to my object.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-FAMILY: Tahoma"&gt;&lt;o:p&gt;&lt;FONT color=#808080 size=2&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-FAMILY: Tahoma"&gt;&lt;FONT size=2&gt;&lt;FONT color=#808080&gt;I could also write a separate web service that also links to my “data adapter” DLL, but provides a SOAP based interface to my API.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;My application doesn’t need to use this, but third parties that wish to program against my backend can easily use this interface.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;There’s really no reason for my own application to be accessing my own business layer via SOAP, it’s inefficient and results in blocking threads and dragging down the CPU.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The amount of effort it takes to marshal a large chunk of data across SOAP is simply not worth the extra scalability that I’m not convinced I’d really have anyway.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;In fact, connecting two tightly coupled tiers that are both owned by me and controlled entirely by me should not be talking in an extensible human readable, 7bit protocol – especially if I’m doing this 30 times for every page I serve up.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-FAMILY: Tahoma"&gt;&lt;o:p&gt;&lt;FONT color=#808080 size=2&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-FAMILY: Tahoma"&gt;&lt;FONT size=2&gt;&lt;FONT color=#808080&gt;If you’re building such an application, I’d be interested in hearing your comments as far as architectural decisions and scalability, and if you’ve done any stress testing with large amounts of data, where your bottlenecks are.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;It’s my opinion that flattening out these tiers into a single process running ASP.NET code and an adapter that can connect to a data backend is the way to go, especially when using SOAP.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;I’d love to hear your comments!&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-FAMILY: Tahoma"&gt;&lt;o:p&gt;&lt;FONT color=#808080 size=2&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-FAMILY: Tahoma"&gt;&lt;FONT size=2&gt;&lt;FONT color=#808080&gt;Mike &lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=569620" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/mikechr/archive/tags/.NET+Programming/default.aspx">.NET Programming</category><category domain="http://blogs.msdn.com/mikechr/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://blogs.msdn.com/mikechr/archive/tags/General/default.aspx">General</category></item><item><title>Welcome!</title><link>http://blogs.msdn.com/mikechr/archive/2006/03/31/566306.aspx</link><pubDate>Sat, 01 Apr 2006 05:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:566306</guid><dc:creator>mikechr</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/mikechr/comments/566306.aspx</comments><wfw:commentRss>http://blogs.msdn.com/mikechr/commentrss.aspx?PostID=566306</wfw:commentRss><wfw:comment>http://blogs.msdn.com/mikechr/rsscomments.aspx?PostID=566306</wfw:comment><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Tahoma color=#808080 size=2&gt;Back in the early days of web development, web pages were simple.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;They used HTML and “web developers” typed in that HTML using powerful text editing programs such as Notepad.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Most of these files were static files stored on a web server, and were rendered out to the client very quickly.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Soon after, CGI was invented.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;This was pretty cool too.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;An HTML request could be handled by an EXE program, and the web server would pass in a string of parameters or a path to a file containing those parameters.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Combined with HTML forms, this made web pages much more useful.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Life was good in those days.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;FONT face=Tahoma color=#808080 size=2&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Tahoma color=#808080 size=2&gt;Today, we have “web applications.”&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;A Web Application is a program that your PM wants to look and feel like a normal Windows application, but goes completely against the entire design of HTML.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Web Applications are littered with script, dynamic content that changes without refreshing the page, behaviors, and bizarre hackery that fetches new data from the server without refreshing the page.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Content is almost never static, and even the frameworks are designed to mimic standard Windows form based programming.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;This style of software design is half programming, half web design, and half voodoo.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Developers who don’t understand the stateless architecture of HTTP are usually lost, and I’ve still yet to meet a programmer who understands both web design &lt;EM&gt;and&lt;/EM&gt; computer science.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Tahoma color=#808080 size=2&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Tahoma color=#808080 size=2&gt;This blog is dedicated to all things related to Web Applications, and specifically those built on the ASP.NET framework which is the most un-web like thing I’ve ever seen.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;I’m a strong believer in good architecture and understanding how things work under the covers, so I put strong emphasis on doing things “the right way” and avoid hacks whenever possible.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Tahoma color=#808080 size=2&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Tahoma color=#808080 size=2&gt;Enjoy!&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Tahoma color=#808080 size=2&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Tahoma color=#808080 size=2&gt;Mike Christensen: Web Dev Guy&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=566306" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/mikechr/archive/tags/General/default.aspx">General</category></item></channel></rss>