Kavacky Posted June 18, 2013 Report Share Posted June 18, 2013 Ja klase ir globāli pieejama un tai ir tikpat globāli pieejams variablis ( publisks vai privāts, bet sasniedzams caur metodi - vienalga ), tad kas tas ir, ja ne globāls variablis, a? Quote Link to comment Share on other sites More sharing options...
Mr.Key Posted June 18, 2013 Report Share Posted June 18, 2013 Tas ir interesanti vispār, nezināju, ka tā ir. Kavacky, lūdzu, ieliec aprakstu, kur pamatots, ka OOP Singleton patterns ir globālais variablis. Tas ir domāts par programmēšanas valodu iekšējo izpildījumu? Vai tas arhitektoniski tā skaitās pēc definīcijas? Quote Link to comment Share on other sites More sharing options...
jurchiks Posted June 18, 2013 Report Share Posted June 18, 2013 (edited) Tas ir līdzīgi, bet nav tas pats. Pats variablis nav tieši pieejams un reassignojams (vai vismaz tam nevajadzētu būt reassignojamam), jo tas neatrodās global namespace. Tu varbūt uzskati, ka visi class variables, kuriem ir getteris, ir globāli? Muļķības. Edited June 18, 2013 by jurchiks Quote Link to comment Share on other sites More sharing options...
Kavacky Posted June 18, 2013 Report Share Posted June 18, 2013 (edited) Atkārtošana - zināšanu māte: _principiālas_ atšķirības nav. Edited June 18, 2013 by Kavacky Quote Link to comment Share on other sites More sharing options...
jurchiks Posted June 18, 2013 Report Share Posted June 18, 2013 t.i. tu reāli argumentēt nevari. Quote Link to comment Share on other sites More sharing options...
spainis Posted June 18, 2013 Report Share Posted June 18, 2013 (edited) Redz ko GOF's saka par Singletone : A global variable makes an object accessible, but it doesn't keep you from instantiating multiple objects. Singletone != Registry Edited June 18, 2013 by spainis Quote Link to comment Share on other sites More sharing options...
jurchiks Posted June 19, 2013 Report Share Posted June 19, 2013 Singletone Singleton ;) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.