Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for own interfaces extending KediatR types #8

Open
rvplauborg opened this issue Nov 15, 2021 · 4 comments
Open

Support for own interfaces extending KediatR types #8

rvplauborg opened this issue Nov 15, 2021 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@rvplauborg
Copy link

rvplauborg commented Nov 15, 2021

Hi,

Love the plugin. Would be great to see the "create handler" actions etc. work when using custom event/command/handler interfaces/classes that extend from the KediatR types.

I.e. if wanting to hide KediatR stuff from other modules, we have a building blocks module to put those details and then expose our own Bus/Command/Event/XHandler interfaces. And in that case, the 'Create handler' actions do not work.

@bilal-kilic bilal-kilic self-assigned this Nov 15, 2021
@bilal-kilic bilal-kilic added the enhancement New feature or request label Nov 15, 2021
@bilal-kilic
Copy link
Owner

bilal-kilic commented Nov 18, 2021

Hi,

I released version 1.0.8 with support for finding custom handlers which did not work earlier.

I am not sure about Create Handler actions do you suggest we use custom interfaces when creating handler classes. If so how do we determine which handler implementation to use when there are multiple interfaces.

@rvplauborg
Copy link
Author

rvplauborg commented Nov 18, 2021

Nice.

For Create Handler I think its hard to find the right custom handler. So using a simple example:

interface CustomCommand: Command

interface CustomCommandHandler<T: Command>: CommandHandler<T>

Create handler in class SomeCustomCommandImpl: CustomCommand could maybe just create a class SomeCustomCommandHandler: CommandHandler<SomeCustomCommandImpl>. So we ignore the custom handler type for now but at least we can partially help the user.

Not sure if that makes any sense, but I cant figure out right now how one could go about finding the custom handler classes except for adding a setting in the plugin "registering" custom command/event/query handler interfaces.

@bilal-kilic
Copy link
Owner

Create handler in class SomeCustomCommandImpl: CustomCommand could maybe just create a class SomeCustomCommandHandler: CommandHandler<SomeCustomCommandImpl>.

This works as of 1.0.8.

Maybe we could show different implementations in the pop-up to create handlers

  • Create New Handler
  • Create New AsyncHandler
  • Create New CustomCommandHandler
  • Create New AsyncCustomCommandHandler

We could list all interfaces or abstract classes that implement Handlers. I will try to experiment with this.

@rvplauborg
Copy link
Author

rvplauborg commented Nov 19, 2021

Sounds like a helpful enhancement.

I noticed, if I have

data class SomeIntegrationEvent(
    val someProperty: UUID,
): IntegrationEvent()

and

abstract class IntegrationEvent: Notification { ... }

Create handler action does not work for SomeIntegrationEvent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants