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

将从目标对象中提取 key 值的操作分离为独立的键值提取器 #103

Closed
Createsequence opened this issue Jul 6, 2023 · 1 comment
Labels
enhancement New feature or request primary This is an important feature or fix that needs to be completed as a top priority refactor Refactoring code to optimize or add functionality
Milestone

Comments

@Createsequence
Copy link
Collaborator

目前,从目标对象对象中提取 key 值的操作基于装配处理器 AssembleOperationHandler 完成,考虑到 #100#93 的需求,或许需要将提取 key 值的操作抽象为独立的键值提取器组件。

在这么做以后,KeyTriggerAssembleOperation 将会多处一个新的方法 getKeyTrigger / getKeyExtractor,装配处理器在从对象获取键值的时候,将不在强制根据 key 值通过 ProperyOperator 读取,而是由键值提取器自己决定要怎么完成:

  • 可以基于 ProperyOperator 反射的读取某个属性,甚至更进一步,直接缓存 MethodInvoker 避免跳过一次哈希;
  • 可以基于反射调用对象中的某个实例/静态方法,使用它们的返回值作为 key 值;
  • 如果没有指定 key 字段,甚至可以直接返回待处理的目标对象本身;
@Createsequence Createsequence added enhancement New feature or request refactor Refactoring code to optimize or add functionality labels Jul 6, 2023
@Createsequence Createsequence added this to the release 2.1.0 milestone Jul 6, 2023
@Createsequence Createsequence self-assigned this Jul 6, 2023
@Createsequence Createsequence added the primary This is an important feature or fix that needs to be completed as a top priority label Jul 6, 2023
@Createsequence Createsequence removed their assignment Jul 28, 2023
@Createsequence
Copy link
Collaborator Author

Createsequence commented Feb 21, 2024

在 2.6.0 版本,先支持基于 getter 方法的操作配置。

参见 #93

@Createsequence Createsequence changed the title 将从目标对象中提取 key 值的操作分离为独立的键值提取器 支持将 @Assemble 注解配置在 getter 方法上 Feb 21, 2024
@Createsequence Createsequence changed the title 支持将 @Assemble 注解配置在 getter 方法上 支持将装配操作配置在 getter 方法上 Feb 21, 2024
@Createsequence Createsequence changed the title 支持将装配操作配置在 getter 方法上 将从目标对象中提取 key 值的操作分离为独立的键值提取器 Feb 21, 2024
Createsequence added a commit that referenced this issue Mar 4, 2024
Createsequence added a commit that referenced this issue Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request primary This is an important feature or fix that needs to be completed as a top priority refactor Refactoring code to optimize or add functionality
Projects
None yet
Development

No branches or pull requests

1 participant