Skip to content

Commit ff16e66

Browse files
authored
Remove redundant abstractions (#243)
WebInterface now invokes the application layers directly. That's okay, because the bus interface already abstracts the other contexts, so there is no reason to put another layer in between, especially because the type information would be lost through this additional layer. Also, when moving a context to its own service, message types and clients will be generated from definition files. That also makes the current abstractions even more redundant. Additionally, fix a frontend bug introduced by #232, which causes moves to be applied twice.
1 parent b4a66c5 commit ff16e66

31 files changed

Lines changed: 111 additions & 736 deletions

File tree

assets/js/ConnectFour/Game.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,11 @@ customElements.define('connect-four-game', class extends HTMLElement {
122122
}
123123

124124
_onPlayerMoved(event) {
125-
this._game.appendMove(event.detail);
125+
this._game.appendMove({
126+
x: event.detail.x,
127+
y: event.detail.y,
128+
color: event.detail.color,
129+
});
126130
}
127131

128132
_onGameWon(event) {

config/chat/services/chat.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
services:
2-
chat.chat-controller:
3-
class: Gaming\Chat\Presentation\Http\ChatController
4-
arguments: ['@chat.command-bus', '@chat.query-bus']
5-
62
chat.chat-gateway:
73
class: Gaming\Chat\Infrastructure\DoctrineChatGateway
84
arguments: ['@chat.doctrine-dbal', 'chat', 'message']

config/chat/services/consumer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ services:
99
factory: ['@gaming.message-broker.amqp-consumer-factory', 'create']
1010
arguments:
1111
- !service
12-
class: Gaming\Chat\Infrastructure\Messaging\CommandMessageHandler
12+
class: Gaming\Chat\Presentation\Messaging\CommandMessageHandler
1313
arguments: ['@chat.command-bus']
1414
- !service
1515
class: Gaming\Common\MessageBroker\Integration\AmqpLib\QueueConsumer\ConsumeQueues

config/connect-four/services/game.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
services:
2-
connect-four.game-controller:
3-
class: Gaming\ConnectFour\Port\Adapter\Http\GameController
4-
arguments: ['@connect-four.command-bus', '@connect-four.query-bus']
5-
62
connect-four.game-repository:
73
class: Gaming\ConnectFour\Port\Adapter\Persistence\Repository\DoctrineJsonGameRepository
84
arguments:

config/identity/services/user.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
services:
2-
identity.user-controller:
3-
class: Gaming\Identity\Port\Adapter\Http\UserController
4-
arguments: ['@identity.command-bus']
5-
62
identity.user-repository:
73
class: Gaming\Identity\Port\Adapter\Persistence\Repository\DoctrineUserRepository
84
arguments: ['@identity.doctrine-orm']

config/web-interface/services/console.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
services:
22
Gaming\WebInterface\Presentation\Console\PublishRunningGamesCountToNchanCommand:
3-
arguments: ['@web-interface.connect-four-service', '@web-interface.browser-notifier']
3+
arguments: ['@connect-four.query-bus', '@web-interface.browser-notifier']
44
tags:
55
- name: console.command
66
command: web-interface:publish-running-games-count-to-nchan

config/web-interface/services/controller.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
services:
22
web-interface.page-controller:
33
class: Gaming\WebInterface\Presentation\Http\PageController
4-
arguments: ['@twig', '@web-interface.connect-four-service', '@web-interface.security']
4+
arguments: ['@twig', '@connect-four.query-bus', '@web-interface.security']
55
tags: ['controller.service_arguments']
66

77
web-interface.signup-controller:
88
class: Gaming\WebInterface\Presentation\Http\SignupController
99
arguments:
1010
- '@uri_signer'
1111
- '@web-interface.security'
12-
- '@web-interface.identity-service'
12+
- '@identity.command-bus'
1313
- '@gaming.form-violation-mapper'
1414
calls: [[setContainer, ['@Psr\Container\ContainerInterface']]]
1515
tags: ['controller.service_arguments', 'container.service_subscriber']
@@ -28,10 +28,10 @@ services:
2828

2929
web-interface.chat-controller:
3030
class: Gaming\WebInterface\Presentation\Http\ChatController
31-
arguments: ['@web-interface.chat-service', '@web-interface.security']
31+
arguments: ['@chat.command-bus', '@chat.query-bus', '@web-interface.security']
3232
tags: ['controller.service_arguments']
3333

3434
web-interface.connect-four-controller:
3535
class: Gaming\WebInterface\Presentation\Http\ConnectFourController
36-
arguments: ['@web-interface.connect-four-service', '@web-interface.security']
36+
arguments: ['@connect-four.command-bus', '@web-interface.security']
3737
tags: ['controller.service_arguments']

config/web-interface/services/integration.yml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,4 @@
11
services:
2-
web-interface.chat-service:
3-
class: Gaming\WebInterface\Infrastructure\Integration\DirectControllerInvocationChatService
4-
arguments: ['@chat.chat-controller']
5-
6-
web-interface.connect-four-service:
7-
class: Gaming\WebInterface\Infrastructure\Integration\DirectControllerInvocationConnectFourService
8-
arguments: ['@connect-four.game-controller']
9-
10-
web-interface.identity-service:
11-
class: Gaming\WebInterface\Infrastructure\Integration\DirectControllerInvocationIdentityService
12-
arguments: ['@identity.user-controller']
13-
142
web-interface.nchan:
153
class: Marein\Nchan\Nchan
164
arguments:

config/web-interface/services/security.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ services:
99

1010
web-interface.security.arrival_authenticator:
1111
class: Gaming\WebInterface\Infrastructure\Security\ArrivalAuthenticator
12-
arguments: ['@web-interface.identity-service', '@security.token_storage']
12+
arguments: ['@identity.command-bus', '@security.token_storage']

src/Chat/Presentation/Http/ChatController.php

Lines changed: 0 additions & 59 deletions
This file was deleted.

0 commit comments

Comments
 (0)