"value":"\n <p>I recently watched <a href=\"https:\/\/www.youtube.com\/watch?v=DuozyaJQQ1U\">a video about separating logic<\/a> into different categories within your custom code.<\/p>\n\n<p>It wasn't a PHP video, but the concept applies to any programming language or framework.<\/p>\n\n<p>This was the final structure of the directories:<\/p>\n\n<pre><code class=\"plain\">src\/\n Controllers\/\n Domain\/\n Persistence\/\n Properties\/\n Services\/\n<\/code><\/pre>\n\n<p>It was described as using <code>Controllers<\/code> for presentational logic, <code>Domain<\/code> for domain logic, and <code>Services<\/code> for application logic, and reminds me of a domain-driven design (DDD) approach to organising code.<\/p>\n\n<p>I remember watching other older videos showing separating business and presentational logic in React into different components (if I remember correctly).<\/p>\n\n<p>This isn't an approach I see in Drupal code, maybe more-so in other PHP framework-based projects like Symfony or Laravel.<\/p>\n\n<p>It's something I've been thinking of trying, potentially on my website codebase.<\/p>\n\n<p>Do you organise your code in this or a similar way?<\/p>\n\n<p>If so, why?<\/p>\n\n<p>What advantages does it bring?<\/p>\n\n ",
"format":"full_html",
"processed":"\n <p>I recently watched <a href=\"https:\/\/www.youtube.com\/watch?v=DuozyaJQQ1U\">a video about separating logic<\/a> into different categories within your custom code.<\/p>\n\n<p>It wasn't a PHP video, but the concept applies to any programming language or framework.<\/p>\n\n<p>This was the final structure of the directories:<\/p>\n\n<pre><code class=\"plain\">src\/\n Controllers\/\n Domain\/\n Persistence\/\n Properties\/\n Services\/\n<\/code><\/pre>\n\n<p>It was described as using <code>Controllers<\/code> for presentational logic, <code>Domain<\/code> for domain logic, and <code>Services<\/code> for application logic, and reminds me of a domain-driven design (DDD) approach to organising code.<\/p>\n\n<p>I remember watching other older videos showing separating business and presentational logic in React into different components (if I remember correctly).<\/p>\n\n<p>This isn't an approach I see in Drupal code, maybe more-so in other PHP framework-based projects like Symfony or Laravel.<\/p>\n\n<p>It's something I've been thinking of trying, potentially on my website codebase.<\/p>\n\n<p>Do you organise your code in this or a similar way?<\/p>\n\n<p>If so, why?<\/p>\n\n<p>What advantages does it bring?<\/p>\n\n ",