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
Going Forward? #51
Comments
|
Thank you for bringing this up, I want to chime in. We look very much forward to depenend on an official ServiceProvider PSR to provide it as public API in TYPO3. An official PSR would therefore be much appreciated. Would be great to see the TYPO3 development lead @bmack as voting member (as for the PSR-14 where he participated as well). [1] TYPO3/typo3@0cf8053 |
|
I think we should start by getting the original workgroup together. I would like to know what they think. There was a lot of time to experiment with this package, and many people could have interesting uses. Thing is, I don't know where the original list is. It's impossible to find anything in Google Groups. I was told once that it's the least bad tool for the job, but I'm fairly sure that Slack could do better. Is there a FIG Slack? :D |
|
@XedinUnknown yes there is, however I'm not sure how to join the Slack - we should ping one of the secretaries or ask on the mailing lists. |
|
I hope it's fine to share it here, the original working group was:
I'd absolutely love to drive this forward, even though for the past 3 years I had no idea how. I wanted to find a low-code approach compared to have we already have, but I just could not find a good idea on how to do it. Ideally, we also could get the well-known frameworks in the game, to come up with something that is "adoptable" broadly. |
|
We have something similar in Yii 3 so I'm interested to join the effort. |
|
Thanks a lot! I think it would be useful t tag all of them here: @dragoonis, @shochdoerfer, @mecha, @mnapoli, @moufmouf, @XedinUnknown, @weierophinney. When we decide which people will be working on this project, it would be great if we could put the workgroup members into a GH team. Like this, everyone always knows who is who, and the workgroup can be referenced as a whole. Permissions can also be managed for the whole workgroup. |
|
I saw the post in the php-fig group last night, and had a reminder to reply... and now you've tagged me! Yes, I am definitely interested in working on this! In Laminas (formerly ZF) and Mezzio (formerly Expressive), we've been introducing a concept of "config providers" that provide a combination of application configuration and dependency configuration. We've actually been able to use the former to seed more than a half-dozen DI containers, which has allowed users to mix-and-match their DI container of choice with Mezzio applications. (We still have a few areas to resolve, though, primarily around our "plugin manager" implementation in laminas-servicemanager, but that largely comes down to cutting a new major version that targets PSR-11 specifically). Count me in! |
|
Count me in too |
|
Hey @XedinUnknown ! Thanks for restarting this! I have been using this standard extensively too. In my experience, there are 3 things missing: 1. The ability to manage (ordered) list of services 2. The ability to create services dynamically based on configuration As a consequence to this choice we made, there is no way for a service provider to provide a dynamic number of services based on configuration. Let's take an example: Let's imagine you have a configuration defining several databases URL: dbs:
db1: mysql://root@localhost
db2: mysql://root:password@192.168.0.2Currently, we cannot write a ServiceProvider that will offer a "db1" and a "db2" service based on the configuration above. This is a limitation I would like to overcome.
You cannot easily declare services in "loops": a service A references a service B that references service A. Even if you use setter injection, this is impossible with Finally, I'd like to add I have been talking with framework developers in the past years. In particular, I talked about it to Nicolas Grekas from Symfony. One of its issues was that we could not ensure type safety. A service provider should in his opinion expose the type of the services it contains. Quite honestly, this is possible in container-interop/service-providers if you use reflection on the factories returned by "getServices". He actually went on to implement a Finally, if we manage to restart the project and get people involved, I see no objections to opening write access to this repository to people working on the project (maybe to the new working group?). I'll obviously wait for the approval of @mnapoli to do this (he is the one who boostraped this project actually!) container-interop is already well identified by many and if we can avoid fragmentation, that's cool. Obviously, if we come up with a completely different idea, we can test it in another project. |
|
IMO current interfaces are very specific and are suitable only for certain type of containers (Symfony, Laravel). See #52 for example. |
|
A lot of valid points are being brought up here and they range widely in use case, usage and expectations. So perhaps it would be best if we sought a thread-based communication platform, to easily compartmentalize our discussions. Otherwise I fear the discourse may become too chaotic. I haven't yet used GitHub's "Team" feature, but it seems to be focused on topics and comments. Does anyone know if it's any good? |
|
@moufmouf, good to see you in this thread! About your points:
With regard to type safety. Service definitions can be type-safe, because their return type can be hinted, meaning that it is guaranteed to return the required type. This can be used for static code analysis, making IDE integrations possible. However, I don't see how anything retrieved from That said, a certain degree of safety is achieved by having definitions look like this: [
'my_service' => function (ContainerInterface $c): MyService {
$myThing = $c->get('my_thing');
assert($myThing instanceof MyThing);
return new MyService($myThing);
},
]That way, in dev environments, PHP will let you know if the thing you are retrieving does not match your expectations - before you actually need it somewhere. This also provides hints to clever IDEs, which can sometimes also be achieved with What if, instead of having your service definition depend on just [
'my_service' => function (MyThing $myThing): MyService {
// No need for retrieval and type-checking anymore
return new MyService($myThing);
},
]There would just need to be a way to map the parameter [
'my_service' => new Factory(['my_thing'], function (MyThing $myThing): MyService {
return new MyService($myThing);
}),
]Thus, to all service definitions everything is automatically type-safe, static code analysis is possible, and so are IDE integrations. Moreover, since services now declare dependency on other services, it's possible to build a dependency graph. This is very very good, because modules may have dependencies that are satisfied by other modules. For example, a module that uses an HTTP client may declare dependency on a service The good thing is: because SP currently declares a very open I'd love to know what you guys think about all this! |
|
With regard to a communications platform that @mecha mentioned, I would love to give a shot to Github Teams, or something else! |
|
Hey all! Can I do something to help move the discussion along? Maybe explain something better? Or the other way around, summarize the above in simpler words? Show more examples? :) |
|
Can we split the discussion into multiple issues or move to a different platform? I know we all have a lot of ideas, discussing all of them in this single issue won't scale I think. |
|
I agree, and that's why I think that a different communication tool would be a good idea. I was hoping that maybe FIG members could point us to a FIG Slack or something. If not, we can just create separate issues for now. But then, what issues do we create? We would need to identify the topics first, and I hope we can do that in this initial discussion here. |
|
Hi everyone, Thanks for the ping @XedinUnknown @shochdoerfer. We can certainly use a room in the FIG slack to discuss things, however in the interest of transparency for the community then a github issue is pretty decent too (right tool right job). As it turns out I was looking at ContainerInterop (PSR-11) last night, whilst assisting someone with modernizing their framework to use PSR-11 based tool, and I came across PHP-DI, and PimpleInterop and so forth. @XedinUnknown The Of the time that's passed from launching PSR-11/ContainerInterop until now, and I'm wondering what the demand is, and what the gaps are when trying to provide a generic container standard that fits the majority of all use cases by PHP projects (yii, zend, laravel, symfony ..etc). @moufmouf expressed a few things missing, but where' the drive for that coming from? I think this is a reasonable question to ask before we go deep into solving something. From a high-level POV I'd like to know what are the challenges that ContainerInterop current faces when integrating it into projects like those mentioned above. Thanks. <3 |
|
@dragoonis, thanks for joining! The first version of our module standard used to use I really like the way SP is right now, because I think that currently it addresses all concerns that are related to providing extendable services. I don't think that containers themselves, or how they are consumed, is very much the scope of SP. For example, container cannot be compiled themselves, because their members are not enumerable. But Service Providers are, because multiple service providers can be merged into one, and then combined definitions can be enumerated and cached separately, which will save speed when the definitions have to be resolved by a container. SP also allows extensions, because the |
Just my two cents, but I'm interested in the discussion indeed and would really like to be able to read it easily 🙂. I'm currently watching the repo and getting emails when new messages are posted, this is perfect for me. By the way, thanks a lot to all of you for your work, if I think I can somehow participate in the debate I won't hesitate! |
|
By the way, another way we could expedite this is by doing a synchronous call with the workgroup members. We're all grown-ups here :) Who wants? |
|
When? |
|
I'm generally flexible, and in the CEST zone. |
|
CEST zone here too. |
|
BTW @moufmouf
Take a look at our work here, specifically |
|
Hello, friends! 👋 Gentle reminder that we don't want this discussion to go stale again :) |
|
@XedinUnknown as others noted, move it to another medium. Try enabling GitHub discussions, for example. |
|
Also we may have a call but we need agenda for it beforehand. |
|
Yes, I'm saying this too. But I'm not in charge of this. |
|
Who is? |
|
The maintainers of this package. @moufmouf, can we use something better than this issue? |
|
If delays can be avoided this way, I would be happy to create a Dhii channel in Slack/Zulip for this. |
|
Hey guys, Sorry for the delay. Let's face it, I don't have enough time to deal with container-interop/service-provider properly right now. @XedinUnknown , you are putting a lof of energy in this and I realize I have been a bottleneck so far. Finally, so far, we have been working with @mnapoli on a consensus basis (we try to discuss each issue thoroughly and merge when we all agree). Let's keep it this way! :) |
|
Oh, wonderful! Thanks, @moufmouf! |
|
Discussing potential enhancement in #53. |
|
I have followed up on #53, where you can also find a link to an initial draft PSR document. I am currently working my way through all the open issues, and will reply to all of them - I will either tag the issues (to indicate that they are still ongoing) or close them and explain why. We've opened up the Discussions tab, and I've started one discussion there, if anyone wants to participate. I will track these and try to keep things moving. I've been hard at work this weekend, and it may take me a couple of weeks to get through everything. After that, I would be very open to organizing a group call, if anyone is still interested in that. If anyone else is interested in participating, give me a shout here? 🙂 |
|
Since this thread is very old, and isn't really about one specific topic, I'm going to close this - if there's a specific topic you'd like to discuss further, please start a Discussion. Cheers and merry christmas. 🙂 |
Hi!
I have been wanting to consolidate effort and give this project another shot, because I believe that the ability to configure DI containers in an interoperable way is very useful. In fact, me and my colleague have created a modularity standard based on this ability, and on this experimental standard. It is now being used in multiple commercial project, proving its viability.
Please take a look at my article Cross-Platform Modularity in PHP, where I explain the advantages of such a modularity system, and how we have managed to achieve it. I wrote this article in an attempt to make a compelling case to support the Service Provider standard.
If the Service Provider standard doesn't make it into a PSR, it would still be great to release it, and I happen to have an organisation - @Dhii - that was created to do exactly such things. I'd be happy to maintain this standard, but of course I would much prefer if it became a PSR, or at least got official support from FIG.
So, what is the way to move forward from here? I am a member of the original workgroup tasked with devising this standard, but I have been neglecting my duties - and I'm sorry. Meanwhile this project hasn't received any traction in the recent years. How can we bring it back to life again? @moufmouf, could you kindly advise? I am also interested to hear the opinions of other workgroup members, but not sure what the best way to involve them here is.
The text was updated successfully, but these errors were encountered: