[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

SV: [PROGRAMMERING] Pæn OOP i PHP



[klip]
> Du har brug for det pattern, som hedder singleton. Princippet er egentlig
> ret simpelt: Lav en statisk metode i klassen, som returnerer et objekt af
> den klasse. Inde i metoden skal du så instantiere objektet, hvis det ikke
> findes i forvejen, og ellers returnere en reference til det allerede
> instantierede objekt. Klassens construktor skal være private, så andre
> ikke kan instantiere et nyt objekt.
> 
[klip]
Tak! Det var lige det, der skulle til! Og så må jeg få taget mig sammen til
at få læst den bog om design patterns én gang for alle...

Hilsen

Lars



 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2006-03-01, 02:01 CET [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *