Is the single_service function mis-named? |
There may be a confusing naming issue between the service() and single_service() functions.
If I'm reading the docs right (at: https://codeigniter4.github.io/userguide...-functions), the service() function effectively returns a singleton ("shared") object, while the single_service() function, somewhat counter-intuitively, returns a new object. Does anyone else find this confusing and kinda backwards? Assuming I've read the docs correctly, it would make more sense to me to change "single_service()" to "new_service()" or something that makes it clear that you're NOT getting a singleton object from the function. Either that, or maybe swap the function names around? |
Messages In This Thread |
Is the single_service function mis-named? - by AvalonSys - 12-28-2018, 03:52 PM
RE: Is the single_service function mis-named? - by donpwinston - 12-29-2018, 09:09 AM
RE: Is the single_service function mis-named? - by dave friend - 12-29-2018, 10:58 AM
|