<?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 for János Pásztor</title>
	<atom:link href="http://www.janoszen.com/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.janoszen.com</link>
	<description>Blog on Web Development and Operations</description>
	<lastBuildDate>Tue, 14 May 2013 08:37:07 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
	<item>
		<title>Comment on Fixing the Dependency Injection Container in PHP by János Pásztor</title>
		<link>http://www.janoszen.com/2013/05/06/i-find-your-lack-of-code-completion-disturbing/#comment-18965</link>
		<dc:creator>János Pásztor</dc:creator>
		<pubDate>Tue, 14 May 2013 08:37:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.janoszen.com/?p=624#comment-18965</guid>
		<description><![CDATA[It seems we have wandered away from the original topic a bit, but this is exactly what irritates me so much about Symfony and the other &quot;big&quot; frameworks. I&#039;m working on some pretty big sites (Alexa 1000+) and have _never_ needed that kind of modularity. 

Maybe it&#039;s just me, but when routinely maintaining around a million lines of code I damn well prefer straight forward solutions. I absolutely hate to do guesswork and hunt down 10 layers of unneccessary abstraction that makes absolutely no sense at all in a certain use case. To me these kind of solutions are a case of architectural austronautism. (See http://www.joelonsoftware.com/articles/fog0000000018.html ) 

Maybe it works if you have to maintain a lot of small sites, I don&#039;t know. For me it&#039;s way more trouble than it&#039;s worth.

(And for the record: I don&#039;t use Symfony, so I don&#039;t have the luxury of having a plugin specifically written for the code I&#039;m working on.)

Btw. how many times have you used a different DIC implementation in your life with a framework like Symfony?]]></description>
		<content:encoded><![CDATA[<p>It seems we have wandered away from the original topic a bit, but this is exactly what irritates me so much about Symfony and the other &#8220;big&#8221; frameworks. I&#8217;m working on some pretty big sites (Alexa 1000+) and have _never_ needed that kind of modularity. </p>
<p>Maybe it&#8217;s just me, but when routinely maintaining around a million lines of code I damn well prefer straight forward solutions. I absolutely hate to do guesswork and hunt down 10 layers of unneccessary abstraction that makes absolutely no sense at all in a certain use case. To me these kind of solutions are a case of architectural austronautism. (See <a href="http://www.joelonsoftware.com/articles/fog0000000018.html" rel="nofollow">http://www.joelonsoftware.com/articles/fog0000000018.html</a> ) </p>
<p>Maybe it works if you have to maintain a lot of small sites, I don&#8217;t know. For me it&#8217;s way more trouble than it&#8217;s worth.</p>
<p>(And for the record: I don&#8217;t use Symfony, so I don&#8217;t have the luxury of having a plugin specifically written for the code I&#8217;m working on.)</p>
<p>Btw. how many times have you used a different DIC implementation in your life with a framework like Symfony?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Fixing the Dependency Injection Container in PHP by Gergő Tisza</title>
		<link>http://www.janoszen.com/2013/05/06/i-find-your-lack-of-code-completion-disturbing/#comment-18852</link>
		<dc:creator>Gergő Tisza</dc:creator>
		<pubDate>Fri, 10 May 2013 23:29:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.janoszen.com/?p=624#comment-18852</guid>
		<description><![CDATA[It is certainly more work than a registry, but worth it. With the registry pattern, all your classes statically depend on the same singleton, which means your unit tests can have side effects (unless you enable static isolation, which slows down PHPUnit quite a bit). The dependencies are not stored in a machine-readable way, so you cannot e.g. detect circular dependencies. (With proper configuration-based dependency injection you could even automate type hinting, like this PHPStorm plugin does: http://plugins.jetbrains.com/plugin/?phpStorm&amp;pluginId=7219 ) You cannot organize your code into self-contained components, because all your classes depend on the registry component (again, check Symfony for a good example - Symfony 2 components can be easily reused in a project which uses a differen DIC/registry implementation). You are pulling dependencies instead of pushing them, so instances of the same class will always have the same dependency - you cannot e.g. have two instances of your module log to different channels.]]></description>
		<content:encoded><![CDATA[<p>It is certainly more work than a registry, but worth it. With the registry pattern, all your classes statically depend on the same singleton, which means your unit tests can have side effects (unless you enable static isolation, which slows down PHPUnit quite a bit). The dependencies are not stored in a machine-readable way, so you cannot e.g. detect circular dependencies. (With proper configuration-based dependency injection you could even automate type hinting, like this PHPStorm plugin does: <a href="http://plugins.jetbrains.com/plugin/?phpStorm&#038;pluginId=7219" rel="nofollow">http://plugins.jetbrains.com/plugin/?phpStorm&#038;pluginId=7219</a> ) You cannot organize your code into self-contained components, because all your classes depend on the registry component (again, check Symfony for a good example &#8211; Symfony 2 components can be easily reused in a project which uses a differen DIC/registry implementation). You are pulling dependencies instead of pushing them, so instances of the same class will always have the same dependency &#8211; you cannot e.g. have two instances of your module log to different channels.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Fixing the Dependency Injection Container in PHP by János Pásztor</title>
		<link>http://www.janoszen.com/2013/05/06/i-find-your-lack-of-code-completion-disturbing/#comment-18846</link>
		<dc:creator>János Pásztor</dc:creator>
		<pubDate>Fri, 10 May 2013 18:21:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.janoszen.com/?p=624#comment-18846</guid>
		<description><![CDATA[I guess you could do that, but you need to write some code for each module, configure it, etc. I&#039;m more fond of the straight forward approach. Tends to be less work and I have yet to see a project that switches DIC implementations.]]></description>
		<content:encoded><![CDATA[<p>I guess you could do that, but you need to write some code for each module, configure it, etc. I&#8217;m more fond of the straight forward approach. Tends to be less work and I have yet to see a project that switches DIC implementations.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Fixing the Dependency Injection Container in PHP by János Pásztor</title>
		<link>http://www.janoszen.com/2013/05/06/i-find-your-lack-of-code-completion-disturbing/#comment-18844</link>
		<dc:creator>János Pásztor</dc:creator>
		<pubDate>Fri, 10 May 2013 18:10:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.janoszen.com/?p=624#comment-18844</guid>
		<description><![CDATA[My personal problem with this solution is that you need to add a little bit of extra markup every time you want to use the logger. Granted, it works, but I&#039;d rather not do this if it can be avoided.]]></description>
		<content:encoded><![CDATA[<p>My personal problem with this solution is that you need to add a little bit of extra markup every time you want to use the logger. Granted, it works, but I&#8217;d rather not do this if it can be avoided.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Proper time handling with PHP and MySQL by Gergő Tisza</title>
		<link>http://www.janoszen.com/2013/05/07/proper-time-handling-with-php-and-mysql/#comment-18841</link>
		<dc:creator>Gergő Tisza</dc:creator>
		<pubDate>Fri, 10 May 2013 14:36:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.janoszen.com/?p=680#comment-18841</guid>
		<description><![CDATA[You can save yourself from a world of pain by using PHP 5.3 datetime classes (and keeping date calculations out of the database):

&lt;pre&gt;$d = new DateTime(&#039;2012-03-23 14:00:00 CEST&#039;);
$d-&gt;format(&#039;m/d/Y&#039;); // 03/23/2012

$d2 = clone $d;
$d2-&gt;modify(&#039;+3 day&#039;); // 2012-03-26 14:00:00 CEST

$d-&gt;diff($d2)-&gt;format(&#039;%d days %h hours&#039;); // 3 days 0 hours

$tz = new DateTimeZone(&#039;Europe/Budapest&#039;);
$tr = $tz-&gt;getTransitions(
          $d-&gt;getTimestamp(),
          $d2-&gt;getTimestamp());
$tr = array_slice($tr, 1);
if ($tr) {
    echo &#039;DST &#039; . ($tr[0][&#039;isdst&#039;] ? &#039;starts&#039; : &#039;ends&#039;) .
        &#039; at &#039; . date(&#039;Y-m-d&#039;, $tr[0][&#039;ts&#039;]);
}&lt;/pre&gt;

The syntax is quite ugly at places, but it does the heavy lifting well.]]></description>
		<content:encoded><![CDATA[<p>You can save yourself from a world of pain by using PHP 5.3 datetime classes (and keeping date calculations out of the database):</p>
<pre class="wp-code-highlight prettyprint">$d = new DateTime(&#039;2012-03-23 14:00:00 CEST&#039;);
$d-&gt;format(&#039;m/d/Y&#039;); // 03/23/2012

$d2 = clone $d;
$d2-&gt;modify(&#039;+3 day&#039;); // 2012-03-26 14:00:00 CEST

$d-&gt;diff($d2)-&gt;format(&#039;%d days %h hours&#039;); // 3 days 0 hours

$tz = new DateTimeZone(&#039;Europe/Budapest&#039;);
$tr = $tz-&gt;getTransitions(
          $d-&gt;getTimestamp(),
          $d2-&gt;getTimestamp());
$tr = array_slice($tr, 1);
if ($tr) {
    echo &#039;DST &#039; . ($tr[0][&#039;isdst&#039;] ? &#039;starts&#039; : &#039;ends&#039;) .
        &#039; at &#039; . date(&#039;Y-m-d&#039;, $tr[0][&#039;ts&#039;]);
}</pre>
<p>The syntax is quite ugly at places, but it does the heavy lifting well.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Fixing the Dependency Injection Container in PHP by Gergő Tisza</title>
		<link>http://www.janoszen.com/2013/05/06/i-find-your-lack-of-code-completion-disturbing/#comment-18833</link>
		<dc:creator>Gergő Tisza</dc:creator>
		<pubDate>Fri, 10 May 2013 08:15:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.janoszen.com/?p=624#comment-18833</guid>
		<description><![CDATA[The comment engine is not code-friendly; imagine some XML code at the end which tells the DIC what setters it needs to call after object instantiation and which service to pass as argument.]]></description>
		<content:encoded><![CDATA[<p>The comment engine is not code-friendly; imagine some XML code at the end which tells the DIC what setters it needs to call after object instantiation and which service to pass as argument.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Fixing the Dependency Injection Container in PHP by Gergő Tisza</title>
		<link>http://www.janoszen.com/2013/05/06/i-find-your-lack-of-code-completion-disturbing/#comment-18832</link>
		<dc:creator>Gergő Tisza</dc:creator>
		<pubDate>Fri, 10 May 2013 08:12:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.janoszen.com/?p=624#comment-18832</guid>
		<description><![CDATA[In Symfony 2 for example, you would do something like this:

&lt;pre&gt;/* MyModuleThatNeedsALogger.php */
class MyModuleThatNeedsALogger {
    /** @var iLogger */
    protected $logger;
    
    public function setLogger(iLogger $logger) {
        $this-&gt;logger = $logger;
    }

    public function doStuff() {
        $this-&gt;logger-&gt;flog(&#039;I did stuff!&#039;);
    }
}


/* MySecondModuleThatNeedsTheFirstModule.php */
class MySecondModuleThatNeedsTheFirstModule {
    /** @var MyModuleThatNeedsALogger*/
    protected $firstModule;

    public function setFirstModule(MyModuleThatNeedsALogger $firstModule) {
        $this-&gt;firstModule = $firstModule;
    }
}


/* services,xml */&lt;/pre&gt;

When the first time you need the module, the DIC instantiates it and injects any dependencies. Inside your classes, you can just assume that all dependencies are magically there, and you can access them through typehinted fields; but, unlike the registry pattern, your classes do not depend on a god object, you do not need to create a mock registry for unit tests, you won&#039;t pull all your hair out if you decide to switch to another DIC implementation etc.]]></description>
		<content:encoded><![CDATA[<p>In Symfony 2 for example, you would do something like this:</p>
<pre class="wp-code-highlight prettyprint">/* MyModuleThatNeedsALogger.php */
class MyModuleThatNeedsALogger {
    /** @var iLogger */
    protected $logger;
    
    public function setLogger(iLogger $logger) {
        $this-&gt;logger = $logger;
    }

    public function doStuff() {
        $this-&gt;logger-&gt;flog(&#039;I did stuff!&#039;);
    }
}


/* MySecondModuleThatNeedsTheFirstModule.php */
class MySecondModuleThatNeedsTheFirstModule {
    /** @var MyModuleThatNeedsALogger*/
    protected $firstModule;

    public function setFirstModule(MyModuleThatNeedsALogger $firstModule) {
        $this-&gt;firstModule = $firstModule;
    }
}


/* services,xml */</pre>
<p>When the first time you need the module, the DIC instantiates it and injects any dependencies. Inside your classes, you can just assume that all dependencies are magically there, and you can access them through typehinted fields; but, unlike the registry pattern, your classes do not depend on a god object, you do not need to create a mock registry for unit tests, you won&#8217;t pull all your hair out if you decide to switch to another DIC implementation etc.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Fixing the Dependency Injection Container in PHP by Gergő Tisza</title>
		<link>http://www.janoszen.com/2013/05/06/i-find-your-lack-of-code-completion-disturbing/#comment-18830</link>
		<dc:creator>Gergő Tisza</dc:creator>
		<pubDate>Fri, 10 May 2013 07:50:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.janoszen.com/?p=624#comment-18830</guid>
		<description><![CDATA[This will work in all major IDEs:

&lt;pre&gt;/* @var $logger iLogger */
$logger = DIContainer::getInstance()-&gt;get(‘logger’);
$logger-&gt;log(‘my message’);&lt;/pre&gt;]]></description>
		<content:encoded><![CDATA[<p>This will work in all major IDEs:</p>
<pre class="wp-code-highlight prettyprint">/* @var $logger iLogger */
$logger = DIContainer::getInstance()-&gt;get(‘logger’);
$logger-&gt;log(‘my message’);</pre>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Don&#8217;t use FTP – here&#8217;s why by Leptes Kalman</title>
		<link>http://www.janoszen.com/2013/04/26/dont-use-ftp-heres-why/#comment-18799</link>
		<dc:creator>Leptes Kalman</dc:creator>
		<pubDate>Thu, 09 May 2013 10:27:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.janoszen.com/?p=587#comment-18799</guid>
		<description><![CDATA[A web.axelero.hu tudtommal csak FTP-t tamogat, mit csinaljak?]]></description>
		<content:encoded><![CDATA[<p>A web.axelero.hu tudtommal csak FTP-t tamogat, mit csinaljak?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Don&#8217;t use FTP – here&#8217;s why by János Pásztor</title>
		<link>http://www.janoszen.com/2013/04/26/dont-use-ftp-heres-why/#comment-18771</link>
		<dc:creator>János Pásztor</dc:creator>
		<pubDate>Wed, 08 May 2013 07:06:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.janoszen.com/?p=587#comment-18771</guid>
		<description><![CDATA[I suppose you wanted to point to the Alfresco FTP server, but what about it?]]></description>
		<content:encoded><![CDATA[<p>I suppose you wanted to point to the Alfresco FTP server, but what about it?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using apc
Database Caching using apc
Object Caching 568/569 objects using apc
Content Delivery Network via Amazon Web Services: CloudFront: cdn4.janoszen.com

 Served from: www.janoszen.com @ 2013-05-22 21:10:07 by W3 Total Cache -->