Skip to content

refactor: Move IMediator interface to abstractions package#45

Open
SpireX64 wants to merge 1 commit intohasanxdev:mainfrom
SpireX64:spx/feat/mediator-interface-in-abstractions
Open

refactor: Move IMediator interface to abstractions package#45
SpireX64 wants to merge 1 commit intohasanxdev:mainfrom
SpireX64:spx/feat/mediator-interface-in-abstractions

Conversation

@SpireX64
Copy link

I moved IMediator into the abstractions package :)

The idea is pretty simple: IMediator is an abstract interface, and in many places I don’t actually need the whole DispatchR package with its implementation.

For example:

  • DispatchR is registered only in the main WebApp module.
  • The API module contains only API controllers and uses just the IMediator interface.
  • Same for the Domain module, it contains request and event handlers, and they also rely only on IMediator for side effects.

In these cases pulling the full DispatchR package feels like overkill — having just the abstractions is enough and keeps dependencies cleaner.

I also used TypeForwardedToAttribute to keep backward compatibility, so this shouldn’t break anything.

Overall this isn’t a super important change, but it should be a bit more convenient for the cases above 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant