<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Guiding Principles 101</title>
	<atom:link href="http://lostechies.com/chadmyers/2008/02/13/guiding-principles-101/feed/" rel="self" type="application/rss+xml" />
	<link>http://lostechies.com/chadmyers/2008/02/13/guiding-principles-101/</link>
	<description>Software development, testing, and techie life</description>
	<lastBuildDate>Thu, 08 Mar 2012 22:19:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.2</generator>
	<item>
		<title>By: Chad Myers</title>
		<link>http://lostechies.com/chadmyers/2008/02/13/guiding-principles-101/#comment-96</link>
		<dc:creator>Chad Myers</dc:creator>
		<pubDate>Sun, 17 Feb 2008 06:34:20 +0000</pubDate>
		<guid isPermaLink="false">/blogs/chad_myers/archive/2008/02/12/guiding-principles-101.aspx#comment-96</guid>
		<description>@J.P.: Please do share with us how your training session goes. I&#039;d like to hear how the students react to these principles.</description>
		<content:encoded><![CDATA[<p>@J.P.: Please do share with us how your training session goes. I&#8217;d like to hear how the students react to these principles.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: J.P. Hamilton</title>
		<link>http://lostechies.com/chadmyers/2008/02/13/guiding-principles-101/#comment-95</link>
		<dc:creator>J.P. Hamilton</dc:creator>
		<pubDate>Sun, 17 Feb 2008 03:19:31 +0000</pubDate>
		<guid isPermaLink="false">/blogs/chad_myers/archive/2008/02/12/guiding-principles-101.aspx#comment-95</guid>
		<description>The Object Mentor link is good stuff. I first read a lot of that stuff when it came out in the C++ Report back in the 90&#039;s somewhere. I would say that Mr. Martin is directly responsible for putting me on the path to becoming a half-way decent. After reading his articles, I became obsessed with becoming a good programmer, as opposed to just learning my way around the latest and greatest technology. 

What amazes me is how many people have never heard of OCP, SRP, LSP, etc. When I first read about OCP I want to say my skills as a programmer went up a couple of notches right then and there. This stuff taught me how to think in an object-oriented way. It&#039;s immediately useful, which just fascinated me to no end when I first discovered it. 

The company I work for in Houston runs an internal bootcamp for new hires right out of college. Guess what I am going to teach? Maybe, following your call, I&#039;ll post it all on my lame blog.</description>
		<content:encoded><![CDATA[<p>The Object Mentor link is good stuff. I first read a lot of that stuff when it came out in the C++ Report back in the 90&#8242;s somewhere. I would say that Mr. Martin is directly responsible for putting me on the path to becoming a half-way decent. After reading his articles, I became obsessed with becoming a good programmer, as opposed to just learning my way around the latest and greatest technology. </p>
<p>What amazes me is how many people have never heard of OCP, SRP, LSP, etc. When I first read about OCP I want to say my skills as a programmer went up a couple of notches right then and there. This stuff taught me how to think in an object-oriented way. It&#8217;s immediately useful, which just fascinated me to no end when I first discovered it. </p>
<p>The company I work for in Houston runs an internal bootcamp for new hires right out of college. Guess what I am going to teach? Maybe, following your call, I&#8217;ll post it all on my lame blog.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chad Myers</title>
		<link>http://lostechies.com/chadmyers/2008/02/13/guiding-principles-101/#comment-94</link>
		<dc:creator>Chad Myers</dc:creator>
		<pubDate>Thu, 14 Feb 2008 22:24:19 +0000</pubDate>
		<guid isPermaLink="false">/blogs/chad_myers/archive/2008/02/12/guiding-principles-101.aspx#comment-94</guid>
		<description>@Mike:

I guess it depends on whether you&#039;re building a system which happens to have a web interface, or a web application based on RoR.

If you&#039;re all in to RoR then AR makes perfect sense because you&#039;re not going to use it for anything else.

But what about when you&#039;re not making web applications, or rather, what about when you&#039;re making your own framework that provides business logic that can be used by a web application, a backend service (web service), or maybe even out in the field disconnected on a field engineer&#039;s laptop?

I need to build my model to serve the business need. Not serve the database, or a web framework, or any other framework/context in which my  model may run.

My model and associated business logic has no inherent need to be tied to a database, IoC container, or anything else so why should I go about tying myself totally to one of those things?</description>
		<content:encoded><![CDATA[<p>@Mike:</p>
<p>I guess it depends on whether you&#8217;re building a system which happens to have a web interface, or a web application based on RoR.</p>
<p>If you&#8217;re all in to RoR then AR makes perfect sense because you&#8217;re not going to use it for anything else.</p>
<p>But what about when you&#8217;re not making web applications, or rather, what about when you&#8217;re making your own framework that provides business logic that can be used by a web application, a backend service (web service), or maybe even out in the field disconnected on a field engineer&#8217;s laptop?</p>
<p>I need to build my model to serve the business need. Not serve the database, or a web framework, or any other framework/context in which my  model may run.</p>
<p>My model and associated business logic has no inherent need to be tied to a database, IoC container, or anything else so why should I go about tying myself totally to one of those things?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike Moore</title>
		<link>http://lostechies.com/chadmyers/2008/02/13/guiding-principles-101/#comment-93</link>
		<dc:creator>Mike Moore</dc:creator>
		<pubDate>Thu, 14 Feb 2008 21:20:44 +0000</pubDate>
		<guid isPermaLink="false">/blogs/chad_myers/archive/2008/02/12/guiding-principles-101.aspx#comment-93</guid>
		<description>@Chad I totally agree with you about implementing interfaces and deriving from base classes violating the separation of concerns when it comes to long-term maintainability and support of your middle-ware libraries in a statically compiled world. Your point about lugging around NHibernate or Castle ActiveRecord with your domain models is exactly why I don&#039;t use them. My understanding is that it is really hard to make full use of NHibernate or Castle if you don&#039;t let the implementation details of those frameworks peek leak through. This is why I typically don&#039;t use a &quot;framework&quot; to create my domain models and manage their persistence to and from the data store when using C#.

To your Ruby example, I have alot more flexibility in Ruby because isn&#039;t using static type-checking at compile-time. If I wanted to swap out my ActiveRecord model for a DataMapper model, I just have to retain the behavior. My DM model simply has to quack like my AR model. Because my business logic isn&#039;t dependent on implementation details such as the parent class of the model, I am free to make changes as long as I don&#039;t change the behavior my application uses. I can&#039;t do that in C# because the static type-checking won&#039;t allow me to swap out models without recompiling my application. This is the crucial difference between polymorphism through composition vs. inheritance, and the late-bound nature of dynamic dispatch vs. the early compile-time type-checking of static languages.

While you make a great point about ActiveRecord models requiring a database to work, I don&#039;t think this is as much of a real world hurdle as you might make it out to be. In the case of AR, the dependence of the database is serving a very specific purpose. If you want to use a model in a different way or for a different purpose, you should use either a different library (like DataMapper) or a completely different approach (like RESTful web services, or a document based database, or memcached, or whatever). Every abstraction leaks, and there is no silver bullet. So rather than depending on a framework to offer infinite flexibility and do all the heavy lifting, we are free to choose the implementation that makes the most sense for our needs. In short, you approach the problem differently.</description>
		<content:encoded><![CDATA[<p>@Chad I totally agree with you about implementing interfaces and deriving from base classes violating the separation of concerns when it comes to long-term maintainability and support of your middle-ware libraries in a statically compiled world. Your point about lugging around NHibernate or Castle ActiveRecord with your domain models is exactly why I don&#8217;t use them. My understanding is that it is really hard to make full use of NHibernate or Castle if you don&#8217;t let the implementation details of those frameworks peek leak through. This is why I typically don&#8217;t use a &#8220;framework&#8221; to create my domain models and manage their persistence to and from the data store when using C#.</p>
<p>To your Ruby example, I have alot more flexibility in Ruby because isn&#8217;t using static type-checking at compile-time. If I wanted to swap out my ActiveRecord model for a DataMapper model, I just have to retain the behavior. My DM model simply has to quack like my AR model. Because my business logic isn&#8217;t dependent on implementation details such as the parent class of the model, I am free to make changes as long as I don&#8217;t change the behavior my application uses. I can&#8217;t do that in C# because the static type-checking won&#8217;t allow me to swap out models without recompiling my application. This is the crucial difference between polymorphism through composition vs. inheritance, and the late-bound nature of dynamic dispatch vs. the early compile-time type-checking of static languages.</p>
<p>While you make a great point about ActiveRecord models requiring a database to work, I don&#8217;t think this is as much of a real world hurdle as you might make it out to be. In the case of AR, the dependence of the database is serving a very specific purpose. If you want to use a model in a different way or for a different purpose, you should use either a different library (like DataMapper) or a completely different approach (like RESTful web services, or a document based database, or memcached, or whatever). Every abstraction leaks, and there is no silver bullet. So rather than depending on a framework to offer infinite flexibility and do all the heavy lifting, we are free to choose the implementation that makes the most sense for our needs. In short, you approach the problem differently.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: chadmyers</title>
		<link>http://lostechies.com/chadmyers/2008/02/13/guiding-principles-101/#comment-92</link>
		<dc:creator>chadmyers</dc:creator>
		<pubDate>Thu, 14 Feb 2008 20:21:47 +0000</pubDate>
		<guid isPermaLink="false">/blogs/chad_myers/archive/2008/02/12/guiding-principles-101.aspx#comment-92</guid>
		<description>@Mike I&#039;m disappointed there aren&#039;t more comments too :)

I chose Ignorance over Agnostic on purpose because you don&#039;t want your code to be totally dependent (i.e. compiled/interpreted-against) a specific framework. 

(loading standard anti-ActiveRecord argument in 3... 2... 1...)

I have a domain model. It gets persisted somehow, I don&#039;t care. In a separate assembly/dll, I have all the stuff that cares about how the model gets persisted. I could chose to switch off NHibernate and go with something else in the future, or maybe I want to use the domain model in-memory with persisting anything. Having my classes attributed heavily or having to derive from interfaces or base classes violates this. now, whenever I want to do anything with my model (even if I don&#039;t need to persist or retrieve anything from a database, I now have to lug along NHibernate or Castle ActiveRecord (and probably have to have a bunch of junk in my config file) just to make those two happy when I don&#039;t even care about it.

Likewise, in your Ruby AR example, you are completely tied to AR. Hopefully you won&#039;t have to ever use your model for anything other than RoR work because you&#039;ll be SOL for the most part.

Sure, you could code around it, or find a way to host it without a database or something, but now you&#039;re having to worry about it.

Instead of the persistence mechanism serving (transparently) your model, your model is serving the persistence mechanism.</description>
		<content:encoded><![CDATA[<p>@Mike I&#8217;m disappointed there aren&#8217;t more comments too :)</p>
<p>I chose Ignorance over Agnostic on purpose because you don&#8217;t want your code to be totally dependent (i.e. compiled/interpreted-against) a specific framework. </p>
<p>(loading standard anti-ActiveRecord argument in 3&#8230; 2&#8230; 1&#8230;)</p>
<p>I have a domain model. It gets persisted somehow, I don&#8217;t care. In a separate assembly/dll, I have all the stuff that cares about how the model gets persisted. I could chose to switch off NHibernate and go with something else in the future, or maybe I want to use the domain model in-memory with persisting anything. Having my classes attributed heavily or having to derive from interfaces or base classes violates this. now, whenever I want to do anything with my model (even if I don&#8217;t need to persist or retrieve anything from a database, I now have to lug along NHibernate or Castle ActiveRecord (and probably have to have a bunch of junk in my config file) just to make those two happy when I don&#8217;t even care about it.</p>
<p>Likewise, in your Ruby AR example, you are completely tied to AR. Hopefully you won&#8217;t have to ever use your model for anything other than RoR work because you&#8217;ll be SOL for the most part.</p>
<p>Sure, you could code around it, or find a way to host it without a database or something, but now you&#8217;re having to worry about it.</p>
<p>Instead of the persistence mechanism serving (transparently) your model, your model is serving the persistence mechanism.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike Moore</title>
		<link>http://lostechies.com/chadmyers/2008/02/13/guiding-principles-101/#comment-91</link>
		<dc:creator>Mike Moore</dc:creator>
		<pubDate>Thu, 14 Feb 2008 18:38:41 +0000</pubDate>
		<guid isPermaLink="false">/blogs/chad_myers/archive/2008/02/12/guiding-principles-101.aspx#comment-91</guid>
		<description>I&#039;m kinda disappointed there aren&#039;t any other comments on this post yet. I appreciate the link to the Object Mentor papers, thanks. (I even like the PDFs, as they print nicer than web pages.)

At first I was fearful that the second half of this post was going to rail on me for not knowing every little detail of every framework out there. I thought you were going to say that being ignorant of said frameworks is an anti-pattern and that I should repent. I&#039;m glad you haven&#039;t forced me to face my sins.

Actually, I think the principle is misnamed. I think it should really be named something like the Framework Agnostic Principle. The more I think of it, &quot;agnostic&quot; might not be the right term, but I don&#039;t know a better one. I want it to mean religious, but not a believer in any particular church or sect. Perhaps anti-disestablishment non-sectarianism is a better term? I dunno. Basically, you don&#039;t need to be ignorant of the framework, just don&#039;t give yourself fully to it.

That said, and at the risk of repeating myself, I tend to think that the existence of so many &quot;frameworks&quot; is a sign of trouble. In Ruby, we don&#039;t consider ActiveRecord or Sequel or DataMapperto be frameworks; they are simply libraries. The fact that we need, or think we need, a framework to solve our problems gives me pause.</description>
		<content:encoded><![CDATA[<p>I&#8217;m kinda disappointed there aren&#8217;t any other comments on this post yet. I appreciate the link to the Object Mentor papers, thanks. (I even like the PDFs, as they print nicer than web pages.)</p>
<p>At first I was fearful that the second half of this post was going to rail on me for not knowing every little detail of every framework out there. I thought you were going to say that being ignorant of said frameworks is an anti-pattern and that I should repent. I&#8217;m glad you haven&#8217;t forced me to face my sins.</p>
<p>Actually, I think the principle is misnamed. I think it should really be named something like the Framework Agnostic Principle. The more I think of it, &#8220;agnostic&#8221; might not be the right term, but I don&#8217;t know a better one. I want it to mean religious, but not a believer in any particular church or sect. Perhaps anti-disestablishment non-sectarianism is a better term? I dunno. Basically, you don&#8217;t need to be ignorant of the framework, just don&#8217;t give yourself fully to it.</p>
<p>That said, and at the risk of repeating myself, I tend to think that the existence of so many &#8220;frameworks&#8221; is a sign of trouble. In Ruby, we don&#8217;t consider ActiveRecord or Sequel or DataMapperto be frameworks; they are simply libraries. The fact that we need, or think we need, a framework to solve our problems gives me pause.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
