From 6ef0c2ef399d63640456aed0e7b28de095dfbe9c Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Sun, 26 Feb 2023 15:30:20 +0100 Subject: [PATCH] refactor: `ChatRoomFactory` returns real `ChatRoom`s - `ChatHomeService` only deals with real `ChatRoom`s. - Hence, there is no need for `ChatRoomFactory`, to return the simplified interface `ChatRoomInfo`. - This is, because the implementation specific logic is implemented in the `ChatHomeService`, not `ChatHome` itself: the actual implementation is hidden behind that service (and behind the service `ChatRoomService` in the domain-class `ChatRoom`). --- .../de/juplo/kafka/chat/backend/domain/ChatRoomFactory.java | 2 +- .../backend/persistence/inmemory/InMemoryChatRoomFactory.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/juplo/kafka/chat/backend/domain/ChatRoomFactory.java b/src/main/java/de/juplo/kafka/chat/backend/domain/ChatRoomFactory.java index 603795d9..324e4b02 100644 --- a/src/main/java/de/juplo/kafka/chat/backend/domain/ChatRoomFactory.java +++ b/src/main/java/de/juplo/kafka/chat/backend/domain/ChatRoomFactory.java @@ -7,5 +7,5 @@ import java.util.UUID; public interface ChatRoomFactory { - Mono createChatRoom(UUID id, String name); + Mono createChatRoom(UUID id, String name); } diff --git a/src/main/java/de/juplo/kafka/chat/backend/persistence/inmemory/InMemoryChatRoomFactory.java b/src/main/java/de/juplo/kafka/chat/backend/persistence/inmemory/InMemoryChatRoomFactory.java index 2bde2361..9872ccb1 100644 --- a/src/main/java/de/juplo/kafka/chat/backend/persistence/inmemory/InMemoryChatRoomFactory.java +++ b/src/main/java/de/juplo/kafka/chat/backend/persistence/inmemory/InMemoryChatRoomFactory.java @@ -21,7 +21,7 @@ public class InMemoryChatRoomFactory implements ChatRoomFactory @Override - public Mono createChatRoom(UUID id, String name) + public Mono createChatRoom(UUID id, String name) { log.info("Creating ChatRoom with buffer-size {}", bufferSize); int shard = shardingStrategy.selectShard(id); -- 2.20.1