Upgrade to Pro — share decks privately, control downloads, hide ads and more …

リンケージにおけるアプリケーションコードとの付き合い方とそれを支えるコミュニケーション / drobe_pixiv_linkage-20230905

リンケージにおけるアプリケーションコードとの付き合い方とそれを支えるコミュニケーション / drobe_pixiv_linkage-20230905

DROBE Engineer Night #5 質とスピードを追求する開発チームでの取り組みの登壇資料です。

https://drobe.connpass.com/event/292061/

blue_goheimochi

September 05, 2023
Tweet

More Decks by blue_goheimochi

Other Decks in Technology

Transcript

  1. 13 Laravel class Register { public function __construct( private readonly

    Mailer $mailer, ) {} public function create(string $name): void { // 何らか登録などする処理 // メールの送信 $this->mailer->send(new SayHello($name)); } } app/Services/Register.php
  2. 14 Laravel class Register { public function __construct( private readonly

    Mailer $mailer, ) {} public function create(string $name): void { // 何らか登録などする処理 // メールの送信 $this->mailer->send(new SayHello($name)); } } Mailer app/Services/Register.php
  3. 15 Laravel class Register { public function __construct( private readonly

    Mailer $mailer, ) {} public function create(string $name): void { // 何らか登録などする処理 // メールの送信 $this->mailer->send(new SayHello($name)); } } Mailer Laravel app/Services/Register.php
  4. 16 class Register { public function __construct( private readonly SayHelloSenderInterface

    $sender, ) {} public function create(string $name): void { // 何らか登録などする処理 // メールの送信 $this->sender>send($name); } } lib/User/Register.php Laravel class SayHelloSenderInterface { public function send(string $name): void } lib/Mail/SayHelloSenderInterface.php
  5. 17 class Register { public function __construct( private readonly SayHelloSenderInterface

    $sender, ) {} public function create(string $name): void { // 何らか登録などする処理 // メールの送信 $this->sender>send($name); } } Laravel class SayHelloSenderInterface { public function send(string $name): void } Interface Mailer lib/User/Register.php lib/Mail/SayHelloSenderInterface.php
  6. 18 Laravel class SayHelloConcrete implements SayHelloSenderInterface { public function __construct(

    private readonly Mailer $mailer, ) {} public function send(string $name): void { // メールの送信 $this->mailer->send(new SayHello($name)); } } app/Mail/SayHelloConcrete.php class SayHelloSenderInterface { public array $bindings = [ ¥Package¥Mail¥SayHelloInterface::class => ¥App¥Services¥SayHelloConclete::class, ]; } app/Providers/AppServiceProvider.php
  7. 19 Laravel class SayHelloConcrete implements SayHelloSenderInterface { public function __construct(

    private readonly Mailer $mailer, ) {} public function send(string $name): void { // メールの送信 $this->mailer->send(new SayHello($name)); } } class SayHelloSenderInterface { public array $bindings = [ ¥Package¥Mail¥SayHelloInterface::class => ¥App¥Services¥SayHelloConclete::class, ]; } Laravel app ServiceProvider Interface app/Mail/SayHelloConcrete.php app/Providers/AppServiceProvider.php