Is there some example project available that showcases the best way to keep doing layer separation between domain and infrastructure when using Doctrine? #11170
Unanswered
MetalArend
asked this question in
Support Questions
Replies: 1 comment
-
As you mentioned, XML would be the way to go with that. The Doctrine docs don't mention architecture at all, but most documentation examples use attributes for convenience. If you have an issue with XML, please file a bug. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have been following the evolution of Doctrine to version 3 for many years now, as it is one of those tools that once you better understand it, just works so reliably. But over the years, it seems to become more and more difficult to be able to separate domain classes from infrastructure (doctrine) configuration. As someone who believes in the benefits of keeping things separate in bigger projects, I find it sometimes difficult to navigate the way a developer is supposed to do things correctly, while keeping it clean and separated.
There used to be a PHP driver for ORM, but that was deprecated. So the XML driver became the de facto go to, to keep the domain classes separated from the extra bits of information Doctrine needs to be able to map objects to the database. Then attributes came along. And in some sense, they seem to come with blurring the lines between layers. It is just so convenient, that somehow they have taken over completely, even when they introduce hidden dependencies in some sense, and are probably as strange to use as facades.
When working with clean domains not influenced by Doctrine, xml seems to work. It is a shame it is not possible in PHP, but at least it is not gonna be deprecated, and is here to stay. Right? But now xml needs xsd validation, and for some reason, they don't seem to work in our project. And while we are looking into what is going wrong there, I also find myself struggling with finding the reasons why this is not something other teams seem to encounter. How am I supposed to setup a clean separation between domain and infrastructure, where can I find documentation on it, which things that would help are probably not going to be deprecated soon?
Honestly, no bad word about any direction the team is taking. I understand maintaining open source is time consuming, and some things are too much work. You all work extremely hard, and I value all the efforts tremendously. I'm just asking to be able to understand why everything seems to become more and more RAD focused, and less configurable and ready for things like multi-layer architecture. Or if that feeling is just some feeling I have because I am missing some documentation that is out there that didn't yet find me. There's this middle ground in between rapidly developed applications and event sourced applications where things sometimes seem so hard to keep up without doing lots of magic and finding terrible solutions that are going to break at any second.
@alcaeus gave me the hint to post this question somewhere more long-term than the Symfony Devs slack (https://symfony-devs.slack.com/archives/C3FQPE6LE/p1705568442249269), and mentioned @greg0ire and @mpdude. Is there some direction from the Doctrine team regarding multi-layer architecture with Doctrine? Or is it something that is simply missing on the radar, because not a lot of people seem to be doing that still, but nothing more than that?
Beta Was this translation helpful? Give feedback.
All reactions