<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" 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/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>IDisposable Thoughts</title>
	
	<link>http://cprieto.com</link>
	<description>Honey... where's my coding t-shirt?</description>
	<lastBuildDate>Tue, 13 Dec 2011 12:28:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/IdisposableThoughts" /><feedburner:info uri="idisposablethoughts" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Proxima VAN, HTML5 para los no iniciados y curiosos</title>
		<link>http://feedproxy.google.com/~r/IdisposableThoughts/~3/NnZJ_GaEYs4/</link>
		<comments>http://cprieto.com/2011/12/13/proxima-van-html5-para-los-no-iniciados/#comments</comments>
		<pubDate>Tue, 13 Dec 2011 12:28:34 +0000</pubDate>
		<dc:creator>cristian</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[alt.net]]></category>
		<category><![CDATA[evento]]></category>
		<category><![CDATA[van]]></category>
		<category><![CDATA[web dev]]></category>

		<guid isPermaLink="false">http://cprieto.com/2011/12/13/proxima-van-html5-para-los-no-iniciados/</guid>
		<description><![CDATA[Este sabado 17 de diciembre tendre el placer de compartir con la comunidad de Alt.Net Hispano el codiciado tema “HTML5 para los no iniciados”, si, eso que esta sonando por todos lados acerca de HTML5, que tan raro es? como &#8230; <a href="http://cprieto.com/2011/12/13/proxima-van-html5-para-los-no-iniciados/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Este sabado 17 de diciembre tendre el placer de compartir con la comunidad de <a href="http://altnethispano.org/Inicio.aspx">Alt.Net Hispano</a> el codiciado tema “HTML5 para los no iniciados”, si, eso que esta sonando por todos lados acerca de HTML5, que tan raro es? como se come? me curara la caries? Tantas preguntas, tanto material.</p>
<p>HTML5 es muchisimo mas que un estandar, mucho mas que un simple buzz, va bastante mas alla de un simple lenguaje de markup. Tratare de explicar HTML5 desde el punto de vista de un desarrollador web, especialmente que implica para un developer de ASP.NET.</p>
<p>El evento pueden encontrarlo en el <a href="http://bit.ly/vZx2xk">link de Google Calendar</a>, no olviden hacer la transformacion en su huso horario.</p>
<img src="http://feeds.feedburner.com/~r/IdisposableThoughts/~4/NnZJ_GaEYs4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://cprieto.com/2011/12/13/proxima-van-html5-para-los-no-iniciados/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://cprieto.com/2011/12/13/proxima-van-html5-para-los-no-iniciados/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=proxima-van-html5-para-los-no-iniciados</feedburner:origLink></item>
		<item>
		<title>JustCode is not loading in Visual Studio 2011</title>
		<link>http://feedproxy.google.com/~r/IdisposableThoughts/~3/oUce_0__TVc/</link>
		<comments>http://cprieto.com/2011/11/06/justcode-is-not-loading-in-visual-studio-2011/#comments</comments>
		<pubDate>Sat, 05 Nov 2011 16:39:49 +0000</pubDate>
		<dc:creator>cristian</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[2011]]></category>
		<category><![CDATA[debugging]]></category>
		<category><![CDATA[extensibility]]></category>
		<category><![CDATA[justcode]]></category>
		<category><![CDATA[mef]]></category>
		<category><![CDATA[visual studio]]></category>

		<guid isPermaLink="false">http://cprieto.com/index.php/2011/11/06/justcode-its-not-loading-in-visual-studio-2011/</guid>
		<description><![CDATA[Telerik’s JustCode it’s an awesome product, it’s a very lightweight extension that may lack some features (sorry, I won’t mention names) but it does its job, and that’s good. Almost a month ago Telerik announced JustCode support for Visual Studio &#8230; <a href="http://cprieto.com/2011/11/06/justcode-is-not-loading-in-visual-studio-2011/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.telerik.com/products/justcode.aspx">Telerik’s JustCode</a> it’s an <a href="http://blogs.telerik.com/justteam/posts.aspx">awesome product</a>, it’s a very lightweight extension that may lack some features (sorry, I won’t mention names) but it does its job, and that’s good. Almost a month ago <a href="http://blogs.telerik.com/justteam/posts/11-09-22/justcode-support-for-visual-studio-11.aspx">Telerik announced JustCode support for Visual Studio 2011</a>, that’s awesome, specially when I decided to try out Visual Studio 2011 in a pristine installation inside a virtual machine (and yeah, I know other extensions <a href="http://blogs.jetbrains.com/dotnet/2011/11/resharper-61-eap-opens-much-more-than-a-bugfix-release/">already announced</a> <a href="http://www.devexpress.com/Home/Announces/2011-coderush-vs-11-build.xml">the same</a>).</p>
<p><a href="http://cprieto.com/wp-content/uploads/2011/11/installer.png" rel="lightbox[731]"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="installer" border="0" alt="installer" src="http://cprieto.com/wp-content/uploads/2011/11/installer_thumb.png" width="416" height="322"></a></p>
<p>I downloaded the JustCode internal build and the installer correctly detected my Visual Studio 2011 installation, sweet, everything finished without any problem. Then when I started Visual Studio 2011 I realized JustCode didn’t load… and all what I get it’s a very verbose exception in the JustCode’s output window:</p>
<p><code>ERROR 2011-10-23 00:23:38.842 :&nbsp; [HResult: 80131602] <br />System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.<br />&nbsp;&nbsp; at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)<br />&nbsp;&nbsp; at System.Reflection.RuntimeModule.GetTypes()<br />&nbsp;&nbsp; at System.Reflection.Assembly.GetTypes()<br />&nbsp;&nbsp; at System.ComponentModel.Composition.Hosting.AssemblyCatalog.get_InnerCatalog()<br />[and a lot of more lines...]</code></p>
<p>I submitted some bug tickets, write to some Telerik’s developers but no right answers, you know, the usual.</p>
<p>Well, I decided to see what’s happened, so I did what every other developer would do, attach your debugger to Visual Studio and then found the issue. JustCode is trying to load the assembly <strong>Microsoft.VisualStudio.CSharp.Services.Language, Version=10.0.0.0</strong> but <em>in a machine without Visual Studio 2010 this assembly didn’t exist</em>, it’s unique of a Visual Studio 2010 installation. Of course, I’m using a Virtual Machine snapshot, I don’t have a previous version installed. The assembly present in my VS2011 installation is <strong>Version=11.0.0.0</strong>.</p>
<p>The easy way to fix it? Go to a Visual Studio 2010 installation, copy the assembly Microsoft.VisualStudio.CSharp.Services.Language.dll from the Common7 directory and paste into your Telerik’s JustCode directory, that’s all, JustCode now it’s going to load. Maybe this would cause some other problems, but come on, it was my first attempt! =)</p>
<p>Probably a better way to fix it would be using <a href="http://msdn.microsoft.com/en-us/library/7wd6ex19.aspx">assembly binding redirection</a>, or taking care of the fact that <em>maybe</em> a previous installation it’s not present maybe in the installation process. I’m just saying!</p>
<p><strong>Note for developers in general</strong>: it’s a good idea to test your installation in a pristine installation before release it to the wild, just to see what’s happening, you know, just in case =)</p>
<img src="http://feeds.feedburner.com/~r/IdisposableThoughts/~4/oUce_0__TVc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://cprieto.com/2011/11/06/justcode-is-not-loading-in-visual-studio-2011/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://cprieto.com/2011/11/06/justcode-is-not-loading-in-visual-studio-2011/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=justcode-is-not-loading-in-visual-studio-2011</feedburner:origLink></item>
		<item>
		<title>El espejismo de la separacion por capas, toma dos</title>
		<link>http://feedproxy.google.com/~r/IdisposableThoughts/~3/8R9fcvHuOWo/</link>
		<comments>http://cprieto.com/2011/10/28/el-espejismo-de-la-separacion-por-capas-toma-dos/#comments</comments>
		<pubDate>Fri, 28 Oct 2011 03:13:40 +0000</pubDate>
		<dc:creator>cristian</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[personal]]></category>
		<category><![CDATA[architecture]]></category>
		<category><![CDATA[rant]]></category>

		<guid isPermaLink="false">http://cprieto.com/index.php/2011/10/28/el-espejismo-de-la-separacion-por-capas-toma-dos/</guid>
		<description><![CDATA[Hace varios meses escribí un blog post (que quise luego transformar en serie y como cosa rara en mi por tiempo nunca llegue a continuarlo) en el que indicaba mi falta de amor a la palabra &#8220;capas&#8221;&#8230;. El concepto de &#8230; <a href="http://cprieto.com/2011/10/28/el-espejismo-de-la-separacion-por-capas-toma-dos/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://cprieto.com/wp-content/uploads/2011/10/app_3.gif" rel="lightbox[728]"><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px 6px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; float: left; border-top: 0px; border-right: 0px; padding-top: 0px" title="app_3" border="0" alt="app_3" align="left" src="http://cprieto.com/wp-content/uploads/2011/10/app_3_thumb.gif" width="244" height="155"></a>Hace varios meses escribí <a href="http://cprieto.com/index.php/2010/05/21/el_espejismo_de_la_separacion_por_capas/">un blog post</a> (que quise luego transformar en serie y como cosa rara en mi por tiempo nunca llegue a continuarlo) en el que indicaba mi falta de amor a la palabra &#8220;capas&#8221;&#8230;.
<p>El concepto de &#8220;capas&#8221; o &#8220;layers&#8221; me parece desde unos años para acá tan ortodoxo, viejo, fuera de lugar, obsoleto, mal aplicado, afuera totalmente de contexto. La idea de capas tenía mucho sentido hace décadas atrás (tampoco décadas pero fue hace tiempo) cuando los programadores cavernícolas (en los cuales me incluyo yo picando piedra) teníamos que depender fuertemente en la base de datos, hacíamos las consultas en plano SQL, insertábamos directamente en plano SQL, y si mi DB me la movían literalmente movían mi aplicación.
<p>Esto tenía todo el sentido del mundo en nuestras aplicaciones no tan complejas y sin mucha orientación lógica que hacíamos en aplicaciones desktops o web, o sea, en vez de escribir cientos de líneas SQL esparcidas por doquier en nuestro código de php (por ejemplo), mejor lo abstraíamos todo en un solo lugar donde estaba guardadito nuestro SQL, ahí en su cajita, donde nadie lo tocaba y si alguien lo tocaba era una vez (como que si tocar una consulta no involucrara cambiar algo&#8230; silly us). Esto se llevó un paso adelante y en vez de poner consultas como SELECT * FROM [tabla] mejor usamos SP&#8217;s, así que cambiamos eso por EXEC usp_MiConsulta, esto dio origen a otro problema, pero vamos a ir al grano primero.
<p>En ese tiempo la gente comenzó a percatarse de algo, si abstraigo las consultas a la DB, luego las llamadas a la DB en otro lado, puedo entonces poner la &#8220;lógica&#8221; de negocio en otro lado y sobre ella hacer la UI. Esto tenía mucho sentido y asi nació el concepto de &#8220;layers&#8221;&#8230; Tiene sentido, tenía sentido en ese tiempo, teníamos aplicaciones con el &#8220;típico&#8221; color aqua y un par de botones con iconos de puertas y equis tachadas en primera plana, con una grid para mostrar facturas y un botón donde agregábamos una factura nueva (generalmente con el icono más o con un lapicito que aun no entiendo porque aparecía ahí).
<p>Luego vino la moda SOA (que pareciera nunca acabar) y dijeron, va, ahora en vez de hablar directamente la lógica con la data, vamos a tener alguien en el medio que expone esa data por un servicio. Entonces hablamos de SOA&#8230; como ya no eran 3 capas si no 4 o más renombramos el modelo a n-Capas&#8230;. y aun me perfora el oído escucharlo&#8230;.
<p>He visto degeneraciones de este modelo, un &#8220;buen&#8221; ejemplo son las aplicaciones ejemplo de MS, donde abstraen todo a servicios que al final el mismo objeto desde el comienzo al fin es el mismo. Es increíble pero he visto a desarrolladores veteranos que aun insisten en usar su versión de servicio para exponer todo, pero esa es otra historia&#8230;
<p>Nuevamente recalco, eso tenía sentido *en ese tiempo* los ORM&#8217;s o no existían o eran sumamente rudimentarios, la mayoría de db devs que habían estaban aún acostumbrados a hacer _todo_ en la DB (no, en serio, una vez vi una app que hasta el proceso de pago de paypal era hecho internamente en la DB), tenía sentido cuando tu aplicacion era la tipica aplicación con botones grandes y background aqua&#8230; Tenía sentido cuando decías que abstraías el acceso a datos en una clase que por lo general comenzaba por una pequeña clase con un par de métodos y terminaba como cientos&#8230; porque tal cosa como reutilizar el acceso a datos se tornó un santo grial.
<p>Eso no tiene sentido HOY, cuando nuestros objetos son (o deberían ser) ricos en comportamiento, cuando modelamos en base a lo que _va a pasar y hacer nuestra aplicación_ no en cuanto a la data que va a contener la base de datos (puntos extras para el que comprenda la diferencia entre ambos approaches en la oración anterior). No tiene sentido hoy que nuestra &#8220;lógica de negocio&#8221; realmente puede ser embebida en el objeto del dominio o de negocio, donde hacemos una distinción entre lógica de negocio (o reglas del negocio) y lógica de presentación (que como dice el nombre solamente afecta la vista). No tiene sentido cuando no interactuamos contra solo una base de datos si no contra base de datos, archivos, servicios (y generalmente varios). No tiene sentido porque no le veo ni cara ni cuerpo a tener un ORM (por simple que sea) y envolver las mismas entidades y exponerlas mediante otras entidades que contienen los mismos símbolos, no tiene sentido hablar de capa de acceso a datos ya que tus Objetos de ORM no solamente viven ahí y pueden contener la lógica que tanto necesitas en la &#8220;siguiente&#8221; capa. No tiene sentido en un mundo donde el programador está acostumbrado (y hasta espera) que la consulta se genere automáticamente mediante Linq, no tiene sentido en un mundo donde ya no escribimos SQL a mano.
<p>¿No te gusta un ORM porque tiene demasiada carga para lo que necesitas? bueno usa un <a href="http://code.google.com/p/dapper-dot-net/">MicroORM</a>&#8230; y aun así sigues sin hablar de capa de datos, tal cosa ya no existe. Ni siquiera Microsoft con sus prácticas habla de layers&#8230;. Vamos, ahora ni en PHP puedes tener el coraje de decir que tienes que escribir SQL a mano, porque entonces abstraer todo en una “capa”, ¿quieren producir algo de misterio? Traten de preguntarle a un programador de Rails donde está su capa de datos, no existe, ¿porque?&#8230; No es necesaria tal separación.
<p>Ahora, lo que si debes distinguir es el concepto de <a href="http://en.wikipedia.org/wiki/Business_logic">Tiers</a>, una aplicación si va a tener varios Tiers, la base de datos (a menos que sea embebida) vivirá y es por definición un tier, ¿expones servicios? bueno, otro tier mas&#8230;. Un tier es una separación física de la cual no puedes deshacerte, una layer es una separación lógica que realmente no tiene sentido en un mundo ágil donde no usamos 6 meses &#8220;diseñando&#8221; la aplicación.
<p>Algún día ordenare todos mis pensamientos y terminare escribiendo un poco más sobre porque el concepto de layer sigue siendo obsoleto, por lo menos para mí.
<p><strong>NOTA</strong>: Este fue un largo correo en la lista de Alt.Net hispano que termino siendo tan largo que llego a ocupar un blog post.</p>
<img src="http://feeds.feedburner.com/~r/IdisposableThoughts/~4/8R9fcvHuOWo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://cprieto.com/2011/10/28/el-espejismo-de-la-separacion-por-capas-toma-dos/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		<feedburner:origLink>http://cprieto.com/2011/10/28/el-espejismo-de-la-separacion-por-capas-toma-dos/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=el-espejismo-de-la-separacion-por-capas-toma-dos</feedburner:origLink></item>
		<item>
		<title>Generating generic delegates with expression trees</title>
		<link>http://feedproxy.google.com/~r/IdisposableThoughts/~3/PO3649uxunA/</link>
		<comments>http://cprieto.com/2011/10/22/generating-generic-delegates-with-expression-trees/#comments</comments>
		<pubDate>Fri, 21 Oct 2011 14:58:51 +0000</pubDate>
		<dc:creator>cristian</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[bdd]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[functional programming]]></category>
		<category><![CDATA[mfakes]]></category>
		<category><![CDATA[mspec]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://cprieto.com/index.php/2011/10/22/generating-generic-delegates-with-expression-trees/</guid>
		<description><![CDATA[A few weeks ago I was working in a patch for an awesome mocking meta framework named mfakes, a very awesome mocking meta-framework based in the spicy Machine Specification BDD testing framework, go, try it, you are going to love &#8230; <a href="http://cprieto.com/2011/10/22/generating-generic-delegates-with-expression-trees/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>A few weeks ago I was working in a patch for an awesome mocking meta framework named <a href="https://github.com/BjRo/Machine.Fakes">mfakes</a>, a very awesome mocking meta-framework based in the spicy <a href="https://github.com/machine/machine.specifications">Machine Specification</a> BDD testing framework, go, try it, you are going to love it!.</p>
<p>Well, one of the awesome points in mfakes it’s to abstract mocking frameworks, so mfakes provides adapters for popular mocking frameworks like <a href="http://hibernatingrhinos.com/open-source/rhino-mocks">Rhino Mocks</a>, <a href="http://code.google.com/p/moq/">Moq</a>, <a href="http://nsubstitute.github.com/">NSubstitute</a> and <a href="http://code.google.com/p/fakeiteasy/">FakeItEasy</a>. So instead of thinking which one to use, just concentrate in the test. Simple.</p>
<p>Anyway, there was a feature lacking in mfakes, and as every developer when something it’s lacking a feature you just go ahead and implement it, nothing beats open source. The interesting point was trying to “wrap” different way to interact between every mocking framework, everyone has a different way to see the world, it’s not bad, but it’s different. I found a very interesting problem with FakeItEasy and constructor parameters in a Mock.</p>
<p>In most mocking frameworks there’s an easy way to specify constructor parameters for a mock, in Moq, for example, you just do something like this:</p>
<pre class="brush: csharp;">var foo = new Mock&lt;T&gt;("foo", "bar");

// Generate this it's easy, it's just a simple generic type
// with a parameter list

public object CreateFake(Type interfaceType, params object[] args) {
    var closedMockType = typeof(Mock&lt;&gt;).MakeGenericType(interfaceType);
    var objectProperty = closedMockType.GetProperty("Object", closedMockType);
    var instance = (args != null &amp;&amp; args.Length &gt; 0)
        ? Activator.CreateInstance(closedMockType, args) : Activator.CreateInstance(closedMockType);
    return objectProperty.GetValue(instance, null);
}
</pre>
<p>The problem it’s that FakeItEasy it’s magic, and uses a very nice strong typed way to do it</p>
<pre class="brush: csharp;">var foo = A.Fake&lt;FooClass&gt;(x =&gt;
    x.WithArgumentsForConstructor(
        new[] object {"foo", "bar"}));
// Another way to do it, more strongly-typed
var foo = A.Fake&lt;FooClass&gt;(x =&gt;
    x.WithArgumentsForConstructor(
        ()=&gt; new FooClass("foo", "bar")));
</pre>
<p>Well, if you think about that, there’s not a simple way to abstract a non-generic, non-typed expression with a generic, strong-typed, functional expression, well, not a simple way to do it at least you use the expressiveness of binary expression trees. How do we abstract this? well, let’s see the simple expression:</p>
<p>Now, let’s create a function to return that expression based in parameters, let’s abstract everything with the only knowlege of the type and the parameters:</p>
<pre class="brush: csharp;">// Transforming this:
var foo = A.Fake&lt;T&gt;(Action&lt;IFakeOptionsBuilder&lt;T&gt;&gt; opts)

// Implies something like this
public static Delegate CreateForType(Type type, object[] args) {
    var optType = typeof(IFakeOptionsBuilder&lt;&gt;).MakeGenericType(new[] { type });
    var actType = typeof(Action&lt;&gt;).MakeGenericType(new[] { optType });

// Now we have the type for the action and the options builder
// Let's use it to create an expression tree!

    var r = Expression.Parameter(optType, "r");
    var method = optType.GetMethod("WithArgumentsForConstructor", new[] { typeof(IEnumerable&lt;object&gt;) });
    var p = Expression.Constant(ctorArgs);
    var call = Expression.Call(r, method, p);
    var lambda = Expression.Lambda(actType, call, new[] { r });
    var exp = lambda.Compile();
}
</pre>
<p>And well, now that we have the function to call (we generated it), it&#8217;s time to create the fake</p>
<pre class="brush: csharp;">public object CreateFake(Type type, params object[] args) {
    var closedFakeType = typeof(Fake&lt;&gt;).MakeGenericType(interfaceType);
    var objectProperty = closedFakeType.GetProperty("FakedObject", interfaceType);

    var options = args != null &amp;&amp; args.Length &gt; 0
        ? FakeItEasyHelper.CreateForType(interfaceType, args) : null;

    var instance = args != null &amp;&amp; args.Length &gt; 0
        ? Activator.CreateInstance(closedFakeType, new object[] {options})
        : Activator.CreateInstance(closedFakeType);

    return objectProperty.GetValue(instance, null);
}
</pre>
<p>See? that’s the reason because Functional programming it’s so awesome, functions are just another variable, you can generate them, use them, modify them, use them. Next time you have a problem try to think in a functional way, you will see how awesome is!.</p>
<p>More about Expression Trees in the amazing book <a href="http://www.amazon.com/gp/product/1935182471/ref=as_li_ss_tl?ie=UTF8&amp;tag=idispthoug-20&amp;linkCode=as2&amp;camp=217145&amp;creative=399369&amp;creativeASIN=1935182471">C# in Depth, Second Edition</a><img style="border-bottom-style: none !important; margin: 0px; border-left-style: none !important; border-top-style: none !important; border-right-style: none !important" border="0" alt="" src="http://www.assoc-amazon.com/e/ir?t=idispthoug-20&amp;l=as2&amp;o=1&amp;a=1935182471&amp;camp=217145&amp;creative=399369" width="1" height="1"> by John Skeet or go and pick a functional language (like this <a href="http://www.amazon.com/gp/product/0596153643/ref=as_li_ss_tl?ie=UTF8&amp;tag=idispthoug-20&amp;linkCode=as2&amp;camp=217145&amp;creative=399369&amp;creativeASIN=0596153643">Programming F#</a><img style="border-bottom-style: none !important; margin: 0px; border-left-style: none !important; border-top-style: none !important; border-right-style: none !important" border="0" alt="" src="http://www.assoc-amazon.com/e/ir?t=idispthoug-20&amp;l=as2&amp;o=1&amp;a=0596153643&amp;camp=217145&amp;creative=399369" width="1" height="1">), study it, enjoy it, use it in your favourite non-functional language.</p>
<p>Happy coding!</p>
<p><strong>NOTE:</strong> the patch it’s already included in mfakes, no worries!</p>
<img src="http://feeds.feedburner.com/~r/IdisposableThoughts/~4/PO3649uxunA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://cprieto.com/2011/10/22/generating-generic-delegates-with-expression-trees/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://cprieto.com/2011/10/22/generating-generic-delegates-with-expression-trees/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=generating-generic-delegates-with-expression-trees</feedburner:origLink></item>
		<item>
		<title>Dennis Ritchie</title>
		<link>http://feedproxy.google.com/~r/IdisposableThoughts/~3/4DZWCSyb-1g/</link>
		<comments>http://cprieto.com/2011/10/13/dennis-ritchie/#comments</comments>
		<pubDate>Thu, 13 Oct 2011 10:03:03 +0000</pubDate>
		<dc:creator>cristian</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[personal]]></category>
		<category><![CDATA[people]]></category>

		<guid isPermaLink="false">http://cprieto.com/index.php/2011/10/13/dennis-ritchie/</guid>
		<description><![CDATA[Today I read very sad news, Dennis Ritchie is dead. A person that literally changed my life (I remember reading The C Language and trying to make myself clear what a pointer was). I decided to become a developer when &#8230; <a href="http://cprieto.com/2011/10/13/dennis-ritchie/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://cprieto.com/wp-content/uploads/2011/10/Dennis_MacAlistair_Ritchie_.jpg" rel="lightbox[721]"><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px 10px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; float: left; border-top: 0px; border-right: 0px; padding-top: 0px" title="Dennis_MacAlistair_Ritchie_" border="0" alt="Dennis_MacAlistair_Ritchie_" align="left" src="http://cprieto.com/wp-content/uploads/2011/10/Dennis_MacAlistair_Ritchie__thumb.jpg" width="211" height="244"></a>Today I read very sad news, <a href="http://en.wikipedia.org/wiki/Dennis_Ritchie">Dennis Ritchie</a> is dead. A person that literally changed my life (I remember reading The C Language and trying to make myself clear what a pointer was). I decided to become a developer when I first started coding and using a Linux system years ago. Today one of my heroes is dead.</p>
<p>Even if you are not a programmer you cannot avoid using Ritchie’s legacy, the Windows operating system you are using? well, took many of its ideas from Unix, and it’s made in C. Are you using MacOSX? well, guess what, it’s made in C. Well, you are a PHP developer? PHP is made itself in C and it’s obvious where the syntax it’s coming from. Even “modern” C#/Java/Python/Ruby developers cannot avoid it’s legacy.</p>
<p>Sir, we are going to remember you with every line of code we write. <strong>We owe you too much to be able to measure</strong>.</p>
<p>Do you have a blog? Give Dennis Ritchie the tribute he deserved, the one the media won&#8217;t give him. <a title="http://t.co/bsFFbAA8" href="http://t.co/bsFFbAA8">http://t.co/bsFFbAA8</a></p>
<p><strong>UPDATE:</strong> Saddest piece of code ever <a title="http://t.co/Xp5EmFRg" href="http://t.co/Xp5EmFRg">http://t.co/Xp5EmFRg</a></p>
<img src="http://feeds.feedburner.com/~r/IdisposableThoughts/~4/4DZWCSyb-1g" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://cprieto.com/2011/10/13/dennis-ritchie/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://cprieto.com/2011/10/13/dennis-ritchie/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=dennis-ritchie</feedburner:origLink></item>
		<item>
		<title>Thermodynamics and developers life’s</title>
		<link>http://feedproxy.google.com/~r/IdisposableThoughts/~3/IycWhcM9cio/</link>
		<comments>http://cprieto.com/2011/10/12/thermodynamics-and-developers-lifes/#comments</comments>
		<pubDate>Wed, 12 Oct 2011 08:01:35 +0000</pubDate>
		<dc:creator>cristian</dc:creator>
				<category><![CDATA[personal]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[rant]]></category>

		<guid isPermaLink="false">http://cprieto.com/index.php/2011/10/12/thermodynamics-and-developers-lifes/</guid>
		<description><![CDATA[When I was in University my favourite class (or maybe the class that basically changed my perspective of many things) was Thermodynamics, maybe was my teacher (a really brilliant physics and chemistry professor) or maybe was the very abstract and &#8230; <a href="http://cprieto.com/2011/10/12/thermodynamics-and-developers-lifes/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>When I was in University my favourite class (or maybe the class that basically changed my perspective of many things) was <a href="http://en.wikipedia.org/wiki/Thermodynamics">Thermodynamics</a>, maybe was my teacher (a really brilliant physics and chemistry professor) or maybe was the very abstract and practical examples. She spend most of the time in the class explaining basic things like the rain or the boiling temperature of beans in high altitude with equations and thermodynamic laws. Years after that I still remembering many of the concepts and even making observations based in what I learnt those days.</p>
<p>In the last year I’ve been facing so many different problems as a developer and consultant with different customers, different technologies, different use cases, so many different areas of knowledge. Today I was thinking about the ideas about Gibbs theories and I saw something interesting with my developer life and how they are related.</p>
<p>You’ll see, one day my professor just explained how the <a href="http://en.wikipedia.org/wiki/Gibbs_free_energy">Gibbs free energy</a> is related to the human body chemical reactions and how the Entropy is important in everything that happen in human life, including relations. So at the end everything concludes in a simple fact: “you will get the complete equilibrium when you die”. Many developers look for a constant equilibrium in their life&#8217;s, some of them spend many years doing the same and making themselves confortable with the same thing, same technology, same platform, same risks, maybe they expect to face tomorrow the same problems they faced today, maybe they are looking for a zero entropy in their developers’ life.</p>
<p>Personally I like the fact to learn new things everyday, to face new problems, new challenges, maybe it’s the fear to have zero entropy in my life and realize I’m just death.</p>
<p>Maybe you need a little more of <a href="http://en.wikipedia.org/wiki/Entropy">Entropy</a> in your working life, what do you think?</p>
<p>A little more about <a href="http://www.humanthermodynamics.com/principles.html">Human Thermodynamics</a>.</p>
<img src="http://feeds.feedburner.com/~r/IdisposableThoughts/~4/IycWhcM9cio" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://cprieto.com/2011/10/12/thermodynamics-and-developers-lifes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://cprieto.com/2011/10/12/thermodynamics-and-developers-lifes/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=thermodynamics-and-developers-lifes</feedburner:origLink></item>
		<item>
		<title>VAN en Alt.Net Hispano–ASP.NET 4.5 y Visual Studio vNext</title>
		<link>http://feedproxy.google.com/~r/IdisposableThoughts/~3/1lCjNOOXIzk/</link>
		<comments>http://cprieto.com/2011/10/04/van-en-alt-net-hispanoasp-net-4-5-y-visual-studio-vnext/#comments</comments>
		<pubDate>Tue, 04 Oct 2011 01:20:20 +0000</pubDate>
		<dc:creator>cristian</dc:creator>
				<category><![CDATA[talks]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[mvc]]></category>
		<category><![CDATA[van]]></category>
		<category><![CDATA[vnext]]></category>
		<category><![CDATA[web dev]]></category>
		<category><![CDATA[webmatrix]]></category>

		<guid isPermaLink="false">http://cprieto.com/index.php/2011/10/04/van-en-alt-net-hispanoasp-net-4-5-y-visual-studio-vnext/</guid>
		<description><![CDATA[Ya esta publicada el video de la VAN acerca de ASP.NET 4.5 (o vNext) y Visual Studio 2011 para web developers. Esta es la primera de dos VAN’s acerca de los cambios en la nueva version de ASP.NET y como &#8230; <a href="http://cprieto.com/2011/10/04/van-en-alt-net-hispanoasp-net-4-5-y-visual-studio-vnext/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Ya esta publicada el video de la VAN acerca de ASP.NET 4.5 (o vNext) y Visual Studio 2011 para web developers. Esta es la primera de dos VAN’s acerca de los cambios en la nueva version de ASP.NET y como sacar ventaja de ellos. Al final de las diapositivas hay una lista de recursos en los cuales pueden profundizar mas acerca de este tema. Gracias a <a href="http://altnethispano.com">Alt.Net Hispano</a> por la oportunidad de compartir con ustedes.</p>
<p><object id="scPlayer"  width="600" height="356" type="application/x-shockwave-flash" data="http://content.screencast.com/users/AltNetHispano/folders/VAN/media/a13a4a4d-b284-483c-a86d-461b81aeb0cd/flvplayer.swf" ><param name="movie" value="http://content.screencast.com/users/AltNetHispano/folders/VAN/media/a13a4a4d-b284-483c-a86d-461b81aeb0cd/flvplayer.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#FFFFFF" /><param name="flashVars" value="thumb=http://content.screencast.com/users/AltNetHispano/folders/VAN/media/a13a4a4d-b284-483c-a86d-461b81aeb0cd/FirstFrame.jpg&amp;containerwidth=600&amp;containerheight=356&amp;analytics=UA-21341284-1&amp;content=http://content.screencast.com/users/AltNetHispano/folders/VAN/media/a13a4a4d-b284-483c-a86d-461b81aeb0cd/van-2010-09-24.flv&amp;blurover=false" /><param name="allowFullScreen" value="true" /><param name="scale" value="showall" /><param name="allowScriptAccess" value="always" /><param name="base" value="http://content.screencast.com/users/AltNetHispano/folders/VAN/media/a13a4a4d-b284-483c-a86d-461b81aeb0cd/" />Unable to display content. Adobe Flash is required.</object>
<p>Si quieres saber mas acerca de las VAN para la comunidad de Alt.Net Hispana acercate a su homepage, tienen de todo para todos =)</p>
<p>Y claro esta, las diapositivas usadas:</p>
<div style="width: 425px" id="__ss_9408255"><strong style="margin: 12px 0px 4px; display: block"><a title="ASP.NET v4.5 un vistazo, parte 1" href="http://www.slideshare.net/kementeus/aspnet-v45-un-vistazo-parte-1" target="_blank">ASP.NET v4.5 un vistazo, parte 1</a></strong> <iframe height="355" marginheight="0" src="http://www.slideshare.net/slideshow/embed_code/9408255" frameborder="0" width="425" marginwidth="0" scrolling="no"></iframe></div>
<h3>Referencias: </h3>
<ul>
<li>What’s new in ASP.Net 4.5 <a href="http://www.asp.net/vnext/whats-new">http://www.asp.net/vnext/whats-new</a>
<li>Scott Hanselman y ASP.NET v4.5 <a href="http://bit.ly/n7YlWW">http://bit.ly/n7YlWW</a>
<li>Scott Guthrie y ASP.NET v4.5 <a href="http://bit.ly/o4m4CC">http://bit.ly/o4m4CC</a>
<li>What’s new in everything 4.5 <a href="http://bit.ly/oqbUAk">http://bit.ly/oqbUAk</a>
<li>Download Webmatrix 2 beta <a href="http://bit.ly/qw1AbU">http://bit.ly/qw1AbU</a>
<li>Extending Webmatrix 2 beta <a href="http://bit.ly/nr5P1w">http://bit.ly/nr5P1w</a>
<li>More about Extending Webmatrix 2 beta <a href="http://bit.ly/p1RstO">http://bit.ly/p1RstO</a>
<li>Webmatrix 2 beta features <a href="http://bit.ly/phcmcf">http://bit.ly/phcmcf</a>
<li>Damian Edwards talk at BUILD <a href="http://bit.ly/psQgZb">http://bit.ly/psQgZb</a>
<li>Mattheuw Osborn talk at BUILD <a href="http://bit.ly/r7n4I2">http://bit.ly/r7n4I2</a>
<li>Vishal Joshi talk at BUILD <a href="http://bit.ly/pXch2B">http://bit.ly/pXch2B</a> </li>
</ul>
<img src="http://feeds.feedburner.com/~r/IdisposableThoughts/~4/1lCjNOOXIzk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://cprieto.com/2011/10/04/van-en-alt-net-hispanoasp-net-4-5-y-visual-studio-vnext/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
<enclosure url="http://content.screencast.com/users/AltNetHispano/folders/VAN/media/a13a4a4d-b284-483c-a86d-461b81aeb0cd/van-2010-09-24.flv&amp;amp" length="474429945" type="video/x-flv" />
		<feedburner:origLink>http://cprieto.com/2011/10/04/van-en-alt-net-hispanoasp-net-4-5-y-visual-studio-vnext/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=van-en-alt-net-hispanoasp-net-4-5-y-visual-studio-vnext</feedburner:origLink></item>
		<item>
		<title>NLog and local application configuration</title>
		<link>http://feedproxy.google.com/~r/IdisposableThoughts/~3/1M_cPAkq9jQ/</link>
		<comments>http://cprieto.com/2011/09/22/nlog-and-local-application-configuration/#comments</comments>
		<pubDate>Thu, 22 Sep 2011 00:28:15 +0000</pubDate>
		<dc:creator>cristian</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[infrastructure]]></category>
		<category><![CDATA[logging]]></category>
		<category><![CDATA[nlog]]></category>
		<category><![CDATA[questions]]></category>

		<guid isPermaLink="false">http://cprieto.com/index.php/2011/09/22/nlog-and-local-application-configuration/</guid>
		<description><![CDATA[I firmly think one of the tools every developer should have and add to its applications is logging, you should be familiar with any logging framework (whatever you like) and use it, extensively. In my case I really like NLog, &#8230; <a href="http://cprieto.com/2011/09/22/nlog-and-local-application-configuration/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I firmly think one of the tools <em>every developer</em> should have and add to its applications is logging, you should be familiar with any logging framework (whatever you like) and use it, extensively. In my case I really like <a href="http://nlog-project.org/">NLog</a>, a logging framework created under the <a href="http://logging.apache.org/log4net/">log4net</a> principles and looking for minimize the friction caused by log4net configuration. </p>
<p>Recently a friend of mine asked me the following question:</p>
<blockquote><p>As we have several apps created into the same output folder they all override each others Nlog.config files.<br />I was wondering what is the best approach for that? Should I provide nlog configuration in app.config file? it doesn&#8217;t let me name NLog.config differently&#8230;.</p>
</blockquote>
<p>This is a very common question, looks like they have many exe files in the same directory, and they are using a nlog configuration file to configure the logging. Of course, if you are running two applications in the same directory with the same nlog file the logging settings will be shared between both applications. The answer to this problem is easy, <em>use an specific nlog file for each application</em>. That means: if your application is named app.exe your <em>specific application nlog configuration</em> should be called <strong>app.exe.nlog</strong>. If you want to automatically rename the file after compilation it would be a good idea to create a post build action in your proj file to do so, easy and clean.
<p>The order in which nlog locates the configuration is easy to remember:
<ol>
<li>Configuration section in your application configuration (app.exe.config)
<li>Specific nlog file for your application (app.exe.nlog)
<li>nlog.config file
<li>nlog.dll.nlog file</li>
</ol>
<p>There is more in the official <a href="http://nlog-project.org/wiki/Configuration_file">nlog documentation</a></p>
<img src="http://feeds.feedburner.com/~r/IdisposableThoughts/~4/1M_cPAkq9jQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://cprieto.com/2011/09/22/nlog-and-local-application-configuration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://cprieto.com/2011/09/22/nlog-and-local-application-configuration/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=nlog-and-local-application-configuration</feedburner:origLink></item>
		<item>
		<title>A week extending Blend–The first extension</title>
		<link>http://feedproxy.google.com/~r/IdisposableThoughts/~3/CISoQR-77dg/</link>
		<comments>http://cprieto.com/2011/09/18/a-week-extending-blendthe-first-extension/#comments</comments>
		<pubDate>Sun, 18 Sep 2011 05:05:00 +0000</pubDate>
		<dc:creator>cristian</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[article]]></category>
		<category><![CDATA[blend]]></category>
		<category><![CDATA[expression]]></category>
		<category><![CDATA[extensibility]]></category>
		<category><![CDATA[mef]]></category>

		<guid isPermaLink="false">http://cprieto.com/index.php/2011/09/18/a-week-extending-blendthe-first-extension/</guid>
		<description><![CDATA[I hope you enjoyed learning about MEF and started thinking about all the possibilities around it in your applications, awesome right?. Well, now that you know a little more about things like MEF catalogues and MEF exports we can freely &#8230; <a href="http://cprieto.com/2011/09/18/a-week-extending-blendthe-first-extension/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I hope you enjoyed learning about <a href="http://mef.codeplex.com/">MEF</a> and started thinking about all the possibilities around it in your applications, awesome right?. Well, now that you know a little more about things like MEF catalogues and MEF exports we can freely start talking about the basics in creating an extension for Expression Blend.</p>
<p>By default all the extensions in Expression blend made by 3rd party developers would live in a MEF directory catalogue under the folder <strong>Extensions</strong> in the installed path of your Blend application (the same happen for Expression Web). To “register&#8221; our application we need to provide a special bootstrapper known as Package, this special class implement the contract <code>IPackage</code> and takes care of our extension initialization (you know, things like registering your own services or adding things to blend) and when everything finish, provide support for cleaning up routines.</p>
<p>I mention a very common word in software development, services, the base of Expression extensibility. Every time we expose a new functionality to Blend we need to create and register a service and of course we will be consuming other services in our extension. The way to access this service collection is through the contract <code>IServices</code>, it exposes two important methods: <code>Load</code> and <code>Unload</code>, well, we will cover some important exposed core services in this series but if you want you could start taking a look by yourself using any “decompiler” tool like <a href="http://www.reflector.net/">Red Gate’s Reflector</a>, <a href="http://www.jetbrains.com/decompiler/">Jetbrains’ DotPeek</a>, <a href="http://www.telerik.com/products/decompiler.aspx">Telerik’s JustDecompile</a> or the now popular <a href="http://wiki.sharpdevelop.net/ILSpy.ashx">ILSpy</a>. Go feel free to start playing with them.</p>
<p>Well, no more to talk, let’s create our first simple package</p>
<ol>
<li>Add a reference to <code>Microsoft.Expression.Framework</code> and <code>Microsoft.Expression.Extensibility</code> tell to Visual Studio to never copy those assemblies to output. Those assemblies are in the Expression Blend installation directory
<li>Add a reference to <code>System.ComponentModel.Composition</code>, this library is in the GAC
<li>Create a class library for your extension
<li>Tell to Visual Studio to copy the output directly to your Expression Extensions directory </li>
</ol>
<p><a href="http://cprieto.com/wp-content/uploads/2011/09/CropperCapture1.jpg" rel="lightbox[709]"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="CropperCapture[1]" border="0" alt="CropperCapture[1]" src="http://cprieto.com/wp-content/uploads/2011/09/CropperCapture1_thumb.jpg" width="601" height="156"></a></p>
<ol>
<li>Specify your library will be named with the postfix .Extension, this is needed for the MEF Extension Catalog to load the assembly, sort of convention. </li>
</ol>
<p><a href="http://cprieto.com/wp-content/uploads/2011/09/CropperCapture2.jpg" rel="lightbox[709]"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="CropperCapture[2]" border="0" alt="CropperCapture[2]" src="http://cprieto.com/wp-content/uploads/2011/09/CropperCapture2_thumb.jpg" width="643" height="257"></a></p>
<ol>
<li>To easy your development effort, tell to Visual Studio to run Expression Blend when you debug the extension. </li>
</ol>
<p><a href="http://cprieto.com/wp-content/uploads/2011/09/CropperCapture3.jpg" rel="lightbox[709]"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="CropperCapture[3]" border="0" alt="CropperCapture[3]" src="http://cprieto.com/wp-content/uploads/2011/09/CropperCapture3_thumb.jpg" width="585" height="234"></a></p>
<ol>
<li>Write the code for your “Package”</li>
</ol>
<p>The code for your package would be very simple, let’s output to the debug output a simple message</p>
<pre class="brush: csharp;">using System.ComponentModel.Composition;
using Microsoft.Expression.Extensibility;
using System.Diagnostics;

namespace SampleExtension01 {
    [Export(typeof(IPackage))]
    public class SamplePackage : IPackage {
        public void Load(IServices services) {
            Debug.WriteLine("Hey, I'm in!");
        }

        public void Unload() {
            Trace.WriteLine("Boo! time to go =(");
        }
    }
}
</pre>
<p>Now we just run the Extension and look, our package works!</p>
<p><a href="http://cprieto.com/wp-content/uploads/2011/09/CropperCapture4.jpg" rel="lightbox[709]"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="CropperCapture[4]" border="0" alt="CropperCapture[4]" src="http://cprieto.com/wp-content/uploads/2011/09/CropperCapture4_thumb.jpg" width="560" height="168"></a></p>
<p>There are some differences in the way we create and register an Add-In instead of an Extension, but I think the bloggers around there already pointed them.</p>
<p>Now, the next time we are going to start doing a little more complex things, I promise =)</p>
<p>Meanwhile I let you with some links to people who explain a little more about the same thing:</p>
<ul>
<li>David Burela’s blog post about using Visual Studio to create Blend plugins: <a href="https://davidburela.wordpress.com/2010/02/02/guide-to-creating-expression-blend-3-addins/">https://davidburela.wordpress.com/2010/02/02/guide-to-creating-expression-blend-3-addins/</a>
<li>Tim Koke wrote a good beginning tutorial about the same subject: <a href="http://www.timmykokke.com/2010/03/building-extensions-for-expression-blend-4-using-mef/">http://www.timmykokke.com/2010/03/building-extensions-for-expression-blend-4-using-mef/</a>
<li>There’s a really good article in CodeProject about it: <a href="http://www.codeproject.com/Articles/75961/Building-extensions-for-Expression-Blend-4-using-M/">http://www.codeproject.com/Articles/75961/Building-extensions-for-Expression-Blend-4-using-M/</a>
<li>Scott Barnes blog posted something about it too: <a href="http://www.riagenic.com/archives/275">http://www.riagenic.com/archives/275</a>
<li>Jeremy Alles wrote a little about debugging a live compiled application using Reflector (in this case I can ensure you it’s Expression Blend): <a href="http://www.japf.fr/2010/03/debug-any-app-in-visual-studio-without-the-original-sources/">http://www.japf.fr/2010/03/debug-any-app-in-visual-studio-without-the-original-sources/</a></li>
</ul>
<p>You can get my sample code from Bitbucket. <a href="https://bitbucket.org/cprieto/extendingblend">https://bitbucket.org/cprieto/extendingblend</a></p>
<p><strong>NOTE:</strong> The index of the series could be found here <a href="http://cprieto.com/index.php/2011/09/17/a-week-extending-blendintroduction/">http://cprieto.com/index.php/2011/09/17/a-week-extending-blendintroduction/</a></p>
<img src="http://feeds.feedburner.com/~r/IdisposableThoughts/~4/CISoQR-77dg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://cprieto.com/2011/09/18/a-week-extending-blendthe-first-extension/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://cprieto.com/2011/09/18/a-week-extending-blendthe-first-extension/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=a-week-extending-blendthe-first-extension</feedburner:origLink></item>
		<item>
		<title>A week extending Expression Blend–The basics</title>
		<link>http://feedproxy.google.com/~r/IdisposableThoughts/~3/YP1sGhl3kDE/</link>
		<comments>http://cprieto.com/2011/09/18/a-week-extending-expression-blendthe-basics/#comments</comments>
		<pubDate>Sun, 18 Sep 2011 04:57:56 +0000</pubDate>
		<dc:creator>cristian</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[article]]></category>
		<category><![CDATA[blend]]></category>
		<category><![CDATA[expression]]></category>
		<category><![CDATA[extensibility]]></category>
		<category><![CDATA[mef]]></category>

		<guid isPermaLink="false">http://cprieto.com/index.php/2011/09/18/a-week-extending-expression-blendthe-basics/</guid>
		<description><![CDATA[Expression Blend is an amazing piece of software. It is created with the same philosophy as awesome products like Visual Studio.That is, there is only a simple shell with common and very clear extensibility points and everything else (the designer, &#8230; <a href="http://cprieto.com/2011/09/18/a-week-extending-expression-blendthe-basics/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Expression Blend is an amazing piece of software. It is created with <em>the same philosophy</em> as awesome products like Visual Studio.That is, there is only a simple <em>shell</em> with common and very clear extensibility points and <em>everything else</em> (the designer, the toolbox, even the compiling process) is written as an extension to that shell. Personally I like that way of thinking about such a complex application, you can easily designate a team to create the shell and many different teams to create all the functionality around your <em>main application</em> as extension to the main application, even better, you expose your main application <em>as an composite application</em> in a way other developers or companies can take advantage of that and even create an ecosystem around your application. Imagine applications such as CRM’s, accounting software or even tools like word processors taking advantage of that.</p>
<p>Well, Expression Blend 4 (and the whole Expression Suite by Microsoft) is created around this principle using the Microsoft Managed Extensibility Framework (MEF)<a href="http://msdn.microsoft.com/en-us/library/dd460648(VS.100).aspx">http://msdn.microsoft.com/en-us/library/dd460648(VS.100).aspx</a> to handle extensibility concerns. I strongly recommend to become familiar with the principles around MEF and take advantage of this amazing framework. Before Expression Blend 4 Microsoft used MEF “kind of predecessor” the <a href="http://msdn.microsoft.com/en-us/library/bb384200.aspx">Extensibility Add-In Framework</a> in the .Net Framework 3.5 (available also in 4.0 of course). So with this in mind we need to differentiate between two different types of extensions in Microsoft Expression:</p>
<ul>
<li><strong>Add-Ins:</strong> It’s the old way to extend Expression, this model is available from Expression Blend 2.0 to Expression Blend 4.0, it’s not as flexible as the Extension model but together expose the same functionality and works <em>almost</em> in the same way. If you need to support versions before 4.0 this is the model you need to use.
<li><strong>Extensions</strong>: It’s <em>the new way</em> and uses MEF as extensibility mechanism. If you love things like Inversion of Control and auto discovery this is the model you need to use. It is <em>very similar</em> to the Visual Studio Extensibility Model and I hope one day in the future both models would merge together (so we can share extensions from one package with the other, just imagine that, well, I can dream). We are going to use this model for our samples and mention the differences with the classic Add-In model when necessary.</li>
</ul>
<h2>A primer to MEF</h2>
<p>MEF is the extensibility core for Microsoft Expression Suite, it’s an amazing framework to handle concerns about discovery, dependency, lifetime and registration of components for extensions. This framework is used by other Microsoft products like Visual Studio. We are not going to cover the usage and basics around MEF, but before continue with the series I strongly recommend you to take a look at some basic MEF tutorials like the <a href="http://blogs.msdn.com/b/brada/archive/2008/09/29/simple-introduction-to-composite-applications-with-the-managed-extensions-framework.aspx">simple tutorial written by Brad Adams</a> or the walkthrough in the <a href="http://mef.codeplex.com/">MEF home page in Codeplex</a>. Go ahead, take your time and have fun with the joy of using MEF.</p>
<p><strong>UPDATE:</strong> After publishing the post I just realized a big mistake in it, MAF (Managed Add-In Framework) it is not MEF predecessor, it’s just another “application extensibility model” different than MEF, maybe in the next future I will talk a little more about it. Sorry for my mistake!</p>
<img src="http://feeds.feedburner.com/~r/IdisposableThoughts/~4/YP1sGhl3kDE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://cprieto.com/2011/09/18/a-week-extending-expression-blendthe-basics/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://cprieto.com/2011/09/18/a-week-extending-expression-blendthe-basics/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=a-week-extending-expression-blendthe-basics</feedburner:origLink></item>
	</channel>
</rss>

