/DDDMakerBundleExample

A Symfony Bundle to easily create DDD elements from your console

Primary LanguagePHP

DDDMakerBundle

A Symfony Bundle to easily create DDD elements from your console

This project is currently under development.

Current state: This project is a Symfony Bundle. However, because it's still a work in progress, a full Symfony 5 app is being used to ease development process. While it's under development, bundle's code will reside in lib/DDDMakerBundle/ directory. Once it's finished code will be released and published to packagist as a full, independent Symfony Bundle.

Goal

Normally, when you work with Hexagonal Architecture or other clean architectures, specially if working under a DDD approach, there's little room for "creativity". Because all the layers are well-defined, often times you find yourself copy-pasting classes (i.e., commands, queries, event subscribers, value objects...) from one context to another just to have a skeleton for the new class.

So, what if this copy-paste work could be automated? With DDDMakerBundle, you'll be able to create DDD elements from your console, just like Symfony does through the Maker Bundle.

For now, these are the elements that will be able to be created through this bundle:

  • Bounded context (ddd:make:bounded-context) 🔲

  • CQS/CQRS

    • Command (ddd:cqs:make:command) ✔️
    • CommandHandler (ddd:cqs:make:command-handler) ✔️
    • Query (ddd:cqs:make:query) ✔️
    • QueryHandler (ddd:cqs:make:query-handler) ✔️
    • Response (ddd:cqs:make:response) ✔️
  • Domain

    • Event (ddd:domain:make:event) ✔️
    • Value Object (ddd:domain:make:value-object) ✔️
  • Application

    • EventSubscriber (ddd:application:make:event-subscriber) ✔️
    • UseCase (ddd:application:make:use-case) ✔️
  • Other

    • Command to generate missing directories that are specified in config (ddd:make:missing-directories) ✔️
  • List

    • Bounded (contexs ddd:list:bounded-contexts) 🔲
    • Commands (ddd:cqs:list:commands) 🔲
    • CommandHandlers (ddd:cqs:list:command-handlers) 🔲
    • Queries (ddd:cqs:list:queries) 🔲
    • QueryHandler (ddd:cqs:list:query-handlers) 🔲
    • Events (ddd:domain:list:events) 🔲
    • EventSubscribers (ddd:application:list:event-subscribers) 🔲
    • UseCases (ddd:cqs:list:use-cases) 🔲

⏳ Someone is already working on this

🔲 To do

✔️ Done

Contributing

As you might have noticed, there are a lot of console commands to implement, so any help will be very welcome! If you want to contribute, just reach out opening an issue commenting the work you'd like to do so maybe I can give you some help!