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

[REFACTORING] Make sure to use project message bus instead of application message bus #403

Open
stephanj opened this issue Dec 17, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@stephanj
Copy link
Contributor

The MessageBus is used to fire events but these should be restricted to the current project not the full IDEA application.

project.getMessageBus();
The difference between `Application.getMessageBus()` and `Project.getMessageBus()` 
in IntelliJ IDEA lies in their scope and usage:

1. **Application.getMessageBus()**:
   - This message bus is associated with the entire IntelliJ IDEA application.
   - It is used for application-wide events and communication.
   - Services and components that need to communicate across the entire application should use this message bus.

2. **Project.getMessageBus()**:
   - This message bus is associated with a specific project within IntelliJ IDEA.
   - It is used for project-specific events and communication.
   - Services and components that need to communicate within the context of a single project should use this message bus.

In summary, `Application.getMessageBus()` is for global communication across the entire application, while `Project.getMessageBus()` is for communication within a specific project.
@stephanj stephanj added the enhancement New feature or request label Dec 17, 2024
@samkerr4coding
Copy link
Contributor

To add my stone : there is a com.devoxx.genie.ui.util.NotificationUtil class so shouldn't we refactor all those calls in that Util class in some kind of connect() method?

@samkerr4coding
Copy link
Contributor

@stephanj i'm currently looking at this one i feel that panel/listener get connection and suscribing should implement a dispose method

I suggest to create a MessageBusUtil class with connect, suscribe and publish method at Project level (and not Application as initially posted), i'm looking at this

@stephanj
Copy link
Contributor Author

Great, thanks and happy holidays! 🎄🍾🥂

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