[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
 

Re: SV: [PROGRAMMERING] Pæn OOP i PHP



Lars Riisgaard Ribe wrote:

[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...


Må jeg anbefale <http://www.phptr.com/title/013147149X>PHP5 power Programming fra Bruce Perens' Open Source Series books
(Prentice Hall, http://www.phptr.com/series/series.asp?st=44315&rl=1 )


Jeg synes ikke det gør noget at en bog kan downloades frit - jeg er ikke sikker på at jeg ville have købt netop den (blandt mange andre om PHP), men nu kan det godt være jeg investerer i den til "natbordet" :-)

Der er bl.a eksempler på Design Patterns typer - og glimrende kapitler om OOP i PHP5 (NB, meget ændret i fht PHP4).

Best regards
Preben
--

Solis Sacerdotibus - Preben Bille Brahe
http://www.pbb.dk    mailto: pbb (at) pbb (dot) dk

"I'm not out to destroy Microsoft. That will just be a completely unintentional side effect." -- Linus Torvalds

 
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] *