Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@zklgame
Copy link
Contributor

@zklgame zklgame commented Jul 19, 2023

This MR did:

  1. support weak typed data attributes by managing a isPrefix field in DataAttributeDef and a new registry field.
  2. rename related getDataObject methods to getDataAttribute.

@zklgame zklgame requested a review from longquanzheng July 19, 2023 06:42
@zklgame zklgame force-pushed the zklgame/support_weak_typed_attributes branch from b64802a to 5177e98 Compare July 19, 2023 06:58
@codecov
Copy link

codecov bot commented Jul 19, 2023

Codecov Report

Merging #189 (562d648) into main (54cdb47) will increase coverage by 0.61%.
The diff coverage is 80.51%.

@@             Coverage Diff              @@
##               main     #189      +/-   ##
============================================
+ Coverage     69.37%   69.99%   +0.61%     
- Complexity      349      355       +6     
============================================
  Files            58       59       +1     
  Lines          1476     1513      +37     
  Branches        134      135       +1     
============================================
+ Hits           1024     1059      +35     
- Misses          379      381       +2     
  Partials         73       73              
Impacted Files Coverage Ξ”
...orkflow/core/persistence/DataAttributesRWImpl.java 66.66% <60.00%> (+1.04%) ⬆️
...va/io/iworkflow/core/utils/DataAttributeUtils.java 75.00% <75.00%> (ΓΈ)
src/main/java/io/iworkflow/core/Client.java 59.16% <76.47%> (+0.51%) ⬆️
src/main/java/io/iworkflow/core/Registry.java 79.24% <82.75%> (+2.42%) ⬆️
src/main/java/io/iworkflow/core/WorkerService.java 85.64% <100.00%> (+0.21%) ⬆️
...o/iworkflow/core/persistence/DataAttributeDef.java 100.00% <100.00%> (ΓΈ)

πŸ“£ We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Contributor

@longquanzheng longquanzheng left a comment

Choose a reason for hiding this comment

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

lgtm, just some minor comments

dataAttributeField.getDataAttributeType())
);
for (final DataAttributeDef dataAttributeField : fields) {
if (!dataAttributeField.isPrefix()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: swap the order of the if-else will make it slightly better to read:

if (dataAttributeField.isPrefix()) {

else {}

.build();
}

public static DataAttributeDef createByPrefix(final Class dataType, final String key) {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: key ==> keyPrefix

Also it will better to provide some comments to it. As it's not straightforward to know why this is needed.

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.

2 participants