Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 plugin management and dynamic plugin installation with extensions #984
base: master
Are you sure you want to change the base?
Support plugin management and dynamic plugin installation with extensions #984
Changes from 13 commits
a9512c5
7a53f28
0bbd4e3
b8bfd91
f5e356f
94d01ab
ae207e0
4ee8415
58ca02a
345c577
e7d6e2a
84c8548
f81c2be
0e2645b
7b7ea95
c293814
5a35f75
4b08ce4
e4cd09b
792c726
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Consider Thread Safety for
dependentPlugins
If
dependentPlugins
may be accessed by multiple threads concurrently, consider using a thread-safe collection likeCopyOnWriteArraySet
or synchronizing access appropriately to prevent concurrent modification issues.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Return Unmodifiable Set in
getDependentPlugins()
Returning the mutable
dependentPlugins
set directly allows external code to modify the internal state ofBizModel
. To preserve encapsulation, consider returning an unmodifiable view of the set.Example:
Committable suggestion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Make a Defensive Copy in
setDependentPlugins()
Assigning the provided set directly to
dependentPlugins
may lead to unintended modifications if the caller alters the set after passing it. Create a defensive copy to safeguard internal state.Example:
Committable suggestion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Consider refactoring overloaded
createBiz
methods to reduce code duplicationThe overloaded
createBiz
methods between lines 85 and 105 have similar implementations where aBizConfig
is created, configured, and then passed to anothercreateBiz
method. This code duplication can be reduced for better maintainability.Consider refactoring to eliminate duplication, possibly by introducing helper methods or utilizing default parameter values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
所以每个 plugin,是需要定义自己的 export 内容的,这部分需要在使用文档里说明。