php - Underlying patterns between Laravel Facade, Laravel containers, and Magento getSingleton -


i new laravel , far oop realize have learn. come magento background 1 of these:

$bar = mage::getmodel('foo/bar'); $bar2= mage::getsingleton('foo/bar'); $bar3= mage::getsingleton('foo/bar');  //bar3 same instance bar2 

with obvious difference being getsingleton prevents multiple instantiation of same class.

in laravel, notice lot of static class calls route::get(..). told static class calls avoided due testability issues.

on other hand, there post: laravel: difference app::bind , app::singleton in so. however, using ->bind('foo') , ->singleton('foo') not static class calls! bind() , singleton() in way related facade? can singleton concept implemented in someclass::somemethod() calls?

bottom line, underlying logic here beginner intermediate coder, , there ever case calling someclass::somemethod() not static call, , singleton? thanks!


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -