How to use/implement Use Cases in this case

105 views
Skip to first unread message

Erick Duarte

unread,
Mar 30, 2023, 8:10:03 AM3/30/23
to Clean Code Discussion
Hi everybody,
Consider an Notification System that handles different notifications (Telegram, Whatsapp, Websocket), where to each notification type the application has a different handler implementing the same interface.

I would like to know if the application should have different use cases or interactors implemented to each notification handler or a generic one  that depends on the interface above should suffice?

So, what is the better approach in Clean Architecture?

Josselin Tillay

unread,
Oct 11, 2023, 8:47:26 AM10/11/23
to Clean Code Discussion
I think you answer the question yourself when you say "implementing the same interface". Your usecases should not be dependent of a specific implementation but be based on an interface.
All your notification handlers share the same interface, so your usecases should interact with this interface.
Reply all
Reply to author
Forward
0 new messages