Note that there are some explanatory texts on larger screens.

plurals
  1. USjrs
    primarykey
    data
    text
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. CO@teresko I fully agree with what is being said. However, I fear that this principle creates a lot of difficulties for integrating libraries into exsisting applications. Imagine a simple MVC framework. When you want to call a method on the manager class, it needs to be fully initialized. You would have to instantiate on the highest level, pass the instance to a request handler, which passes it to a controller factory, which in turn passes it on to the action. But the problem is that you can't instantiate on the highest level, because this is the framework layer, which you can't alter...
      singulars
    2. COI am aware of the factory design pattern. Thanks for pointing it out though. I do like the idea of having a class to manage the one-time construction, but it does feel like a ManagerManager class would be a bit over the top.
      singulars
    3. COI have actually contemplated this before. While this would work perfectly fine within my library, I think it will make things more difficult than it has to be for developers using it. They would have to pass around my manager classes in their applications, which will bring inconveniences when trying to integrate it into existing applications. Also, the manager classes will never need multiple instances. You can argue that developers should be aware of this, and take precautions, but I feel like this is the responsibility of my library, rather than developers using it.
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload