php - Laravel Swapping interface dependancies -


i've been learning lot coding interface instead of coding concrete class. i'm wondering if following approach practice.

let's have notifier class using following structure

-app     --acme         notifiers                 - mailnotifier                              -mailnotifier.php                 - notifierinterface.php                 - notifierserviceprovider.php 

is practice if later want add different sort of notifier? text notifier example.

thank you!

yes, that's example use of interfaces. if future class has functionality can described same function names , structure go it.


Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -