<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	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/"
	>

<channel>
	<title>Eric LeclercEric Leclerc</title>
	<atom:link href="http://eleclerc.ca/feed/" rel="self" type="application/rss+xml" />
	<link>http://eleclerc.ca</link>
	<description>Web Developer in Gatineau</description>
	<lastBuildDate>Mon, 14 May 2012 20:15:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Sublime Text 2, Solarized, and Markdown</title>
		<link>http://eleclerc.ca/2012/02/17/sublime-text-2-solarized-and-markdown/</link>
		<comments>http://eleclerc.ca/2012/02/17/sublime-text-2-solarized-and-markdown/#comments</comments>
		<pubDate>Sat, 18 Feb 2012 01:11:48 +0000</pubDate>
		<dc:creator>Eric Leclerc</dc:creator>
				<category><![CDATA[general]]></category>

		<guid isPermaLink="false">http://danceric.net/?p=895</guid>
		<description><![CDATA[I&#8217;m using the latest Sublime Text 2 Beta 2165 and most of the themes lack support for syntax coloring in Markdown documents. I&#8217;ve modified the Solarized (Light) theme to add support for markdown element. Here&#8217;s the diff file to apply to your Solarized (Light).tmTheme file (you should in fact, apply this to a copy of&#8230; <a href="http://eleclerc.ca/2012/02/17/sublime-text-2-solarized-and-markdown/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m using the latest Sublime Text 2 Beta 2165 and most of the themes lack support for syntax coloring in Markdown documents. I&#8217;ve modified the Solarized (Light) theme to add support for markdown element. Here&#8217;s the diff file to apply to your <code>Solarized (Light).tmTheme</code> file (you should in fact, apply this to a copy of the file, in the <code>Packages/Users</code> directory).</p>

<p><a href="https://gist.github.com/1856662">solarized-light-markdown.diff</a></p>

<p>Add to this the <a href="https://github.com/revolunet/sublimetext-markdown-preview">Sublime Markdown Preview</a> plugin and you have my current favorite markdown editing setup.</p>

<p><strong>update</strong>: Complete files with my modifs for Solarized Light and Solarized Dark can be found here: <a href="https://gist.github.com/1904917">https://gist.github.com/1904917</a></p>
]]></content:encoded>
			<wfw:commentRss>http://eleclerc.ca/2012/02/17/sublime-text-2-solarized-and-markdown/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Reinventing the wheel</title>
		<link>http://eleclerc.ca/2012/01/04/reinventing-the-wheel/</link>
		<comments>http://eleclerc.ca/2012/01/04/reinventing-the-wheel/#comments</comments>
		<pubDate>Wed, 04 Jan 2012 13:07:57 +0000</pubDate>
		<dc:creator>Eric Leclerc</dc:creator>
				<category><![CDATA[general]]></category>

		<guid isPermaLink="false">http://www.danceric.net/blog/?p=739</guid>
		<description><![CDATA[This is what most PHP developer do, most of the time. Most PHP devs don&#8217;t like to reuse, they think their case is unique, those who don&#8217;t&#8230; well, they don&#8217;t call themselves php developers, they call themselves drupal devs or wordpress devs or symfony devs or whatever cms/framework dev. But the real (sarcasm) php dev&#8230; <a href="http://eleclerc.ca/2012/01/04/reinventing-the-wheel/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This is what most PHP developer do, most of the time. Most PHP devs don&#8217;t like to reuse, they think their case is unique, those who don&#8217;t&#8230; well, they don&#8217;t call themselves php developers, they call themselves drupal devs or wordpress devs or symfony devs or whatever cms/framework dev.</p>

<p>But the real (sarcasm) php dev will create an acl from scratch at every job he have. he will create countless media manager, db layer, session manager, etc. Don&#8217;t get me wrong, I think you can&#8217;t be a good php developer if you haven&#8217;t gone through this stage, but please, for the sake of your coworker sanity, keep you&#8217;re &#8220;learning process&#8221; outside of the workplace and don&#8217;t forget that you should stick to &#8220;learn-and-throw-away&#8221;.</p>

<p>Some bad reason to reinvent the wheel that I hear all the time:</p>

<p><strong>Existing solution does not apply to us</strong></p>

<p>Yeah right, you feel better when you think you are unique, good for you, but unfortunately it&#8217;s probably not true. I agree on one thing though, you&#8217;re different, everybody is different, that&#8217;s why the solution will need to be adapted, but surely not written from scratch.</p>

<p><strong>It&#8217;s gonna be faster to create our own solution rather than adapting or learning something else</strong></p>

<p>Yeah right, it&#8217;s gonna be faster for the guy doing it this time, but for everybody else trying to use/modify/understand it in the future it&#8217;s gonna be a pain in the ass because your solution will be half documented (probably not documented at all) and with no community support. By the time somebody needs help from the original developer, he will probably be working somewhere else, reinventing the wheel again&#8230;</p>

<p><strong>There is nothing in the whole universe that remotely resemble what we&#8217;re trying to do</strong></p>

<p>Yeah right, again, the &#8220;I&#8217;m unique&#8221; power trip. There&#8217;s billion of people on the planet, that have met and fixed billions and billions of problems, a lot of them have written about their solution in books, blogs, code, tweet&#8230;.</p>
]]></content:encoded>
			<wfw:commentRss>http://eleclerc.ca/2012/01/04/reinventing-the-wheel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Design Patterns from DDD</title>
		<link>http://eleclerc.ca/2012/01/02/design-patterns-from-ddd/</link>
		<comments>http://eleclerc.ca/2012/01/02/design-patterns-from-ddd/#comments</comments>
		<pubDate>Mon, 02 Jan 2012 14:01:34 +0000</pubDate>
		<dc:creator>Eric Leclerc</dc:creator>
				<category><![CDATA[general]]></category>

		<guid isPermaLink="false">http://danceric.net/?p=868</guid>
		<description><![CDATA[I&#8217;ve mentionned DDD in the previous post, this post is me drafting publicly my thought on the design patterns generally associated with it. this is a work in progress. Even if not doing Domain Driven Development, the design patterns usually used by the DDD people are something that can benefit a lot of project. To&#8230; <a href="http://eleclerc.ca/2012/01/02/design-patterns-from-ddd/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve mentionned DDD in the previous post, this post is me drafting publicly my thought on the design patterns generally associated with it. this is a work in progress.</p>

<p>Even if not doing Domain Driven Development, the design patterns usually used by the DDD people are something that can benefit a lot of project. To start learning more about design pattern, &#8220;Patterns of Enterprise Application Architecture&#8221; by Martin Fowler <sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup> is a must read. If you can&#8217;t afford the book, then go steal some money (just kidding) or start by reading the free short summary of each patterns available on the author&#8217;s website <sup id="fnref:2"><a href="#fn:2" rel="footnote">2</a></sup>.</p>

<p>Domain Models are a representation of the data, they represent <em>nouns</em> in you domain, such as User or Invoice. As the domain model contain the business logic, it should be the most important part of the code, thus it need to be easy to understand, easy to modify and easy to test. That&#8217;s why they should have no external requirement, no knowledge of the external world, avoid tight coupling at all cost.</p>

<p>Domain models contains the business logic (<em>verbs</em>), mainly in the Entity and Repository, and some in the service layer (if, and only if the functionality does not apply to an entity in particular, reference others object of the system,  and is stateless. (ex1: $shippingService->calculateShippingCost($zipcode). this does not belong in the Cart Entity because of the dependency on external object such as shipping company API).</p>

<p>Entities should be totally standalone, they should not be aware of repository or anything else.</p>

<p>Entities and Repositories does not write directly to a database or web service, a database layer is usually used such as ActiveRecord or DataMapper. But, writing an activeRecord of dataMapper layer is a long and difficult job, and it&#8217;s generally a better choice to use an existing one, especially because of the fact that this layer contain no business logic, there is not a big Return On Investment on building our own.</p>

<p>Some part of the application might seems like Entity but are in fact Aggregate. Some object can&#8217;t exist by themselves, such as <code>OrderDetails</code>, they are Aggregate that are connected to an Aggregate Root <code>Order</code>. This mean that the Aggregate don&#8217;t have a repository and if you want to add a row to an order you need to go thru the <code>Order</code> Entity. ex: $order->addDetail(&#8230;)</p>

<div class="footnotes">
<hr />
<ol>

<li id="fn:1">
<p>http://www.martinfowler.com/books.html#eaa&#160;<a href="#fnref:1" rev="footnote">&#8617;</a></p>
</li>

<li id="fn:2">
<p>http://martinfowler.com/eaaCatalog/&#160;<a href="#fnref:2" rev="footnote">&#8617;</a></p>
</li>

</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://eleclerc.ca/2012/01/02/design-patterns-from-ddd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Domain Driven Design</title>
		<link>http://eleclerc.ca/2012/01/01/domain-driven-design/</link>
		<comments>http://eleclerc.ca/2012/01/01/domain-driven-design/#comments</comments>
		<pubDate>Mon, 02 Jan 2012 02:25:25 +0000</pubDate>
		<dc:creator>Eric Leclerc</dc:creator>
				<category><![CDATA[general]]></category>

		<guid isPermaLink="false">http://danceric.net/?p=829</guid>
		<description><![CDATA[Domain Driven Design is a development methodology, the term have been coined by Eric Evans 1. Domain Driven Design (DDD) being a complete development methodology, that means that you can&#8217;t learn DDD simply by reading code sample, and a few things are necessary for his success, such as: Developers who understand design patterns Access to&#8230; <a href="http://eleclerc.ca/2012/01/01/domain-driven-design/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Domain Driven Design is a development methodology, the term have been coined by Eric Evans <sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup>.</p>

<p>Domain Driven Design (DDD) being a complete development methodology, that means that you can&#8217;t learn DDD simply by reading code sample, and a few things are necessary for his success, such as:</p>

<ul>
<li>Developers who understand design patterns</li>
<li>Access to a Domain Expert and close relationship with the client</li>
</ul>

<p>The domain expert requirement is a big one, you actually need someone from the domain, ie: if you are in the banking industry, you need a banker to have this role, not a developer or an architect who is a self proclaimed domain expert. DDD involve a lot of communication with the domain expert to define the ubiquitous language <sup id="fnref:2"><a href="#fn:2" rel="footnote">2</a></sup> and integrate them in the domain models. To keep using our banking example, a developer who knows absolutely nothing about banking should learn an awful lot about the domain (banking) just by looking at the code for the domain model.</p>

<p>A DDD team will probably be using a bunch of design pattern such as:</p>

<ul>
<li>Domain Model</li>
<li>Service Layer</li>
<li>ActiveRecord or DataMapper</li>
<li>LazyLoad</li>
<li>Repository &amp; Query Object</li>
</ul>

<p>But the sole fact of using these patterns does not mean you have a DDD team. I can&#8217;t find the orignal source, but apparently <sup id="fnref:3"><a href="#fn:3" rel="footnote">3</a></sup> Eric Evans almost regrets having mentioned these design pattern in the book because they can lead to that false conclusion that DDD is just &#8216;using some specific design pattern&#8217; when if fact it is so much more and involve discussion and collaboration with clients and domain experts. We can see the same feeling about design patterns and lack of domain expert expressed in the excellent video &#8220;7 Reasons Why DDD projects #FAIL&#8221; <sup id="fnref:4"><a href="#fn:4" rel="footnote">4</a></sup> by Greg Young.</p>

<p>DDD is not for everybody, if your app is mainly retrieving data from the database to display with some fancy design, DDD would just be adding a layer of complexity on something really simple, ActiveRecord or DataMapper is probably a better solution for your need. Such an example where DDD is overkill, and e-commerce website for Mom &amp; Pop&#8217;s shop, as there is little logic, lots or database reading and some cool graphics&#8230; But complex subscription plan and pricing and discount model is a good candidate for DDD.</p>

<p>I won&#8217;t go deeper into the world of DDD as I have no experience with it and I&#8217;m not currently working on any team that can switch to this methodology easily.</p>

<p>I&#8217;ll close this part with a great quote from &#8220;DDD Step By Step&#8221; <sup id="fnref:5"><a href="#fn:5" rel="footnote">5</a></sup></p>

<blockquote>
  <p>[...] I view Domain Driven Design firstly as a design methodology, secondly as an architectural style, and lastly as some great software patterns.</p>
</blockquote>

<h3>More Reading</h3>

<p>Stack Overflow have some good links to get you started with DDD</p>

<p>http://stackoverflow.com/questions/493068/best-resources-on-the-web-for-learning-domain-driven-design-ddd-in-depth</p>

<p>(my favorite being the InfoQ miniBook, a quick read that give just enough information to get you interested)</p>

<div class="footnotes">
<hr />
<ol>

<li id="fn:1">
<p>http://domaindrivendesign.org/books/evans_2003&#160;<a href="#fnref:1" rev="footnote">&#8617;</a></p>
</li>

<li id="fn:2">
<p>http://domaindrivendesign.org/node/132&#160;<a href="#fnref:2" rev="footnote">&#8617;</a></p>
</li>

<li id="fn:3">
<p>http://thecodersbreakfast.net/index.php?post/2009/06/16/Paris-JUG-%22Domain-driven-design%22-%3A-compte-rendu&#160;<a href="#fnref:3" rev="footnote">&#8617;</a></p>
</li>

<li id="fn:4">
<p>http://vimeo.com/13824218&#160;<a href="#fnref:4" rev="footnote">&#8617;</a></p>
</li>

<li id="fn:5">
<p>http://thinkddd.com/assets/2/Domain_Driven_Design_-_Step_by_Step.pdf&#160;<a href="#fnref:5" rev="footnote">&#8617;</a></p>
</li>

</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://eleclerc.ca/2012/01/01/domain-driven-design/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>how to be a better developer</title>
		<link>http://eleclerc.ca/2011/07/21/how-to-be-a-better-developer/</link>
		<comments>http://eleclerc.ca/2011/07/21/how-to-be-a-better-developer/#comments</comments>
		<pubDate>Thu, 21 Jul 2011 14:04:57 +0000</pubDate>
		<dc:creator>Eric Leclerc</dc:creator>
				<category><![CDATA[general]]></category>

		<guid isPermaLink="false">http://www.danceric.net/blog/?p=741</guid>
		<description><![CDATA[Or at least not suck as a developer/coworker change job If you have only worked for one company, using only one style of coding and project management, and have seen only your code / your friends code, then do everybody a favor (including you) and get out of there, go see how things happens &#8220;in&#8230; <a href="http://eleclerc.ca/2011/07/21/how-to-be-a-better-developer/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Or at least not suck as a developer/coworker</p>

<h3>change job</h3>

<p>If you have only worked for one company, using only one style of coding and project management, and have seen only your code / your friends code, then do everybody a favor (including you) and get out of there, go see how things happens &#8220;in the wild&#8221;.</p>

<h3>share</h3>

<p>Write, mentor someone, or contribute to an opensource project, you need to learn to explain clearly and and easily your ideas and what your code is doing. If you can&#8217;t you either:</p>

<ul>
<li>don&#8217;t really understand what you&#8217;re doing</li>
<li>have sucky communication skills</li>
</ul>

<p>Both issues are worth working on, as they will improve your life and those of people surrounding you.</p>

<h3>read</h3>

<p>Read lots of books, blogs, essay on programming, etc that expose different concept and point of view.</p>

<h3>code</h3>

<p><em>aka don&#8217;t read too much</em></p>

<p>You should code <em>at least</em> as much as you read, or you risk becoming somebody living in Utopia city, the type of guys who abuse design patterns for hypothetical reasons. Once again, to achieve this you can work on a pet project, contribute to an opensource project (better), or turn to code kata, code dojo or somethings like the <a href="http://rubykoans.com/">EdgeCase Ruby Koans</a> that have been ported for many programming language.</p>

<h3>plagiate</h3>

<p><em>and throw away (very important)</em></p>

<p>Yes, it&#8217;s still writing code, but writing code is a really important thing to do while learning. Re-implement existing things as a learning exercise. It&#8217;s easy to do because you don&#8217;t have to spec the project, you already know the desired outcome and you don&#8217;t need to find a killer idea (waiting for inspiration is a good way to kill a learning session). But be careful, do this as a learning exercice only, everybody hates a coworker who constantly reinvent the wheel. You need to throw away this code once it&#8217;s done. Learning to let go your code is as important as learning to code, a good developer will delete a lot code in his career&#8230;</p>

<p><strong>note</strong>:</p>

<p><em>If you really want to read more than you code, you risk becoming one of these pattern abusers I&#8217;ve just mentioned. Please, go read this old blog post right now: <a href="http://www.codinghorror.com/blog/2005/09/head-first-design-patterns.html">Head First Design Patterns</a></em></p>
]]></content:encoded>
			<wfw:commentRss>http://eleclerc.ca/2011/07/21/how-to-be-a-better-developer/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Ottawa PHP</title>
		<link>http://eleclerc.ca/2010/04/29/ottawa-php/</link>
		<comments>http://eleclerc.ca/2010/04/29/ottawa-php/#comments</comments>
		<pubDate>Fri, 30 Apr 2010 01:27:46 +0000</pubDate>
		<dc:creator>Eric Leclerc</dc:creator>
				<category><![CDATA[general]]></category>

		<guid isPermaLink="false">http://www.danceric.net/?p=698</guid>
		<description><![CDATA[PHP devs in or around Ottawa should check out the brand new Ottawa PHP google group and #ottawaphp freenode channel (and of course my very own Ottawa PHP Community aggregator). update: both projects killed due to total lack of interest and/or php developers in Ottawa]]></description>
			<content:encoded><![CDATA[<p><strike>PHP devs in or around Ottawa should check out the brand new <a href="http://groups.google.com/group/ottawaphp">Ottawa PHP google group</a> and #ottawaphp freenode channel (and of course my very own <a href="http://ottawaphpcommunity.ca">Ottawa PHP Community</a> aggregator).</strike></p>

<p><strong>update:</strong> both projects killed due to total lack of interest and/or php developers in Ottawa</p>
]]></content:encoded>
			<wfw:commentRss>http://eleclerc.ca/2010/04/29/ottawa-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Propaganda</title>
		<link>http://eleclerc.ca/2010/01/18/propaganda/</link>
		<comments>http://eleclerc.ca/2010/01/18/propaganda/#comments</comments>
		<pubDate>Mon, 18 Jan 2010 14:13:16 +0000</pubDate>
		<dc:creator>Eric Leclerc</dc:creator>
				<category><![CDATA[general]]></category>

		<guid isPermaLink="false">http://www.danceric.net/?p=681</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.confoo.ca/en/"><img alt="confoo.ca Web Techno Conference" style="border:0" width="150" height="100" src="http://danceric.net/pub/confoo-2010-going.jpg" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://eleclerc.ca/2010/01/18/propaganda/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Standards Working Group</title>
		<link>http://eleclerc.ca/2009/11/10/php-standards-working-group/</link>
		<comments>http://eleclerc.ca/2009/11/10/php-standards-working-group/#comments</comments>
		<pubDate>Wed, 11 Nov 2009 01:08:57 +0000</pubDate>
		<dc:creator>Eric Leclerc</dc:creator>
				<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.danceric.net/2009/11/10/php-standards-working-group/</guid>
		<description><![CDATA[It&#8217;s great to see that PHP is gaining maturity lately. After the release of version 5.3 that have introduced namespaces, it&#8217;s now time for some of the biggest php projects to get together to discuss and agree on a common autoloader standard. This really nice project would allow interoperability between frameworks/projects. Take a look at&#8230; <a href="http://eleclerc.ca/2009/11/10/php-standards-working-group/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s great to see that PHP is gaining maturity lately. After the release of version 5.3 that have introduced namespaces, it&#8217;s now time for some of the biggest php projects to get together to discuss and agree on a common autoloader standard. This really nice project would allow interoperability between frameworks/projects.</p>

<p>Take a look at the proposal <a href="http://groups.google.com/group/php-standards/web/psr-0-final-proposal">PSR-0</a> and try the autoloader on your new project. The more people using it, the easier our life will be as a PHP developer.</p>

<p><strong>Note</strong>: <strike>if you want to give feedback to the group about the proposed standard, you&#8217;d better do it on twitter or on your blog, because there seem to be some <em>not so clearly defined</em> rules to be able to join the group&#8230;</strike> <strong>update 2009-11-11</strong>: thanks to Nate Abel there is now a public <a href="http://groups.google.com/group/php-standards/web/project-acceptance-guidelines">Project Acceptance Guidelines</a> posted so this comment doesn&#8217;t hold true anymore. Thanks Nate.</p>

<p><strong>Note 2:</strong>: if you&#8217;re wondering how nice your code could look by using namespaces in php, check out the <a href="http://li3.rad-dev.org/">lithium framework</a> (<a href="http://twitter.com/#search?q=%23li3">#li3</a>) for a good example.</p>
]]></content:encoded>
			<wfw:commentRss>http://eleclerc.ca/2009/11/10/php-standards-working-group/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

