jeudi 11 août 2016

Is correct bind concrete implementations?

I'm using Laravel 5.2 to build an abstract system. When a customer needs some specific implementation, I need to override some parts of the code.

What I'm thinking is something like this scenario:

A Controller depends on some custom Request (concrete) by default. When a customer asks me another business rule, I'd have to extend this custom Request and bind this child implementation to the parent. Do something like this on my Provider:

$this->app->bind(ParentImpl::class, ChildImpl::class);

Talking about software architecture concepts, can I do it? Is it correct?

Aucun commentaire:

Enregistrer un commentaire