<?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>Acumen Development &#187; vector</title>
	<atom:link href="http://www.acumendevelopment.net/tag/vector/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.acumendevelopment.net</link>
	<description>Software to inspire.</description>
	<lastBuildDate>Wed, 02 Jun 2010 16:39:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0-alpha</generator>
		<item>
		<title>Vector for php, surely not?</title>
		<link>http://www.acumendevelopment.net/vector-for-php-surely-not/</link>
		<comments>http://www.acumendevelopment.net/vector-for-php-surely-not/#comments</comments>
		<pubDate>Thu, 21 Feb 2008 16:42:46 +0000</pubDate>
		<dc:creator>Paul Hayes</dc:creator>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[vector]]></category>

		<guid isPermaLink="false">http://acumendevelopment.net.paul.proto1.acumensystems.net/?p=40</guid>
		<description><![CDATA[Ok before you try to hit me let me explain. This is not just a boring Object Orientated wrapper for storing PHP object in an array. It&#8217;s a multi-indexed,  self sufficient class.

Too many times I&#8217;ve seen my code swell with foreach loops, looking for elements with a certain property, or to call a function [...]]]></description>
			<content:encoded><![CDATA[<p>Ok before you try to hit me let me explain. This is not just a boring Object Orientated wrapper for storing PHP object in an array. It&#8217;s a multi-indexed,  self sufficient class.</p>
<p><span id="more-40"></span></p>
<p>Too many times I&#8217;ve seen my code swell with foreach loops, looking for elements with a certain property, or to call a function of each object in an array. Additionally making sure the keys of an array match one particular property and stay in sink with them. So to try and side step all these I&#8217;m started Vector, I&#8217;m sure others have done similar, but reinvention is one of the fun things about being a programmer (and one of the few things which make it similar to being an artist).</p>
<p>So here&#8217;s how you use Vector currently:</p>
<p><code>&lt;?php </code></p>
<p><code>require_once('Vector.class.php');<br />
require_once('User.example.class.php');</code></p>
<p><code><br />
<font color="#99cc00"> //initialize a Vector and add a index that uses the username field of each object entered into the array<br />
</font> $users=new Vector();<br />
$users-&gt;addIndex('username');</code></p>
<p><code><br />
<font color="#99cc00"> //add two objects of class User into the vector<br />
</font> $users-&gt;addObject($frank=new User('frank.n.stein','monster'));<br />
$users-&gt;addObject($vlad=new User('count.dracula','vampire'));</code></p>
<p><code><br />
<font color="#99cc00"> //call the checkpassword method of the object whose username is count.dracula<br />
</font> if($users-&gt;exists('username','count.dracula') &amp;&amp; $users-&gt;username['count.dracula']-&gt;checkPassword('vampire'))<br />
{<br />
echo 'password correct!';<br />
}<br />
else<br />
{<br />
echo 'password false';<br />
}<br />
?&gt;</code></p>
<p>I hope to include more features later. But it&#8217;s a start.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.acumendevelopment.net/vector-for-php-surely-not/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using memcached

Served from: www.acumendevelopment.net @ 2010-09-10 02:24:54 -->