Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuration value of the repositories / Service naming #5

Closed
lunetics opened this issue Mar 28, 2017 · 3 comments
Closed

Configuration value of the repositories / Service naming #5

lunetics opened this issue Mar 28, 2017 · 3 comments

Comments

@lunetics
Copy link
Member

I propose to use a different naming for the repositories.

Given:

prooph_event_store:
    stores:
        foo_store:
            type: 'Prooph\EventStore\InMemoryEventStore'
            repositories:
                foo_collection:
                    repository_class: 'My\Own\Repository'
                    aggregate_type: 'My\Aggregate\Type'

will create a service named '@foo_collection', which is prone to errors (no namespace etc.). Upcoming symfony versions propose or use alread the FQCN as service-id, which makes it unique.

So a new configuration could look like:

prooph_event_store:
    stores:
        foo_store:
            type: 'Prooph\EventStore\InMemoryEventStore'
            repositories:
                My\Own\Repository:                
                    aggregate_type: 'My\Aggregate\Type'

There we enforce the FQCN for once as service-id, which is at the same time the repositoryclass.

I'm not sure if we should give it as "hint" in the docs, or enforcing it by omitting the 'repository_class' key, enforcing the use of FQCN.

What are your thoughts?

@codeliner
Copy link
Member

I would not force it, but suggest it in the docs. F.e. I prefer to have a UserCollection or UserRepository interface and use that as service id instead of the concrete implementation.

@UFOMelkor
Copy link
Member

AFAIK are FQCN as service ids not yet widely used. Therefore forcing it would IMHO be hard and an unnecessary hurdle.
But I have nothing against making the repository_class optional. Less necessary configuration is (mostly) good :-)

@UFOMelkor
Copy link
Member

Implemented in #32

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants