Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
programming:php-singlethon-pattern [2014/05/28 14:16] – Giuseppe Di Terlizzi | programming:php-singlethon-pattern [2014/08/21 18:40] (current) – Giuseppe Di Terlizzi | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Singleton Pattern | + | ====== |
- | Con questa guida descriveremo come creare una classe che implementa il pattern // | + | {{http:// |
Come suggerisce il nome, il pattern singleton è un particolare pattern che permette ad una classe di essere istanziata "una sola volta" | Come suggerisce il nome, il pattern singleton è un particolare pattern che permette ad una classe di essere istanziata "una sola volta" | ||
Line 45: | Line 45: | ||
<file php Registry.php> | <file php Registry.php> | ||
<?php | <?php | ||
- | include Singleton.php; | + | include |
| | ||
class Registry extends Singleton { | class Registry extends Singleton { | ||
Line 79: | Line 79: | ||
<?php | <?php | ||
- | include Registry.php; | + | include |
$registry = Registry:: | $registry = Registry:: |