﻿<?xml version="1.0" encoding="utf-8"?><rss version="2.0"><channel><title>Ayende @ Rahien</title><link>http://ayende.com</link><description>Ayende @ Rahien</description><copyright>Copyright (C) Ayende Rahien  2004 - 2021 (c) 2026</copyright><ttl>60</ttl><item><title>Lars Wilhelmsen commented on Code Generation and the Open Close Principal</title><description>Not to be annoying or anything - but isn't there a slight difference between "Principal" &amp; "Principle"?
  
  
 --larsw
</description><link>http://ayende.com/3227/code-generation-and-the-open-close-principal#comment4</link><guid>http://ayende.com/3227/code-generation-and-the-open-close-principal#comment4</guid><pubDate>Wed, 23 Apr 2008 12:10:16 GMT</pubDate></item><item><title>Ayende Rahien commented on Code Generation and the Open Close Principal</title><description>You missed this part: "code gen as an architectural approach"
  
I wasn't talking about emitting IL to do something at runtime. I was talking about code gen as an architectural approach, that is, we will define the application using (DB, XML, pretty pictures) and generate the code from there
</description><link>http://ayende.com/3227/code-generation-and-the-open-close-principal#comment3</link><guid>http://ayende.com/3227/code-generation-and-the-open-close-principal#comment3</guid><pubDate>Sun, 30 Mar 2008 12:35:42 GMT</pubDate></item><item><title>Alon Fliess commented on Code Generation and the Open Close Principal</title><description>So JIT is a violation of OCP, it does code generation from IL to assembler. Also any runtime implementation of proxy, interception layer, data accessors, etc. are bad.
  
I don't think that code generation has anything to do with OCP, its the design of your system that has. Code Generation may be based on the same good OO patterns. I have implemented a system were all my code generators are discovered in runtime. They registered themselves to a pub/sub mechanisms that calls them whenever they need to emit their code. I can remove or add a generator without touching any other generator...
  
Any generator can derived from existing one and change the code it emits.
  
This is an OO &amp; OCP based design...
  
  
Alon. 
</description><link>http://ayende.com/3227/code-generation-and-the-open-close-principal#comment2</link><guid>http://ayende.com/3227/code-generation-and-the-open-close-principal#comment2</guid><pubDate>Sun, 30 Mar 2008 07:43:44 GMT</pubDate></item><item><title>Mark Lindell commented on Code Generation and the Open Close Principal</title><description>I agree that Passive code gen can be abused.  
  
  
I particularly don't like passive code gen other than a template starting point to save you some typing.  Come on, snippets are passive code gen and no one would deny the benefit of those, right?
  
  
On the other hand, I do believe that active codegen can be used appropriately to solve the right problems.  Infrastructure that are driven by metadata can benefit from active code generation.  (Proxy generation?)  
  
  
After all, isn't Reflection.Emit a form of active codegen?
  
  
I understand your dislike of code gen as an architectural solution when good design would solve the same problem without violating OCP.  (yeah you know me -- sorry music joke)
</description><link>http://ayende.com/3227/code-generation-and-the-open-close-principal#comment1</link><guid>http://ayende.com/3227/code-generation-and-the-open-close-principal#comment1</guid><pubDate>Sat, 29 Mar 2008 16:37:42 GMT</pubDate></item></channel></rss>