Slide 1

Slide 1 text

No content

Slide 2

Slide 2 text

No content

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

他に頼って存在、または生活すること。 デジタル大辞泉

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

No content

Slide 7

Slide 7 text

No content

Slide 8

Slide 8 text

No content

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

No content

Slide 12

Slide 12 text

No content

Slide 13

Slide 13 text

No content

Slide 14

Slide 14 text

No content

Slide 15

Slide 15 text

$msg = "hello"; var_dump($msg);

Slide 16

Slide 16 text

class Foo { public function greet() { echo "hello"; } } $foo = new Foo(); $foo->greet();

Slide 17

Slide 17 text

class Foo { private readonly Bar $bar; public function __construct(Bar $bar) { $this->bar = $bar; } public function greet() { echo "hello " . $this->bar->getName(); } } class Bar { private readonly string $name; public function __construct(string $name) { $this->name = $name; } public function getName(): string { return $this->name; } } $bar = new Bar("nrs"); $foo = new Foo($bar); $foo->greet();

Slide 18

Slide 18 text

class Foo { private readonly Bar $bar; public function __construct(Bar $bar) { $this->bar = $bar; } public function greet() { echo "hello " . $this->bar->getName(); } } class Bar { private readonly string $name; public function __construct(string $name) { $this->name = $name; } public function getName(): string { return $this->name; } } $bar = new Bar("nrs"); $foo = new Foo($bar); $foo->greet();

Slide 19

Slide 19 text

class Foo { private readonly Bar $bar; public function __construct(Bar $bar) { $this->bar = $bar; } public function greet() { echo "hello " . $this->bar->getName(); } } class Bar { private readonly string $name; public function __construct(string $name) { $this->name = $name; } public function getName(): string { return $this->name; } } $bar = new Bar("nrs"); $foo = new Foo($bar); $foo->greet();

Slide 20

Slide 20 text

class Foo { private readonly Bar $bar; public function __construct(Bar $bar) { $this->bar = $bar; } public function greet() { echo "hello " . $this->bar->getName(); } } class Bar { private readonly string $name; public function __construct(string $name) { $this->name = $name; } public function getName(): string { return $this->name; } } $bar = new Bar("nrs"); $foo = new Foo($bar); $foo->greet();

Slide 21

Slide 21 text

class Foo { private readonly Bar $bar; public function __construct(Bar $bar) { $this->bar = $bar; } public function greet() { echo "hello " . $this->bar->getName(); } } class Bar { private readonly string $name; public function __construct(string $name) { $this->name = $name; } public function getName(): string { return $this->name; } } $bar = new Bar("nrs"); $foo = new Foo($bar); $foo->greet();

Slide 22

Slide 22 text

class Foo { private readonly Bar $bar; public function __construct(Bar $bar) { $this->bar = $bar; } public function greet() { echo "hello " . $this->bar->getName(); } } class Bar { private readonly string $name; public function __construct(string $name) { $this->name = $name; } public function getName(): string { return $this->name; } } $bar = new Bar("nrs"); $foo = new Foo($bar); $foo->greet();

Slide 23

Slide 23 text

class Foo { private readonly Bar $bar; public function __construct(Bar $bar) { $this->bar = $bar; } public function greet() { echo "hello " . $this->bar->getName(); } } class Bar { private readonly string $name; public function __construct(string $name) { $this->name = $name; } public function getName(): string { return $this->name; } }

Slide 24

Slide 24 text

class Foo { private readonly Bar $bar; public function __construct(Bar $bar) { $this->bar = $bar; } public function greet() { echo "hello " . $this->bar->getName(); } } class Bar { private readonly string $name; public function __construct(string $name) { $this->name = $name; } public function getName(): string { return $this->name; } }

Slide 25

Slide 25 text

class Foo { private readonly Bar $bar; public function __construct(Bar $bar) { $this->bar = $bar; } public function greet() { echo "hello " . $this->bar->getName(); } } class Bar { private readonly string $name; public function __construct(string $name) { $this->name = $name; } public function getName(): string { return $this->name; } }

Slide 26

Slide 26 text

class Foo { private readonly Bar $bar; public function __construct(Bar $bar) { $this->bar = $bar; } public function greet() { echo "hello " . $this->bar->getName(); } } class Bar { private readonly string $name; public function __construct(string $name) { $this->name = $name; } public function getName(): string { return $this->name; } }

Slide 27

Slide 27 text

No content

Slide 28

Slide 28 text

class UserCreateInteractor implements UserCreateUseCaseInterface { /** * @param UserCreateRequest $request * @return UserCreateResponse */ public function handle(UserCreateRequest $request): UserCreateResponse { $userId = new UserId(uniqid()); $user = new User($userId, $request->getName()); DB::table('users') ->updateOrInsert( ['id' => $user->getId()], ['name' => $user->getName()] ); return new UserCreateResponse($userId->getValue()); } } use Illuminate¥Support¥Facades¥DB;

Slide 29

Slide 29 text

class UserCreateInteractor implements UserCreateUseCaseInterface { /** * @param UserCreateRequest $request * @return UserCreateResponse */ public function handle(UserCreateRequest $request): UserCreateResponse { $userId = new UserId(uniqid()); $user = new User($userId, $request->getName()); DB::table('users') ->updateOrInsert( ['id' => $user->getId()], ['name' => $user->getName()] ); return new UserCreateResponse($userId->getValue()); } } use Illuminate¥Support¥Facades¥DB;

Slide 30

Slide 30 text

class UserCreateInteractor implements UserCreateUseCaseInterface { /** * @param UserCreateRequest $request * @return UserCreateResponse */ public function handle(UserCreateRequest $request): UserCreateResponse { $userId = new UserId(uniqid()); $user = new User($userId, $request->getName()); DB::table('users') ->updateOrInsert( ['id' => $user->getId()], ['name' => $user->getName()] ); return new UserCreateResponse($userId->getValue()); } } use Illuminate¥Support¥Facades¥DB;

Slide 31

Slide 31 text

class UserCreateInteractor implements UserCreateUseCaseInterface { /** * @param UserCreateRequest $request * @return UserCreateResponse */ public function handle(UserCreateRequest $request): UserCreateResponse { $userId = new UserId(uniqid()); $user = new User($userId, $request->getName()); DB::table('users') ->updateOrInsert( ['id' => $user->getId()], ['name' => $user->getName()] ); return new UserCreateResponse($userId->getValue()); } } use Illuminate¥Support¥Facades¥DB;

Slide 32

Slide 32 text

class UserCreateInteractor implements UserCreateUseCaseInterface { /** * @param UserCreateRequest $request * @return UserCreateResponse */ public function handle(UserCreateRequest $request): UserCreateResponse { $userId = new UserId(uniqid()); $user = new User($userId, $request->getName()); DB::table('users') ->updateOrInsert( ['id' => $user->getId()], ['name' => $user->getName()] ); return new UserCreateResponse($userId->getValue()); } } use Illuminate¥Support¥Facades¥DB;

Slide 33

Slide 33 text

class UserCreateInteractor implements UserCreateUseCaseInterface { /** * @param UserCreateRequest $request * @return UserCreateResponse */ public function handle(UserCreateRequest $request): UserCreateResponse { $userId = new UserId(uniqid()); $user = new User($userId, $request->getName()); DB::table('users') ->updateOrInsert( ['id' => $user->getId()], ['name' => $user->getName()] ); return new UserCreateResponse($userId->getValue()); } } use Illuminate¥Support¥Facades¥DB;

Slide 34

Slide 34 text

class UserCreateInteractor implements UserCreateUseCaseInterface { /** * @param UserCreateRequest $request * @return UserCreateResponse */ public function handle(UserCreateRequest $request): UserCreateResponse { $userId = new UserId(uniqid()); $user = new User($userId, $request->getName()); DB::table('users') ->updateOrInsert( ['id' => $user->getId()], ['name' => $user->getName()] ); return new UserCreateResponse($userId->getValue()); } } use Illuminate¥Support¥Facades¥DB;

Slide 35

Slide 35 text

class UserCreateInteractor implements UserCreateUseCaseInterface { /** * @param UserCreateRequest $request * @return UserCreateResponse */ public function handle(UserCreateRequest $request): UserCreateResponse { $userId = new UserId(uniqid()); $user = new User($userId, $request->getName()); DB::table('users') ->updateOrInsert( ['id' => $user->getId()], ['name' => $user->getName()] ); return new UserCreateResponse($userId->getValue()); } } use Illuminate¥Support¥Facades¥DB;

Slide 36

Slide 36 text

class UserCreateInteractor implements UserCreateUseCaseInterface { /** * @param UserCreateRequest $request * @return UserCreateResponse */ public function handle(UserCreateRequest $request): UserCreateResponse { $userId = new UserId(uniqid()); $user = new User($userId, $request->getName()); DB::table('users') ->updateOrInsert( ['id' => $user->getId()], ['name' => $user->getName()] ); return new UserCreateResponse($userId->getValue()); } } use Illuminate¥Support¥Facades¥DB;

Slide 37

Slide 37 text

class UserCreateInteractor implements UserCreateUseCaseInterface { /** * @param UserCreateRequest $request * @return UserCreateResponse */ public function handle(UserCreateRequest $request): UserCreateResponse { $userId = new UserId(uniqid()); $user = new User($userId, $request->getName()); DB::table('users') ->updateOrInsert( ['id' => $user->getId()], ['name' => $user->getName()] ); return new UserCreateResponse($userId->getValue()); } } use Illuminate¥Support¥Facades¥DB;

Slide 38

Slide 38 text

No content

Slide 39

Slide 39 text

No content

Slide 40

Slide 40 text

No content

Slide 41

Slide 41 text

class UserCreateInteractor implements UserCreateUseCaseInterface { /** * @param UserCreateRequest $request * @return UserCreateResponse */ public function handle(UserCreateRequest $request): UserCreateResponse { $userId = new UserId(uniqid()); $user = new User($userId, $request->getName()); DB::table('users') ->updateOrInsert( ['id' => $user->getId()], ['name' => $user->getName()] ); return new UserCreateResponse($userId->getValue()); } } use Illuminate¥Support¥Facades¥DB;

Slide 42

Slide 42 text

class UserCreateInteractor implements UserCreateUseCaseInterface { /** * @param UserCreateRequest $request * @return UserCreateResponse */ public function handle(UserCreateRequest $request): UserCreateResponse { $userId = new UserId(uniqid()); $user = new User($userId, $request->getName()); DB::table('users') ->updateOrInsert( ['id' => $user->getId()], ['name' => $user->getName()] ); return new UserCreateResponse($userId->getValue()); } } use Illuminate¥Support¥Facades¥DB;

Slide 43

Slide 43 text

No content

Slide 44

Slide 44 text

No content

Slide 45

Slide 45 text

No content

Slide 46

Slide 46 text

No content

Slide 47

Slide 47 text

No content

Slide 48

Slide 48 text

No content

Slide 49

Slide 49 text

class UserCreateInteractor implements UserCreateUseCaseInterface { /** * @param UserCreateRequest $request * @return UserCreateResponse */ public function handle(UserCreateRequest $request): UserCreateResponse { $userId = new UserId(uniqid()); $user = new User($userId, $request->getName()); DB::table('users') ->updateOrInsert( ['id' => $user->getId()], ['name' => $user->getName()] ); return new UserCreateResponse($userId->getValue()); } } use Illuminate¥Support¥Facades¥DB;

Slide 50

Slide 50 text

class UserCreateInteractor implements UserCreateUseCaseInterface { /** * @param UserCreateRequest $request * @return UserCreateResponse */ public function handle(UserCreateRequest $request): UserCreateResponse { $userId = new UserId(uniqid()); $user = new User($userId, $request->getName()); DB::table('users') ->updateOrInsert( ['id' => $user->getId()], ['name' => $user->getName()] ); return new UserCreateResponse($userId->getValue()); } } use Illuminate¥Support¥Facades¥DB;

Slide 51

Slide 51 text

class UserCreateInteractor implements UserCreateUseCaseInterface { /** * @param UserCreateRequest $request * @return UserCreateResponse */ public function handle(UserCreateRequest $request): UserCreateResponse { $userId = new UserId(uniqid()); $user = new User($userId, $request->getName()); DB::table('users') ->updateOrInsert( ['id' => $user->getId()], ['name' => $user->getName()] ); return new UserCreateResponse($userId->getValue()); } } use Illuminate¥Support¥Facades¥DB;

Slide 52

Slide 52 text

class UserCreateInteractor implements UserCreateUseCaseInterface { /** * @param UserCreateRequest $request * @return UserCreateResponse */ public function handle(UserCreateRequest $request): UserCreateResponse { $userId = new UserId(uniqid()); $user = new User($userId, $request->getName()); DB::table('users') ->updateOrInsert( ['id' => $user->getId()], ['name' => $user->getName()] ); return new UserCreateResponse($userId->getValue()); } } use Illuminate¥Support¥Facades¥DB;

Slide 53

Slide 53 text

No content

Slide 54

Slide 54 text

No content

Slide 55

Slide 55 text

No content

Slide 56

Slide 56 text

No content

Slide 57

Slide 57 text

No content

Slide 58

Slide 58 text

No content

Slide 59

Slide 59 text

No content

Slide 60

Slide 60 text

No content

Slide 61

Slide 61 text

No content

Slide 62

Slide 62 text

No content

Slide 63

Slide 63 text

No content

Slide 64

Slide 64 text

No content

Slide 65

Slide 65 text

No content

Slide 66

Slide 66 text

No content

Slide 67

Slide 67 text

No content

Slide 68

Slide 68 text

class QueryBuilderUserRepository { public function save(User $user) { DB::table('users') ->updateOrInsert( ['id' => $user->getId()], ['name' => $user->getName()] ); } }

Slide 69

Slide 69 text

class UserCreateInteractor implements UserCreateUseCaseInterface { private $userRepository; public function __construct(QueryBuilderUserRepository $userRepository) { $this->userRepository = $userRepository; } public function handle(UserCreateRequest $request): UserCreateResponse { $userId = new UserId(uniqid()); $user = new User($userId, $request->getName()); $this->userRepository->save($user); return new UserCreateResponse($userId->getValue()); } }

Slide 70

Slide 70 text

class UserCreateInteractor implements UserCreateUseCaseInterface { private $userRepository; public function __construct(QueryBuilderUserRepository $userRepository) { $this->userRepository = $userRepository; } public function handle(UserCreateRequest $request): UserCreateResponse { $userId = new UserId(uniqid()); $user = new User($userId, $request->getName()); $this->userRepository->save($user); return new UserCreateResponse($userId->getValue()); } }

Slide 71

Slide 71 text

No content

Slide 72

Slide 72 text

No content

Slide 73

Slide 73 text

interface UserRepositoryInterface { public function save(User $user); }

Slide 74

Slide 74 text

No content

Slide 75

Slide 75 text

No content

Slide 76

Slide 76 text

class QueryBuilderUserRepository { public function save(User $user) { DB::table('users') ->updateOrInsert( ['id' => $user->getId()], ['name' => $user->getName()] ); } }

Slide 77

Slide 77 text

class QueryBuilderUserRepository implements UserRepositoryInterface { public function save(User $user) { DB::table('users') ->updateOrInsert( ['id' => $user->getId()], ['name' => $user->getName()] ); } }

Slide 78

Slide 78 text

No content

Slide 79

Slide 79 text

No content

Slide 80

Slide 80 text

class UserCreateInteractor implements UserCreateUseCaseInterface { private $userRepository; public function __construct(QueryBuilderUserRepository $userRepository) { $this->userRepository = $userRepository; } public function handle(UserCreateRequest $request): UserCreateResponse { $userId = new UserId(uniqid()); $user = new User($userId, $request->getName()); $this->userRepository->save($user); return new UserCreateResponse($userId->getValue()); } }

Slide 81

Slide 81 text

class UserCreateInteractor implements UserCreateUseCaseInterface { private $userRepository; public function __construct(QueryBuilderUserRepository $userRepository) { $this->userRepository = $userRepository; } public function handle(UserCreateRequest $request): UserCreateResponse { $userId = new UserId(uniqid()); $user = new User($userId, $request->getName()); $this->userRepository->save($user); return new UserCreateResponse($userId->getValue()); } }

Slide 82

Slide 82 text

class UserCreateInteractor implements UserCreateUseCaseInterface { private $userRepository; public function __construct(UserRepositoryInterface $userRepository) { $this->userRepository = $userRepository; } public function handle(UserCreateRequest $request): UserCreateResponse { $userId = new UserId(uniqid()); $user = new User($userId, $request->getName()); $this->userRepository->save($user); return new UserCreateResponse($userId->getValue()); } }

Slide 83

Slide 83 text

class UserCreateInteractor implements UserCreateUseCaseInterface { private $userRepository; public function __construct(UserRepositoryInterface $userRepository) { $this->userRepository = $userRepository; } public function handle(UserCreateRequest $request): UserCreateResponse { $userId = new UserId(uniqid()); $user = new User($userId, $request->getName()); $this->userRepository->save($user); return new UserCreateResponse($userId->getValue()); } }

Slide 84

Slide 84 text

No content

Slide 85

Slide 85 text

No content

Slide 86

Slide 86 text

No content

Slide 87

Slide 87 text

No content

Slide 88

Slide 88 text

No content

Slide 89

Slide 89 text

No content

Slide 90

Slide 90 text

class UserCreateInteractor implements UserCreateUseCaseInterface { private $userRepository; public function __construct(QueryBuilderUserRepository $userRepository) { $this->userRepository = $userRepository; } public function handle(UserCreateRequest $request): UserCreateResponse { $userId = new UserId(uniqid()); $user = new User($userId, $request->getName()); $this->userRepository->save($user); return new UserCreateResponse($userId->getValue()); } }

Slide 91

Slide 91 text

class UserCreateInteractor implements UserCreateUseCaseInterface { private $userRepository; public function __construct(QueryBuilderUserRepository $userRepository) { $this->userRepository = $userRepository; } public function handle(UserCreateRequest $request): UserCreateResponse { $userId = new UserId(uniqid()); $user = new User($userId, $request->getName()); $this->userRepository->save($user); return new UserCreateResponse($userId->getValue()); } }

Slide 92

Slide 92 text

class UserCreateInteractor implements UserCreateUseCaseInterface { private $userRepository; public function __construct(QueryBuilderUserRepository $userRepository) { $this->userRepository = $userRepository; } public function handle(UserCreateRequest $request): UserCreateResponse { $userId = new UserId(uniqid()); $user = new User($userId, $request->getName()); $this->userRepository->save($user); return new UserCreateResponse($userId->getValue()); } }

Slide 93

Slide 93 text

No content

Slide 94

Slide 94 text

No content

Slide 95

Slide 95 text

No content

Slide 96

Slide 96 text

No content

Slide 97

Slide 97 text

No content

Slide 98

Slide 98 text

class QueryBuilderUserRepository implements UserRepositoryInterface { public function save(User $user) { DB::table('users') ->updateOrInsert( ['id' => $user->getId()], ['name' => $user->getName()] ); } }

Slide 99

Slide 99 text

class QueryBuilderUserRepository implements UserRepositoryInterface { public function save(User $user) { DB::table('users') ->updateOrInsert( ['id' => $user->getId()], ['name' => $user->getName()] ); } }

Slide 100

Slide 100 text

No content

Slide 101

Slide 101 text

No content

Slide 102

Slide 102 text

No content

Slide 103

Slide 103 text

No content

Slide 104

Slide 104 text

No content

Slide 105

Slide 105 text

No content

Slide 106

Slide 106 text

$repository = new QueryBuilderUserRepository(); $interactor = new UserCreateInteractor($repository); $interactor->handle(new UserCreateRequest("nrs"));

Slide 107

Slide 107 text

$repository = new QueryBuilderUserRepository(); $interactor = new UserCreateInteractor($repository); $interactor->handle(new UserCreateRequest("nrs"));

Slide 108

Slide 108 text

$repository = new AwesomeUserRepository(); $interactor = new UserCreateInteractor($repository); $interactor->handle(new UserCreateRequest("nrs"));

Slide 109

Slide 109 text

$repository = new AwesomeUserRepository(); $interactor = new UserCreateInteractor($repository); $interactor->handle(new UserCreateRequest("nrs"));

Slide 110

Slide 110 text

$repository = new AwesomeUserRepository(); $interactor = new UserCreateInteractor($repository); $interactor->handle(new UserCreateRequest("nrs"));

Slide 111

Slide 111 text

No content

Slide 112

Slide 112 text

$this->app->bind( UserRepositoryInterface::class, QueryBuilderUserRepository::class );

Slide 113

Slide 113 text

No content

Slide 114

Slide 114 text

No content

Slide 115

Slide 115 text

class UserCreateInteractor implements UserCreateUseCaseInterface { private $userRepository; public function __construct(UserRepositoryInterface $userRepository) { $this->userRepository = $userRepository; } public function handle(UserCreateRequest $request) { $userId = new UserId(uniqid()); $createdUser = new User($userId, $request->getName()); $this->userRepository->save($createdUser); return new UserCreateResponse($userId->getValue()); } }

Slide 116

Slide 116 text

class UserCreateInteractor implements UserCreateUseCaseInterface { private $userRepository; public function __construct(UserRepositoryInterface $userRepository) { $this->userRepository = $userRepository; } public function handle(UserCreateRequest $request) { $userId = new UserId(uniqid()); $createdUser = new User($userId, $request->getName()); $this->userRepository->save($createdUser); return new UserCreateResponse($userId->getValue()); } }

Slide 117

Slide 117 text

No content

Slide 118

Slide 118 text

class UserController extends BaseController { public function create(UserCreateUseCaseInterface $interactor, Request $request) { $name = $request->input('name'); $request = new UserCreateRequest($name); $response = $interactor->handle($request); $viewModel = new UserCreateViewModel($response->getCreatedUserId(), $name); return view('user.create', compact('viewModel')); } }

Slide 119

Slide 119 text

class UserController extends BaseController { public function create(UserCreateUseCaseInterface $interactor, Request $request) { $name = $request->input('name'); $request = new UserCreateRequest($name); $response = $interactor->handle($request); $viewModel = new UserCreateViewModel($response->getCreatedUserId(), $name); return view('user.create', compact('viewModel')); } }

Slide 120

Slide 120 text

No content

Slide 121

Slide 121 text

@Saga class SecureStockIssueSaga { @Transient @Autowired private lateinit var commandGateway: CommandGateway private lateinit var sagaState: SecureStockIssuerSagaState @StartSaga @SagaEventHandler(associationProperty = "secureStockId") fun on(event: SecureStockEvents.SecureStockIssued, @MessageIdentifier messageIdentifier: String) { sagaState = SecureStockIssuerSagaState(event.secureStockId, secureItemIdToNr = event.itemIdToNr) log("[START SAGA] Handling the Secure Stock Issued Event within the Saga ($sagaState).") sagaState.secureItemIdToNr.keys.forEach { SagaLifecycle.associateWith("itemId", it.asString()) } val commands = event.itemIdToNr.map { (itemId, nr) -> ItemAggregateProtocol.SecureItem(itemId, event.secureStockId, nr, messageIdentifier) } val replies = commands.map { commandGateway.sendAndWait(it) } if (replies.any { it is ItemAggregateProtocol.SecureItemFailed }) { val secureSucceededList = replies.filterIsInstance() compensateSecureStockIssued(secureSucceededList) } } }

Slide 122

Slide 122 text

@Saga class SecureStockIssueSaga { @Transient @Autowired private lateinit var commandGateway: CommandGateway private lateinit var sagaState: SecureStockIssuerSagaState @StartSaga @SagaEventHandler(associationProperty = "secureStockId") fun on(event: SecureStockEvents.SecureStockIssued, @MessageIdentifier messageIdentifier: String) { sagaState = SecureStockIssuerSagaState(event.secureStockId, secureItemIdToNr = event.itemIdToNr) log("[START SAGA] Handling the Secure Stock Issued Event within the Saga ($sagaState).") sagaState.secureItemIdToNr.keys.forEach { SagaLifecycle.associateWith("itemId", it.asString()) } val commands = event.itemIdToNr.map { (itemId, nr) -> ItemAggregateProtocol.SecureItem(itemId, event.secureStockId, nr, messageIdentifier) } val replies = commands.map { commandGateway.sendAndWait(it) } if (replies.any { it is ItemAggregateProtocol.SecureItemFailed }) { val secureSucceededList = replies.filterIsInstance() compensateSecureStockIssued(secureSucceededList) } } }

Slide 123

Slide 123 text

No content

Slide 124

Slide 124 text

No content

Slide 125

Slide 125 text

No content

Slide 126

Slide 126 text

No content

Slide 127

Slide 127 text

No content

Slide 128

Slide 128 text

No content

Slide 129

Slide 129 text

No content

Slide 130

Slide 130 text

伝統的なソフトウェア開発手法では高レベルなモジュールが低レベルな モジュールに依存する形で作成される傾向がありました。言い換えるな ら抽象が詳細に依存するような形で構築されていました。 抽象が詳細に依存するようになると、低レベルのモジュールにおける方 針の変更が高レベルのモジュールに波及します。これはおかしな話です。 重要なドメインのルールが含まれるのはいつだって高レベルなモジュー ルです。低レベルなモジュールの変更を理由にして、重要な高レベルの モジュールを変更する (たとえばデータストアの変更を理由にビジネスロジックを変更する)な どということは起きてほしくない事態です。 主体となるべきは高レベルなモジュール、すなわち抽象です。低レベル なモジュールが主体となるべきではありません。 高レベルなモジュールは低レベルのモジュールを利用するクライアント です。クライアントがすべきはどのような処理を呼び出すかの宣言です。 先述したとおり、インターフェースはそれを利用するクライアントが宣言す るものであり、主導権はそのクライアントにあります。インターフェースを宣 言し、低レベルのモジュールはそのインターフェースに合わせて実装を行 うことで、より重要な高次元の概念に主導権を握らせることが可能にな るのです。 『ドメイン駆動設計入門 ボトムアップでわかる!ドメイン駆動設計の基本(翔泳社)』 7.3.2

Slide 131

Slide 131 text

No content

Slide 132

Slide 132 text

OO Robert C. Martin 『CleanArchitecture ( )』

Slide 133

Slide 133 text

No content

Slide 134

Slide 134 text

No content

Slide 135

Slide 135 text

No content

Slide 136

Slide 136 text

No content

Slide 137

Slide 137 text

No content

Slide 138

Slide 138 text

No content

Slide 139

Slide 139 text

No content

Slide 140

Slide 140 text

No content

Slide 141

Slide 141 text

No content

Slide 142

Slide 142 text

No content

Slide 143

Slide 143 text

No content

Slide 144

Slide 144 text

No content

Slide 145

Slide 145 text

No content

Slide 146

Slide 146 text

No content

Slide 147

Slide 147 text

No content

Slide 148

Slide 148 text

No content

Slide 149

Slide 149 text

No content

Slide 150

Slide 150 text

No content

Slide 151

Slide 151 text

No content

Slide 152

Slide 152 text

No content

Slide 153

Slide 153 text

No content

Slide 154

Slide 154 text

No content

Slide 155

Slide 155 text

No content

Slide 156

Slide 156 text

No content

Slide 157

Slide 157 text

No content

Slide 158

Slide 158 text

No content

Slide 159

Slide 159 text

No content

Slide 160

Slide 160 text

No content

Slide 161

Slide 161 text

No content

Slide 162

Slide 162 text

No content

Slide 163

Slide 163 text

OO Robert C. Martin 『CleanArchitecture ( )』

Slide 164

Slide 164 text

No content

Slide 165

Slide 165 text

No content

Slide 166

Slide 166 text

No content

Slide 167

Slide 167 text

No content

Slide 168

Slide 168 text

No content

Slide 169

Slide 169 text

No content

Slide 170

Slide 170 text

No content

Slide 171

Slide 171 text

No content

Slide 172

Slide 172 text

No content

Slide 173

Slide 173 text

No content

Slide 174

Slide 174 text

No content

Slide 175

Slide 175 text

No content

Slide 176

Slide 176 text

No content

Slide 177

Slide 177 text

No content

Slide 178

Slide 178 text

No content

Slide 179

Slide 179 text

No content

Slide 180

Slide 180 text

No content

Slide 181

Slide 181 text

No content

Slide 182

Slide 182 text

No content

Slide 183

Slide 183 text

No content

Slide 184

Slide 184 text

No content

Slide 185

Slide 185 text

OO Robert C. Martin 『CleanArchitecture ( )』

Slide 186

Slide 186 text

No content

Slide 187

Slide 187 text

No content