You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@streampark.apache.org by "VampireAchao (via GitHub)" <gi...@apache.org> on 2024/03/21 13:29:29 UTC
[D] Optimal Null Value Handling in Java Object Updates Post-UpdateStrategy Change [incubator-streampark]
GitHub user VampireAchao created a discussion: Optimal Null Value Handling in Java Object Updates Post-UpdateStrategy Change
# Optimal Null Value Handling in Java Object Updates Post-UpdateStrategy Change
## Context
Following the shift in our global `UpdateStrategy` to 'ignore', we encounter a new challenge: preventing unwanted `null` value assignments during object updates. This change necessitates a reevaluation of our approach to ensure data integrity without compromising on performance.
## Strategies Under Consideration
### Direct Assignment
Pros: Straightforward and minimalistic.
Cons: High risk of `null` value propagation, potentially leading to data loss.

### Conditional Checking
Pros: Explicit control over value assignment.
Cons: Increases code complexity and verbosity.

### Utilization of `Optional`
Pros: Cleaner syntax, avoids explicit null checks.
Cons: Potentially reduces readability due to more complex lines.

### Hutool's `BeanUtil.copyProperties`
Pros: Reduces boilerplate code significantly.
Cons: Introduces a third-party dependency and may degrade performance due to reflection, particularly after our update strategy shift.

## Key Considerations
- **Performance Impact**: Special attention must be given to the reflection costs associated with Hutool's approach, given our high-volume data context.
- **Maintainability vs. Efficiency**: We need to balance the ease of maintainability with the efficiency of the code, considering the new 'ignore' strategy.
- **Dependency Management**: We must be cautious about introducing new dependencies and consider using similar functionalities from existing libraries like Guava.
## Seeking Input
I invite community input on these strategies to arrive at a consensus that honors our commitment to robust and performant code. Your insights and suggestions are invaluable as we navigate this change.
GitHub link: https://github.com/apache/incubator-streampark/discussions/3621
----
This is an automatically sent email for dev@streampark.apache.org.
To unsubscribe, please send an email to: dev-unsubscribe@streampark.apache.org
Re: [D] Optimal Null Value Handling in Java Object Updates Post-UpdateStrategy Change [incubator-streampark]
Posted by "caicancai (via GitHub)" <gi...@apache.org>.
GitHub user caicancai closed the discussion with a comment: Optimal Null Value Handling in Java Object Updates Post-UpdateStrategy Change
finish,closing
GitHub link: https://github.com/apache/incubator-streampark/discussions/3621#discussioncomment-9104473
----
This is an automatically sent email for dev@streampark.apache.org.
To unsubscribe, please send an email to: dev-unsubscribe@streampark.apache.org
Re: [D] Optimal Null Value Handling in Java Object Updates Post-UpdateStrategy Change [incubator-streampark]
Posted by "VampireAchao (via GitHub)" <gi...@apache.org>.
GitHub user VampireAchao added a comment to the discussion: Optimal Null Value Handling in Java Object Updates Post-UpdateStrategy Change
I'll proceed with Conditional Checking to align with our 'ignore' strategy change and maintain data integrity. Your thoughts on this are welcome!
GitHub link: https://github.com/apache/incubator-streampark/discussions/3621#discussioncomment-8866235
----
This is an automatically sent email for dev@streampark.apache.org.
To unsubscribe, please send an email to: dev-unsubscribe@streampark.apache.org
Re: [D] Optimal Null Value Handling in Java Object Updates Post-UpdateStrategy Change [incubator-streampark]
Posted by "VampireAchao (via GitHub)" <gi...@apache.org>.
GitHub user VampireAchao closed a discussion: Optimal Null Value Handling in Java Object Updates Post-UpdateStrategy Change
# Optimal Null Value Handling in Java Object Updates Post-UpdateStrategy Change
## Context
Following the shift in our global `UpdateStrategy` to 'ignore', we encounter a new challenge: preventing unwanted `null` value assignments during object updates. This change necessitates a reevaluation of our approach to ensure data integrity without compromising on performance.
## Strategies Under Consideration
### Direct Assignment
Pros: Straightforward and minimalistic.
Cons: High risk of `null` value propagation, potentially leading to data loss.

### Conditional Checking
Pros: Explicit control over value assignment.
Cons: Increases code complexity and verbosity.

### Utilization of `Optional`
Pros: Cleaner syntax, avoids explicit null checks.
Cons: Potentially reduces readability due to more complex lines.

### Hutool's `BeanUtil.copyProperties`
Pros: Reduces boilerplate code significantly.
Cons: Introduces a third-party dependency and may degrade performance due to reflection, particularly after our update strategy shift.

## Key Considerations
- **Performance Impact**: Special attention must be given to the reflection costs associated with Hutool's approach, given our high-volume data context.
- **Maintainability vs. Efficiency**: We need to balance the ease of maintainability with the efficiency of the code, considering the new 'ignore' strategy.
- **Dependency Management**: We must be cautious about introducing new dependencies and consider using similar functionalities from existing libraries like Guava.
## Seeking Input
I invite community input on these strategies to arrive at a consensus that honors our commitment to robust and performant code. Your insights and suggestions are invaluable as we navigate this change.
GitHub link: https://github.com/apache/incubator-streampark/discussions/3621
----
This is an automatically sent email for dev@streampark.apache.org.
To unsubscribe, please send an email to: dev-unsubscribe@streampark.apache.org