<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Designs &amp; Patterns on Justin Carmony</title>
		<link>https://www.justincarmony.com/tags/designs--patterns/</link>
		<description>Recent content in Designs &amp; Patterns on Justin Carmony</description>
		<generator>Hugo</generator>
		<language>en-us</language>
		
		
		
		
			<lastBuildDate>Wed, 03 Dec 2008 06:37:53 +0000</lastBuildDate>
		
			<atom:link href="https://www.justincarmony.com/tags/designs--patterns/index.xml" rel="self" type="application/rss+xml" />
			<item>
				<title>PHP Singletons, Sub-Classing, and HAS-A Relationships</title>
				<link>https://www.justincarmony.com/2008/12/03/php-singletons-sub-classing-and-has-a-relationships/</link>
				<pubDate>Wed, 03 Dec 2008 06:37:53 +0000</pubDate>
				<guid>https://www.justincarmony.com/2008/12/03/php-singletons-sub-classing-and-has-a-relationships/</guid>
				<description>&lt;p&gt;I&amp;rsquo;ve been very busy these last fews weeks and have neglected making any posts. While there are a variety of subjects I&amp;rsquo;d love to post about, they&amp;rsquo;ll most likely have to wait until the next year. However, I thought I might be able to throw up a quick example of how to use PHP Singletons and extending public classes.&lt;/p&gt;&#xA;&lt;p&gt;The &lt;a href=&#34;http://en.wikipedia.org/wiki/Singleton_pattern#PHP_5&#34;&gt;Singleton Pattern&lt;/a&gt; &amp;ldquo;is a &lt;a href=&#34;http://en.wikipedia.org/wiki/Design_pattern_%28computer_science%29&#34; title=&#34;Design pattern (computer science)&#34;&gt;design pattern&lt;/a&gt; that is used to restrict &lt;a href=&#34;http://en.wikipedia.org/wiki/Instantiation_%28computer_science%29&#34; title=&#34;Instantiation (computer science)&#34;&gt;instantiation&lt;/a&gt; of a class to one &lt;a href=&#34;http://en.wikipedia.org/wiki/Object-oriented_programming&#34; title=&#34;Object-oriented programming&#34;&gt;object&lt;/a&gt;.&amp;rdquo; (Wikipedia) In PHP, a singleton is created by making the constructor protected or private. &amp;ldquo;How do you create an object then?&amp;rdquo; Its done in two parts. First, you make a static class variable that is private, to hold the instance. Second, create a static function to return the instance. Here is an example:&lt;/p&gt;</description>
			</item>
			<item>
				<title>PHP Design - Biggest Database Oversights</title>
				<link>https://www.justincarmony.com/2008/10/25/php-design-biggest-database-oversights/</link>
				<pubDate>Sat, 25 Oct 2008 07:56:44 +0000</pubDate>
				<guid>https://www.justincarmony.com/2008/10/25/php-design-biggest-database-oversights/</guid>
				<description>&lt;p&gt;&lt;a href=&#34;https://www.justincarmony.com/images/wp/2008/10/database-vector.png&#34;&gt;&lt;img src=&#34;https://www.justincarmony.com/images/wp/2008/10/database-vector.png&#34; alt=&#34;&#34; title=&#34;database-vector&#34;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;Over the last three years I&amp;rsquo;ve had the opportunity to work on several PHP projects, some of them having grown rapidly and required to scale quickly. Three in particular have been a fantastic learning experience for me. Now I don&amp;rsquo;t consider myself a total expert, but I thought I would share my experiences. Many PHP developers are self-taught, like I was, and are learning PHP to be able to create dynamic websites. Many haven&amp;rsquo;t had studied or learned best practices for Object-Oriented Programming (OOP). They are web designers first, and programming in PHP is just a way to do things simple HTML can&amp;rsquo;t do.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Five common PHP design patterns that aren&#39;t used enough</title>
				<link>https://www.justincarmony.com/2008/03/07/five-common-php-design-patterns-that-arent-used-enough/</link>
				<pubDate>Fri, 07 Mar 2008 16:09:34 +0000</pubDate>
				<guid>https://www.justincarmony.com/2008/03/07/five-common-php-design-patterns-that-arent-used-enough/</guid>
				<description>&lt;p&gt;&amp;ldquo;This article explains five widely used design patterns in PHP with sample code to demonstrate each pattern. Intermediate level.&amp;rdquo;&lt;/p&gt;&#xA;&lt;p&gt;I can&amp;rsquo;t say how many PHP programmers that could benefit from using these &amp;ldquo;design patterns.&amp;rdquo; So many times PHP, and PHP coders, make me feel like we&amp;rsquo;re just writing hacks all day. A solid understanding of these patterns and when to use the can make large projects better and more sound. It is so easy to write a complex website. It is a total pain trying to maintain it. These patterns are all about maintaining code, not just writing it.&lt;/p&gt;</description>
			</item>
	</channel>
</rss>
