Best structure for application and ioc container on laravel 4
Hi guys i have some question about what is better. If make a abstract
class named CompanyRepository wich have methods related with database as
duplicate company and stuff like this, then extend this class on
EloquentCompanyRepository or conversely EloquentCompanyRepository is a
abstract class with have all methods from eloquent orm and extended on
CompanyRepository?.
For the ioc container i got this:
$this->app->bind('Optima\Repositories\Company\CompanyRepositoryInterface',
'Optima\Repositories\Company\EloquentCompanyRepository');
Rather this:
$this->app->bind('Optima\Repositories\Company\CompanyRepositoryInterface',
'Optima\Repositories\Company\CompanyRepository');
I think that is more extendable and structured wether CompanyRepository
extend form EloquentCompanyRepository but i really don't know if true.
I hope make me understand and thanks for the help.
No comments:
Post a Comment