dbrekelmans/domain-driven-bundle

This package is abandoned and no longer maintained. No replacement package was suggested.

Domain driven directory structure configuration for Symfony.

Maintainers

πŸ‘ dbrekelmans

Package info

github.com/dbrekelmans/domain-driven-bundle

Type:symfony-bundle

pkg:composer/dbrekelmans/domain-driven-bundle

Statistics

Installs: 27

Dependents: 0

Suggesters: 0

Stars: 4

Open Issues: 1

1.2.1 2019-12-02 19:38 UTC

Requires

Suggests

Provides

None

Conflicts

None

Replaces

None

MIT a101b1fdef7434c1ef2181fc2e8ca5c9fd37c0b8

This package is auto-updated.

Last update: 2020-10-01 00:18:59 UTC


README

This bundle provides automatic bundle configuration for a domain driven directory structure in Symfony.

Directory structure

The default configuration for this bundle automatically configures the following directory structure:

src/
β”œβ”€β”€ <DomainContextA>/
β”‚ β”œβ”€β”€ Application
β”‚ β”œβ”€β”€ Domain
β”‚ β”‚ β”œβ”€β”€ Entity
β”‚ β”‚ β”œβ”€β”€ Event
β”‚ β”‚ β”œβ”€β”€ Factory
β”‚ β”‚ β”œβ”€β”€ Repository
β”‚ β”‚ β”œβ”€β”€ Service
β”‚ β”‚ └── ValueObject
β”‚ β”œβ”€β”€ Infrastructure
β”‚ β”‚ └── config
β”‚ β”‚ β”‚ β”œβ”€β”€ routes.yaml
β”‚ β”‚ β”‚ └── services.yaml
β”‚ └── Presentation
└── <DomainContextB>/
 └── ...

Installation

Install the bundle with composer: composer require dbrekelmans/domain-driven-bundle.

Routing

Bundle defined routing is never automatically imported in symfony. To automatically import the routing configuration from your context directories, add the following to config/routes.yaml:

framework:
 resource: '@DomainDrivenBundle/Resources/config/routes.yaml'

Configuration

This bundle works out of the box with the directory structure as detailed above. You can configure the directory names and locations in your symfony application in config/packages/domain_driven.yaml.

The default configuration is as follows:

domain_driven:
 directories:
 context: '%kernel.project_dir%/src'
 application: 'Application'
 domain: 'Domain'
 infrastructure: 'Infrastructure'
 presentation: 'Presentation'
 config: 'config'
 files:
 routes: 'routes'
 services: 'services'

Supported bundles

symfony/framework-bundle

Services

Service configuration files are automatically loaded from domain_driven.directories.context/*/domain_driven.directories.infrastructure/domain_driven.directories.config/domain_driven.files.services.{yaml,yml,xml,php}.

Routing

Routing configuration files are automatically loaded from domain_driven.directories.context/*/domain_driven.directories.infrastructure/domain_driven.directories.config/domain_driven.files.routes.{yaml,yml,xml,php}.

symfony/twig-bundle

Templates

Template files are automatically configured in domain_driven.directories.context/*/domain_driven.directories.presentation/domain_driven.directories.template.

Roadmap

Additional bundles support

  • symfony/framework (symfony/translation)
  • doctrine/doctrine-migrations-bundle

Maker command

Console command to create a new context skeleton based on your config. With default configuration will result in the directory structure as detailed above.