Skoop (Stefan Koopmanschap) on Nostr: I don't see another option to be honest. If you need to reference it and you can't do ...
I don't see another option to be honest. If you need to reference it and you can't do it dynamically, then there is no other option and I'd prefer the ::class over strings.
The only thing I could think of is to invert the coupling. So define the interface in your "local" code and make the implementing class that should not be depending upon implement the interface (talking about different domains or bounded contexts). If possible. And if it makes sense.
Published at
2024-04-10 14:13:11Event JSON
{
"id": "8d062f86174f2c65b47ab6b2399bceb2adf14ee792298f8e101094d84852f948",
"pubkey": "21e10fd7aad569b119196ddbc39adc1537f130256acab7381070e48e0114f206",
"created_at": 1712758391,
"kind": 1,
"tags": [
[
"e",
"cdbb45c64c735142fa63e4de2bc4d1f5125e74433d8860666a8d42c5b48d3d25",
"",
"root"
],
[
"p",
"21e10fd7aad569b119196ddbc39adc1537f130256acab7381070e48e0114f206"
],
[
"e",
"7984e2fd2bf61ad1ef1922f16083bcb7ad4c76c6374c6577e044446642274c06",
"",
"reply"
],
[
"p",
"1021c34f5340dbb740c0814437248fd3859b28145884ed2eeca94f93af3f88f7"
],
[
"proxy",
"https://phpc.social/users/Skoop/statuses/112247333954295776",
"activitypub"
],
[
"L",
"pink.momostr"
],
[
"l",
"pink.momostr.activitypub:https://phpc.social/users/Skoop/statuses/112247333954295776",
"pink.momostr"
]
],
"content": "I don't see another option to be honest. If you need to reference it and you can't do it dynamically, then there is no other option and I'd prefer the ::class over strings. \n\nThe only thing I could think of is to invert the coupling. So define the interface in your \"local\" code and make the implementing class that should not be depending upon implement the interface (talking about different domains or bounded contexts). If possible. And if it makes sense.",
"sig": "6ba4eebf9580e16597d464b762a0707d76e59fcd7a2a567c7b88a58779aee20e07cfe0a525dd6ce4253d22793aff2a2313ca1a265cc6cb2993a875c82c898fec"
}