-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Poll: needed features #9
Comments
I think "Ability to compile all container entries into a single container for maximum performance." should be ++, since this is absolutely needed to be compatible with compiled containers. |
I don't see how it's absolutely needed? The only benefit I see is for performances, but compiled containers can work fine with "service providers" (for example of non-compilable definitions): the compiled container can call factories that will handle creating the objects. Example: class TwigServiceProvider implements ServiceProvider
{
public function getExposedServices()
{
return [
'twig' => 'createTwig',
];
}
public function createTwig(ContainerInterface $c)
{
return Twig_Environment($c->get(...), ...);
}
} That means the compiled container will call |
You're right, good point! |
Here is my take then. Not much different from you @moufmouf.
|
I realized that there is maybe something missing in the poll. Maybe we should ask whether the standard we design should focus on simplicity (KISS principle) or performance in case we have to do a trade-off. Because as I see things, we are going to have to do some choices. Using the example from @mnapoli : class TwigServiceProvider implements ServiceProvider
{
public function getExposedServices()
{
return [
'twig' => 'createTwig',
];
}
public function createTwig(ContainerInterface $c)
{
return Twig_Environment($c->get(...), ...);
}
} A compiled container would have to call the Please note I don't have any preference regarding this issue. My mind is definitely not made up in this topic. Another "feature" maybe missing is the ability to directly debug the code (as you can put a breakpoint in a service provider), but it is really harder in a YML/XML configuration file. |
Agreed, but is that really significant? I don't have enough expertise in writing frameworks to answer honestly… We also have to consider that it only applies for entries defined in modules: do they represent 20%, 50% or 80% of all definitions in an application?
+1 this is nice to have. |
@abachmann, I assume you are talking about This issue refers to service providers (e.g. another PSR that is not yet in draft). |
Now that we listed all possible features we could think of, let's rank these features!
Here is my personal take on it. I'm opening this issue so we can discuss on it. Maybe we can summarize this in the META or in a GIST later. If you have a better idea, let me know.
Everybody wanting to give a rating is welcome!
The text was updated successfully, but these errors were encountered: