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

Services #33

Open
drewroberts opened this issue Feb 9, 2021 · 3 comments
Open

Services #33

drewroberts opened this issue Feb 9, 2021 · 3 comments
Assignees

Comments

@drewroberts
Copy link
Member

Need to add all the available services in the packages to the app container.

@pdbreen
Copy link
Contributor

pdbreen commented Feb 9, 2021

This should be service contracts and model interface contracts only (very basic Contract\Models\UserInterface already added to facilitate moving policies to packages). Actually service code cannot live in this repo since it has dependencies that are not resolvable here.

Later today, I plan on getting the contracts for DiscountsService, VouchersService and a revamped CheckoutsService added here to Contracts\Services.

edit:
As a result, binding of the contracts to their implementation (ie, container registration) can't happen here.

@sl0wik
Copy link
Contributor

sl0wik commented Feb 9, 2021

@pdbreen: It's about adding an alias to the service containers the same way we did with models. We could do it from the package level as well. I guess doing it from here would hive us one place with all services map.

@pdbreen
Copy link
Contributor

pdbreen commented Feb 9, 2021

What I'm pushing at is we really need to figure out how (or maybe even if) we are truly going to solve cross package boundary issues. Code like this:

app('booking')->someMethod(...);
app('customer)->magic_property = 4;

will only work when those packages are installed which makes it completely untestable within a package. We had to create the model aliases because we have existing migrations that require external models. But for that usage, we can (and do) create dummy classes on the fly that allow the migrations to work. But, those dummy classes can't be used in the real code -- meaning, you can't really do this app('review')->something.

Again, this all assumes we want to be strict on package boundaries and what is/isn't available for use within a packages implementation AND we want to be able to fully test our packages. There's some more info in the group chat for discussion.

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