🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.php
Article #231893

Re: Dobre praktyki

#231893
From: Marek S
Date: Sat, 27 Jan 2018 12:40
21 lines
2051 bytes
W dniu 27-01-2018 o 13:05, Wojciech Bancer pisze:

> 
> Nikt nie pisał o wielokrotnym inicjowaniu połączeń.
> Doczytaj sobie o wzorcach dependency injection.

Ale to właśnie jest jedną z implementacji takich singletonów - tu 
zwanych pluginami. Różnica leksykalna.

Cytat z Wiki:
"Polega na przekazywaniu gotowych, utworzonych instancji obiektów 
udostępniających swoje metody i właściwości obiektom, które z nich 
korzystają (np. jako parametry konstruktora)"

Te "gotowe instancje" to są nic innego jako singletony wygenerowane 
przez ich fabrykę. Przez fabrykę otrzymujesz globalny dostęp do 
stworzonych obiektów - a taka jest właśnie definicja singletonów.

-- 
Pozdrawiam,
Marek
Technical Details
Message-ID: <p4hrvu$ctn$1@node2.news.atman.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!newsfeed2.atman.pl!newsfeed.atman.pl!.POSTED!not-for-mail
References: <2lhebv1xabri$.dlg@tyczka.com> <6d0bd754-9b46-46ce-98ff-c5265a9a93af@googlegroups.com> <chac9zcm8l6a.1gxug7ng6lbce$.dlg@40tude.net> <cd0f750f-2346-4016-bbbd-a72c386c561d@googlegroups.com> <slrnp6hci6.23ml.wojciech.bancer@pl-test.org> <fc6bfbc5-c858-4156-95c5-cb276d07067e@googlegroups.com> <slrnp6kee7.2lbk.wojciech.bancer@pl-test.org> <p4dnnf$m5b$1@node2.news.atman.pl> <slrnp6kpt1.30s7.wojciech.bancer@pl-test.org> <p4f8p3$tfb$1@node1.news.atman.pl> <slrnp6oqo7.g5g.wojciech.bancer@pl-test.org>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!newsfeed2.atman.pl!newsfeed.atman.pl!.POSTED!not-for-mail
From: Marek S <precz@spamowi.com>
Newsgroups: pl.comp.lang.php
Subject: Re: Dobre praktyki
Date: Sat, 27 Jan 2018 13:40:24 +0100
Organization: ATMAN - ATM S.A.
Lines: 21
Message-ID: <p4hrvu$ctn$1@node2.news.atman.pl>
References: <2lhebv1xabri$.dlg@tyczka.com> <6d0bd754-9b46-46ce-98ff-c5265a9a93af@googlegroups.com> <chac9zcm8l6a.1gxug7ng6lbce$.dlg@40tude.net> <cd0f750f-2346-4016-bbbd-a72c386c561d@googlegroups.com> <slrnp6hci6.23ml.wojciech.bancer@pl-test.org> <fc6bfbc5-c858-4156-95c5-cb276d07067e@googlegroups.com> <slrnp6kee7.2lbk.wojciech.bancer@pl-test.org> <p4dnnf$m5b$1@node2.news.atman.pl> <slrnp6kpt1.30s7.wojciech.bancer@pl-test.org> <p4f8p3$tfb$1@node1.news.atman.pl> <slrnp6oqo7.g5g.wojciech.bancer@pl-test.org>
NNTP-Posting-Host: 89-69-207-111.dynamic.chello.pl
Mime-Version: 1.0
X-Trace: node2.news.atman.pl 1517056830 13239 89.69.207.111 (27 Jan 2018 12:40:30 GMT)
X-Complaints-To: usenet@atman.pl
NNTP-Posting-Date: Sat, 27 Jan 2018 12:40:30 +0000 (UTC)
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2
In-Reply-To: <slrnp6oqo7.g5g.wojciech.bancer@pl-test.org>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit