<?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"
	>
<channel>
	<title>Comments on: Lazy PHP: Part 3</title>
	<atom:link href="http://www.sitepoint.com/blogs/2004/05/05/lazy-php-part-3/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sitepoint.com/blogs/2004/05/05/lazy-php-part-3/</link>
	<description>News, opinion, and fresh thinking for web developers and designers. The official podcast of sitepoint.com.</description>
	<pubDate>Tue, 02 Dec 2008 11:36:52 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5</generator>
		<item>
		<title>By: actarus</title>
		<link>http://www.sitepoint.com/blogs/2004/05/05/lazy-php-part-3/#comment-269</link>
		<dc:creator>actarus</dc:creator>
		<pubDate>Wed, 31 Dec 1969 19:00:00 +0000</pubDate>
		<guid isPermaLink="false">329635062#comment-269</guid>
		<description>&lt;p&gt;w00t ! it rocks. but just an idea, wouldn't it be better in ResolvHandle() to use an eval() for the object call ? i mean, for the arguments, instead of the switch, something like:&lt;/p&gt;

&lt;p&gt;$code  = '$Handle = new $Class(';&lt;br /&gt;
$code .= implode(', ', $ConstructionArgs);&lt;br /&gt;
$code .= ');';&lt;/p&gt;

&lt;p&gt;eval($code);&lt;/p&gt;

</description>
		<content:encoded><![CDATA[<p>w00t ! it rocks. but just an idea, wouldn&#8217;t it be better in ResolvHandle() to use an eval() for the object call ? i mean, for the arguments, instead of the switch, something like:</p>
<p>$code  = &#8216;$Handle = new $Class(&#8217;;<br />
$code .= implode(&#8217;, &#8216;, $ConstructionArgs);<br />
$code .= &#8216;);&#8217;;</p>
<p>eval($code);</p>]]></content:encoded>
	</item>
	<item>
		<title>By: actarus</title>
		<link>http://www.sitepoint.com/blogs/2004/05/05/lazy-php-part-3/#comment-270</link>
		<dc:creator>actarus</dc:creator>
		<pubDate>Wed, 31 Dec 1969 19:00:00 +0000</pubDate>
		<guid isPermaLink="false">329635062#comment-270</guid>
		<description>&lt;p&gt;i meant:&lt;/p&gt;

&lt;code&gt;$code = '$Handle = new $Class(';
$code .= implode(', ', $ConstructionArgs);
$code .= ');';

eval($code);&lt;/code&gt;&lt;p&gt;sorry for the noise :) but heh, there is no way to preview the comment before posting :/&lt;/p&gt;

</description>
		<content:encoded><![CDATA[<p>i meant:</p>
<p><code>$code = '$Handle = new $Class(';
$code .= implode(', ', $ConstructionArgs);
$code .= ');';

eval($code);</code>
</p><p>sorry for the noise :) but heh, there is no way to preview the comment before posting :/</p>]]></content:encoded>
	</item>
	<item>
		<title>By: sevengraff</title>
		<link>http://www.sitepoint.com/blogs/2004/05/05/lazy-php-part-3/#comment-271</link>
		<dc:creator>sevengraff</dc:creator>
		<pubDate>Wed, 31 Dec 1969 19:00:00 +0000</pubDate>
		<guid isPermaLink="false">329635062#comment-271</guid>
		<description>&lt;p&gt;I think that is how it is done in Pear's Form (not quick form)&lt;/p&gt;

</description>
		<content:encoded><![CDATA[<p>I think that is how it is done in Pear&#8217;s Form (not quick form)</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Alan Knowles</title>
		<link>http://www.sitepoint.com/blogs/2004/05/05/lazy-php-part-3/#comment-272</link>
		<dc:creator>Alan Knowles</dc:creator>
		<pubDate>Wed, 31 Dec 1969 19:00:00 +0000</pubDate>
		<guid isPermaLink="false">329635062#comment-272</guid>
		<description>&lt;p&gt;reminds me of your last post on Oo gone mad...&lt;/p&gt;

&lt;p&gt;trying to solve a simple problem by adding layers and layers of code..&lt;br /&gt;
a) dont use PHP construtors! for objects with args. xxxxx::construct(....)&lt;br /&gt;
b) require before use..&lt;/p&gt;

&lt;p&gt;Regards&lt;br /&gt;
Alan&lt;/p&gt;

</description>
		<content:encoded><![CDATA[<p>reminds me of your last post on Oo gone mad&#8230;</p>
<p>trying to solve a simple problem by adding layers and layers of code..<br />
a) dont use PHP construtors! for objects with args. xxxxx::construct(&#8230;.)<br />
b) require before use..</p>
<p>Regards<br />
Alan</p>]]></content:encoded>
	</item>
	<item>
		<title>By: HarryF</title>
		<link>http://www.sitepoint.com/blogs/2004/05/05/lazy-php-part-3/#comment-273</link>
		<dc:creator>HarryF</dc:creator>
		<pubDate>Wed, 31 Dec 1969 19:00:00 +0000</pubDate>
		<guid isPermaLink="false">329635062#comment-273</guid>
		<description>&lt;p&gt;&lt;blockquote&gt;&lt;p&gt;&lt;br /&gt;
wouldn't it be better in ResolvHandle() to use an eval() for the object call ?&lt;br /&gt;
&lt;/p&gt;&lt;/blockquote&gt;&lt;/p&gt;

&lt;p&gt;I guess yes but as Jeff puts it &lt;a href="http://www.sitepoint.com/forums/showthread.php?t=150502"&gt;here&lt;/a&gt;: "I am prejudiced against eval." which is a point of view I can understand, from my perspective because I don't think I'd ever be able to trust it 100% and be nervous every time PHP changes version. Something like ResolveHandle is likely to get embedded in alot of code so having it break would be painful.&lt;/p&gt;

&lt;p&gt;The three argument limit to the constructor seems like a rough edge (although it's easy to increase). Generally though, who send more than about 5 to a constructor?&lt;/p&gt;

</description>
		<content:encoded><![CDATA[<p>
<blockquote>
<p>
wouldn&#8217;t it be better in ResolvHandle() to use an eval() for the object call ?
</p>
</blockquote>
</p><p>I guess yes but as Jeff puts it <a href="http://www.sitepoint.com/forums/showthread.php?t=150502">here</a>: &#8220;I am prejudiced against eval.&#8221; which is a point of view I can understand, from my perspective because I don&#8217;t think I&#8217;d ever be able to trust it 100% and be nervous every time PHP changes version. Something like ResolveHandle is likely to get embedded in alot of code so having it break would be painful.</p>
<p>The three argument limit to the constructor seems like a rough edge (although it&#8217;s easy to increase). Generally though, who send more than about 5 to a constructor?</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Selkirk</title>
		<link>http://www.sitepoint.com/blogs/2004/05/05/lazy-php-part-3/#comment-274</link>
		<dc:creator>Selkirk</dc:creator>
		<pubDate>Wed, 31 Dec 1969 19:00:00 +0000</pubDate>
		<guid isPermaLink="false">329635062#comment-274</guid>
		<description>&lt;p&gt;Alan,&lt;/p&gt;

&lt;p&gt;This handle mechanism is only intended to be used in a limited set of circumstances.  That is when creating an object that is intended to control interaction with a user across a series of requests.  The handle mechanism provides a way to compose a single assembly of objects for the interaction, and yet only instantiate the objects needed for the particular request being handled at the moment.  It is an optimization adaption to PHP's lack of ability to preserve state between requests.&lt;/p&gt;

&lt;p&gt;If you do not wish to use this optimization, you can instead include all of the files necessary and instantiate all of the objects in the assembly on every request.  This results in simpler code and is a perfectly valid way to use this mechanism in WACT.  The API for doing this is the same.  I took the simpler approach in [URL=http://www.sitepoint.com/forums/showpost.php?p=1208767&#038;postcount=43]this post[/URL]. rather than try to explain the handle mechanism, it just didn't use it.&lt;/p&gt;

&lt;p&gt;The syntax [CODE]classfile.php&#124;class[/CODE] is meant to be the PHP equivalent to a fully qualified java class specification: [CODE]x.y.z.class[/CODE].&lt;/p&gt;

&lt;p&gt;The handle design replaced a template method based design and favors a composition based approach rather than an inheritance based approach for using WACT controllers.  Based on the typical usage so far, this approach is better than the previous approach we used.&lt;/p&gt;

&lt;p&gt;That said, the controller design from WACT is far from set in stone and far from finished.  There may be a better design to accomplish the same thing that remains undiscovered.  Also, I have not yet done benchmarking to determine if the optimization this provides is worth the extra complexity, or if it the benefit of lazy loading even outweighs the costs of the ResolveHandle function for common examples.  if it turns out that it does not, I would happily consider removing this from WACT in favor of simplicity.&lt;/p&gt;

</description>
		<content:encoded><![CDATA[<p>Alan,</p>
<p>This handle mechanism is only intended to be used in a limited set of circumstances.  That is when creating an object that is intended to control interaction with a user across a series of requests.  The handle mechanism provides a way to compose a single assembly of objects for the interaction, and yet only instantiate the objects needed for the particular request being handled at the moment.  It is an optimization adaption to PHP&#8217;s lack of ability to preserve state between requests.</p>
<p>If you do not wish to use this optimization, you can instead include all of the files necessary and instantiate all of the objects in the assembly on every request.  This results in simpler code and is a perfectly valid way to use this mechanism in WACT.  The API for doing this is the same.  I took the simpler approach in [URL=http://www.sitepoint.com/forums/showpost.php?p=1208767&#038;postcount=43]this post[/URL]. rather than try to explain the handle mechanism, it just didn&#8217;t use it.</p>
<p>The syntax [CODE]classfile.php|class[/CODE] is meant to be the PHP equivalent to a fully qualified java class specification: [CODE]x.y.z.class[/CODE].</p>
<p>The handle design replaced a template method based design and favors a composition based approach rather than an inheritance based approach for using WACT controllers.  Based on the typical usage so far, this approach is better than the previous approach we used.</p>
<p>That said, the controller design from WACT is far from set in stone and far from finished.  There may be a better design to accomplish the same thing that remains undiscovered.  Also, I have not yet done benchmarking to determine if the optimization this provides is worth the extra complexity, or if it the benefit of lazy loading even outweighs the costs of the ResolveHandle function for common examples.  if it turns out that it does not, I would happily consider removing this from WACT in favor of simplicity.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Ren</title>
		<link>http://www.sitepoint.com/blogs/2004/05/05/lazy-php-part-3/#comment-275</link>
		<dc:creator>Ren</dc:creator>
		<pubDate>Wed, 31 Dec 1969 19:00:00 +0000</pubDate>
		<guid isPermaLink="false">329635062#comment-275</guid>
		<description>&lt;p&gt;Why was &#124; used rather than #?&lt;/p&gt;

&lt;p&gt;userupdateinitial.php#UserUpdateInitial&lt;/p&gt;

&lt;p&gt;just to make it more like a URL, and  then possibly could get ResolveHandle() creating proxies, for services/classes elsewhere.&lt;/p&gt;

</description>
		<content:encoded><![CDATA[<p>Why was | used rather than #?</p>
<p>userupdateinitial.php#UserUpdateInitial</p>
<p>just to make it more like a URL, and  then possibly could get ResolveHandle() creating proxies, for services/classes elsewhere.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: HarryF</title>
		<link>http://www.sitepoint.com/blogs/2004/05/05/lazy-php-part-3/#comment-276</link>
		<dc:creator>HarryF</dc:creator>
		<pubDate>Wed, 31 Dec 1969 19:00:00 +0000</pubDate>
		<guid isPermaLink="false">329635062#comment-276</guid>
		<description>&lt;p&gt;&lt;blockquote&gt;&lt;p&gt;&lt;br /&gt;
Why was &#124; used rather than #?&lt;br /&gt;
&lt;/p&gt;&lt;/blockquote&gt;&lt;/p&gt;

&lt;p&gt;Because : is used in Windows paths...;) actually don't think we though of # - good idea - like the remote proxy angle.&lt;/p&gt;

</description>
		<content:encoded><![CDATA[<p>
<blockquote>
<p>
Why was | used rather than #?
</p>
</blockquote>
</p><p>Because : is used in Windows paths&#8230;;) actually don&#8217;t think we though of # - good idea - like the remote proxy angle.</p>]]></content:encoded>
	</item>
</channel>
</rss>
