gacela-project / gacela

Gacela helps you separate your project into modules, focusing on the infrastructure or application layer decoupled from your domain.

Home Page:http://gacela-project.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Make the Facade accesible from module-internal subfolders

Chemaclass opened this issue · comments

In the context of a module, allow the auto-wiring of the Facade of the module on a specific/custom folder.

Consider the following example. Given these two classes:

App\MyModule\MyModuleFacade;
App\MyModule\Command\HelloCommand;

The class HelloCommand should have access to the MyModuleFacade using getFacade().

Until now, we construct these classes in the Factory, where we inject the Facade on it, but this is a bit odd. And it doesn't feel right. The reason is that the Command belongs to the infrastructure layer, therefore I should be able to talk to the Facade directly using Gacela's auto-wiring.