Skip to content

[Neo Core Optimization] Organize core events.#3332

Merged
NGDAdmin merged 7 commits into
neo-project:masterfrom
Jim8y:organize-events
Jun 18, 2024
Merged

[Neo Core Optimization] Organize core events.#3332
NGDAdmin merged 7 commits into
neo-project:masterfrom
Jim8y:organize-events

Conversation

@Jim8y
Copy link
Copy Markdown
Contributor

@Jim8y Jim8y commented Jun 13, 2024

Description

This pr defines interfaces for core event handlers. The reason of doing this is that the public event of the core is defined everywhere, and each of them has its specific parameters, making it hard to maintain. Thus having this pr to define all event handler interfaces together and added readme document to explain them.

Fixes # #3333

Type of change

  • Optimization (the change is only an optimization)
  • Style (the change is only a code style for better maintenance or standard purpose)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Run existing test

Test Configuration:

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@Jim8y Jim8y linked an issue Jun 13, 2024 that may be closed by this pull request
private void Initialize_Logger()
{
Utility.Logging += OnLog;
Utility.Logging += ((ILoggingHandler)this).Utility_Logging_Handler;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the cast? we need to define in all the partial files the interface ILoggingHandler?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cause to make the method private, have to implement them implicitly, making it to be used this way.... Otherwise interface will be public.


namespace Neo.IEventHandlers;

public interface ILogHandler
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very similar name with ILoggingHandler

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cause they are defiend this way, one Log event one Logging event for different purpose.

@NGDAdmin NGDAdmin merged commit d9ae4a6 into neo-project:master Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Neo Core Event] Define Interfaces for Core Event Handlers

4 participants