<?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 Ralph Schindler</title>
	<atom:link href="http://ralphschindler.com/comments/feed" rel="self" type="application/rss+xml" />
	<link>http://ralphschindler.com</link>
	<description>Ralph Schindler</description>
	<lastBuildDate>Thu, 07 Mar 2013 14:55:31 +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 PHP Constructor Best Practices And The Prototype Pattern by Dan</title>
		<link>http://ralphschindler.com/2012/03/09/php-constructor-best-practices-and-the-prototype-pattern/comment-page-1#comment-113005</link>
		<dc:creator>Dan</dc:creator>
		<pubDate>Thu, 07 Mar 2013 14:55:31 +0000</pubDate>
		<guid isPermaLink="false">http://ralphschindler.com/?p=166#comment-113005</guid>
		<description><![CDATA[Yes. I agree with you Wojciech. That&#039;s what the PHP manual says about constructors: initializers called AFTER the object was created in memory, and the assignment of the instance to the variable is done by the &#039;new&#039; keyword. Nice article anyway. The &#039;clone&#039; operator has finally a role in modern programming :).]]></description>
		<content:encoded><![CDATA[<p>Yes. I agree with you Wojciech. That&#8217;s what the PHP manual says about constructors: initializers called AFTER the object was created in memory, and the assignment of the instance to the variable is done by the &#8216;new&#8217; keyword. Nice article anyway. The &#8216;clone&#8217; operator has finally a role in modern programming <img src='http://ralphschindler.com/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Exception Best Practices in PHP 5.3 by Carsten Witt</title>
		<link>http://ralphschindler.com/2010/09/15/exception-best-practices-in-php-5-3/comment-page-1#comment-110370</link>
		<dc:creator>Carsten Witt</dc:creator>
		<pubDate>Mon, 25 Feb 2013 13:17:55 +0000</pubDate>
		<guid isPermaLink="false">http://ralphschindler.com/?p=107#comment-110370</guid>
		<description><![CDATA[Clarifying article, Ralph. Thank you for this! Just for further clarification: You differentiare between using the Logic ones during object instantiation and configuration, and the Runtime ones during business. Did I get it right, to put in a nutshell: 

The “dynamic call group” is for everything concerning “calling” methods and functions; the “logic group” is useful for problems inside the parameter list; and the “runtime group” is for everything happening inside the method/function body?]]></description>
		<content:encoded><![CDATA[<p>Clarifying article, Ralph. Thank you for this! Just for further clarification: You differentiare between using the Logic ones during object instantiation and configuration, and the Runtime ones during business. Did I get it right, to put in a nutshell: </p>
<p>The “dynamic call group” is for everything concerning “calling” methods and functions; the “logic group” is useful for problems inside the parameter list; and the “runtime group” is for everything happening inside the method/function body?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Exception Best Practices in PHP 5.3 by Using Interfaces For Exceptions &#124; BrandonSavage.net</title>
		<link>http://ralphschindler.com/2010/09/15/exception-best-practices-in-php-5-3/comment-page-1#comment-101801</link>
		<dc:creator>Using Interfaces For Exceptions &#124; BrandonSavage.net</dc:creator>
		<pubDate>Tue, 22 Jan 2013 11:00:41 +0000</pubDate>
		<guid isPermaLink="false">http://ralphschindler.com/?p=107#comment-101801</guid>
		<description><![CDATA[[...] This is also useful in library code, when you want to have a base exception type that applies to all exceptions for a particular library. By implementing the exception interface, you can typehint on that interface no matter the inheritance chain for the actual exception. [...]]]></description>
		<content:encoded><![CDATA[<p>[...] This is also useful in library code, when you want to have a base exception type that applies to all exceptions for a particular library. By implementing the exception interface, you can typehint on that interface no matter the inheritance chain for the actual exception. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Learning About Dependency Injection and PHP by Yang Baru Dari Zend Framework 2 &#124; 0prek</title>
		<link>http://ralphschindler.com/2011/05/18/learning-about-dependency-injection-and-php/comment-page-1#comment-100341</link>
		<dc:creator>Yang Baru Dari Zend Framework 2 &#124; 0prek</dc:creator>
		<pubDate>Fri, 11 Jan 2013 22:46:31 +0000</pubDate>
		<guid isPermaLink="false">http://ralphschindler.com/?p=144#comment-100341</guid>
		<description><![CDATA[[...] lebih lanjut tentang DI ini, silahkan baca tutorial di nettuts, atau penjelasan Ralph Schindler di blog-nya atau analogi-nya Weier O’Phinney. Nanti kalau ada kesempatan saya juga akan membahas tentang [...]]]></description>
		<content:encoded><![CDATA[<p>[...] lebih lanjut tentang DI ini, silahkan baca tutorial di nettuts, atau penjelasan Ralph Schindler di blog-nya atau analogi-nya Weier O’Phinney. Nanti kalau ada kesempatan saya juga akan membahas tentang [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on PHP Constructor Best Practices And The Prototype Pattern by Amit Sharma</title>
		<link>http://ralphschindler.com/2012/03/09/php-constructor-best-practices-and-the-prototype-pattern/comment-page-1#comment-100242</link>
		<dc:creator>Amit Sharma</dc:creator>
		<pubDate>Fri, 11 Jan 2013 05:58:33 +0000</pubDate>
		<guid isPermaLink="false">http://ralphschindler.com/?p=166#comment-100242</guid>
		<description><![CDATA[Attempting to throw an exception from a destructor (called in the time of script termination) causes a fatal error.]]></description>
		<content:encoded><![CDATA[<p>Attempting to throw an exception from a destructor (called in the time of script termination) causes a fatal error.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Autoloading (Revisited) by Elodie</title>
		<link>http://ralphschindler.com/2011/09/19/autoloading-revisited/comment-page-1#comment-95058</link>
		<dc:creator>Elodie</dc:creator>
		<pubDate>Fri, 30 Nov 2012 08:10:14 +0000</pubDate>
		<guid isPermaLink="false">http://ralphschindler.com/?p=154#comment-95058</guid>
		<description><![CDATA[Really informative post!  This page is a nice reference on autoloading in PHP as well:

&lt;a href=&quot;http://www.programmerinterview.com/index.php/php-questions/php-example-of-the-__autoload-function/&quot; rel=&quot;nofollow&quot;&gt;Example of autoloading in PHP&lt;/a&gt;]]></description>
		<content:encoded><![CDATA[<p>Really informative post!  This page is a nice reference on autoloading in PHP as well:</p>
<p><a href="http://www.programmerinterview.com/index.php/php-questions/php-example-of-the-__autoload-function/" rel="nofollow">Example of autoloading in PHP</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on PHP Constructor Best Practices And The Prototype Pattern by Michael Davidson</title>
		<link>http://ralphschindler.com/2012/03/09/php-constructor-best-practices-and-the-prototype-pattern/comment-page-1#comment-93942</link>
		<dc:creator>Michael Davidson</dc:creator>
		<pubDate>Thu, 22 Nov 2012 22:31:31 +0000</pubDate>
		<guid isPermaLink="false">http://ralphschindler.com/?p=166#comment-93942</guid>
		<description><![CDATA[I can see how this example makes sense whenever you are using classes that already exist; however, it would seem more prudent to use an interface for new APIs. Then again, maybe that&#039;s the point.]]></description>
		<content:encoded><![CDATA[<p>I can see how this example makes sense whenever you are using classes that already exist; however, it would seem more prudent to use an interface for new APIs. Then again, maybe that&#8217;s the point.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Learning About Dependency Injection and PHP by me</title>
		<link>http://ralphschindler.com/2011/05/18/learning-about-dependency-injection-and-php/comment-page-1#comment-93887</link>
		<dc:creator>me</dc:creator>
		<pubDate>Thu, 22 Nov 2012 11:13:26 +0000</pubDate>
		<guid isPermaLink="false">http://ralphschindler.com/?p=144#comment-93887</guid>
		<description><![CDATA[Tony Marston I agree with you 100%
have been working in IT 16 years, 12 of them on the web]]></description>
		<content:encoded><![CDATA[<p>Tony Marston I agree with you 100%<br />
have been working in IT 16 years, 12 of them on the web</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on About by Ori</title>
		<link>http://ralphschindler.com/about/comment-page-1#comment-92628</link>
		<dc:creator>Ori</dc:creator>
		<pubDate>Sat, 10 Nov 2012 03:07:59 +0000</pubDate>
		<guid isPermaLink="false">#comment-92628</guid>
		<description><![CDATA[Hey Ralph, your Zend_Db-Examples on github, is a real gem, albeit one I can&#039;t fathom, yet.  

I&#039;ve adapted the User-guide&#039;s tutorial and currently have two Controllers connected(1 controller to 1 table) to two related tables in my db(MySQL), implementing the Table Data Gateway pattern.  Any advice on how to do joins?

Thanks]]></description>
		<content:encoded><![CDATA[<p>Hey Ralph, your Zend_Db-Examples on github, is a real gem, albeit one I can&#8217;t fathom, yet.  </p>
<p>I&#8217;ve adapted the User-guide&#8217;s tutorial and currently have two Controllers connected(1 controller to 1 table) to two related tables in my db(MySQL), implementing the Table Data Gateway pattern.  Any advice on how to do joins?</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Exception Best Practices in PHP 5.3 by Christian Weiss</title>
		<link>http://ralphschindler.com/2010/09/15/exception-best-practices-in-php-5-3/comment-page-1#comment-92516</link>
		<dc:creator>Christian Weiss</dc:creator>
		<pubDate>Thu, 08 Nov 2012 15:52:31 +0000</pubDate>
		<guid isPermaLink="false">http://ralphschindler.com/?p=107#comment-92516</guid>
		<description><![CDATA[Standards are fine and elate team mates to respect standards.

SPL in general is good stuff - and SPL exceptions is a good idea, but due to missing examples, missing explanations on php.net and its ambiguity there is little acceptance in the PHP community and each exception is used with a different understanding in its meaning, depending on which developer is using it. Now after some years there is still no big adaptation of SPL exceptions in the PHP community.

These issues are the reason why i elate team mates to write own exception classes. I know they are able to practice &quot;clean code&quot; - strongly believe they do not introduce ambiguity (better than SPL).

Next issue i want to outline is: exceptions are part of your API.
So use doc blocks to your methods and add @throws annotations for each exception thrown. When your method uses external code (other objects, external libs) the external exceptions would bubble through your method. External exceptions become part of your API this way. Every change to the external code (rename of an exception or introduction of a new exception) would require you to update your doc block, too. It is not a good idea to add these external exceptions to your API (to your doc block with additional @throws lines). If your method can not recover this exception it should re-throw it as your own exception at least. Do not forget to add a catch-all statement (PHP base exception) and re-throw your own exception . When doing this you are immune for external changes - you follow the open-closed principle. If your app is for PHP &gt;=5.3 use nested exceptions when re-throw an exception.

Your argument, that standardized exceptions would enable you to switch from one lib to another - i can not follow. 
To be able to switch from one lib to another lib without changing my code requires the following:
a) two libs that implements the same interfaces
b) two libs that offers same external behavior 
c) two libs that throws the same exceptions within the same event

There is no kind of &quot;interfaces with exceptions declaration&quot; in PHP that can be used to keep a consistent API.
SPL is trying to solve this by convention - but you can not solve this by convention, because you can imagine an infinity amount of problem domains - and good exception names that fits to that problem domain are available in infinity amount, too. 

Do not misunderstand me: i elate my team mates to follow conventions. There are a lot of conventions that do make sense. E.g. getter and setter methods which names are prefixed with &quot;get&quot; and &quot;set&quot;. Factory methods that are postfixed with &quot;Factory&quot;, etc. But trying to provide a convention (lib) with e.g. 200 getter names will never be enough. If there is a need for a naming convention then contribute this to a wide-used coding standard.

PHP do need a kind of &quot;interfaces with exceptions declaration&quot; to define the &quot;full&quot; API. 

The only point that should be discussed in further detail is: Does it make sense to promote to categorize your exceptions into &quot;runtime exception&quot; or &quot;logical exception&quot;? I do not have a standpoint for that today, but i will think about it. But again, i do not see a reason why this should be introduced by a lib. Promote coding standards or best practices for that, would be a better way of doing that.

Another point i want to propagate: do not use exceptions with exception-codes. Codes requires mental mapping which is bad style / old school (see &quot;clean code&quot; for details).]]></description>
		<content:encoded><![CDATA[<p>Standards are fine and elate team mates to respect standards.</p>
<p>SPL in general is good stuff &#8211; and SPL exceptions is a good idea, but due to missing examples, missing explanations on php.net and its ambiguity there is little acceptance in the PHP community and each exception is used with a different understanding in its meaning, depending on which developer is using it. Now after some years there is still no big adaptation of SPL exceptions in the PHP community.</p>
<p>These issues are the reason why i elate team mates to write own exception classes. I know they are able to practice &#8220;clean code&#8221; &#8211; strongly believe they do not introduce ambiguity (better than SPL).</p>
<p>Next issue i want to outline is: exceptions are part of your API.<br />
So use doc blocks to your methods and add @throws annotations for each exception thrown. When your method uses external code (other objects, external libs) the external exceptions would bubble through your method. External exceptions become part of your API this way. Every change to the external code (rename of an exception or introduction of a new exception) would require you to update your doc block, too. It is not a good idea to add these external exceptions to your API (to your doc block with additional @throws lines). If your method can not recover this exception it should re-throw it as your own exception at least. Do not forget to add a catch-all statement (PHP base exception) and re-throw your own exception . When doing this you are immune for external changes &#8211; you follow the open-closed principle. If your app is for PHP &gt;=5.3 use nested exceptions when re-throw an exception.</p>
<p>Your argument, that standardized exceptions would enable you to switch from one lib to another &#8211; i can not follow.<br />
To be able to switch from one lib to another lib without changing my code requires the following:<br />
a) two libs that implements the same interfaces<br />
b) two libs that offers same external behavior<br />
c) two libs that throws the same exceptions within the same event</p>
<p>There is no kind of &#8220;interfaces with exceptions declaration&#8221; in PHP that can be used to keep a consistent API.<br />
SPL is trying to solve this by convention &#8211; but you can not solve this by convention, because you can imagine an infinity amount of problem domains &#8211; and good exception names that fits to that problem domain are available in infinity amount, too. </p>
<p>Do not misunderstand me: i elate my team mates to follow conventions. There are a lot of conventions that do make sense. E.g. getter and setter methods which names are prefixed with &#8220;get&#8221; and &#8220;set&#8221;. Factory methods that are postfixed with &#8220;Factory&#8221;, etc. But trying to provide a convention (lib) with e.g. 200 getter names will never be enough. If there is a need for a naming convention then contribute this to a wide-used coding standard.</p>
<p>PHP do need a kind of &#8220;interfaces with exceptions declaration&#8221; to define the &#8220;full&#8221; API. </p>
<p>The only point that should be discussed in further detail is: Does it make sense to promote to categorize your exceptions into &#8220;runtime exception&#8221; or &#8220;logical exception&#8221;? I do not have a standpoint for that today, but i will think about it. But again, i do not see a reason why this should be introduced by a lib. Promote coding standards or best practices for that, would be a better way of doing that.</p>
<p>Another point i want to propagate: do not use exceptions with exception-codes. Codes requires mental mapping which is bad style / old school (see &#8220;clean code&#8221; for details).</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: enhanced

 Served from: ralphschindler.com @ 2013-06-19 02:08:12 by W3 Total Cache -->