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

调整 MapCacheStore 在值类型泛型上的设计 #32

Open
LamGC opened this issue Oct 18, 2020 · 2 comments
Open

调整 MapCacheStore 在值类型泛型上的设计 #32

LamGC opened this issue Oct 18, 2020 · 2 comments
Labels
adjustment 对程序的调整,无特殊说明情况下不影响现有功能 function 新功能!(更多的bug!) Priority:High 优先级 - 高 question Further information is requested

Comments

@LamGC
Copy link
Owner

LamGC commented Oct 18, 2020

当前 MapCacheStore 在值泛型上出现了一些问题:

  • 限制了字段值的类型
  • 不适用当前的 Converter 设计
    • Converter 很难适用于 Map 这种分字段可多类型的设计,因为不方便(做不到类似于 Gson 的转换,Converter 针对的是单个值而不是一个 Map)

这些问题对 MapCacheStore 的实际使用造成了一定影响,需要尽快处理。

@LamGC LamGC added question Further information is requested adjustment 对程序的调整,无特殊说明情况下不影响现有功能 function 新功能!(更多的bug!) Priority:High 优先级 - 高 labels Oct 18, 2020
@LamGC
Copy link
Owner Author

LamGC commented Oct 24, 2020

要不,设计一个 MapStringConverter,然后分字段设置 StringConverter?不过这样对于没有的字段咋整,还是说加多一个 DefaultConverter 用于对未指定转换器的字段进行转换?不过无论怎么修改,MapCacheStore 中的一些方法都要进行修改。

@LamGC
Copy link
Owner Author

LamGC commented Nov 8, 2020

重新审题了一下,限制字段值类型是因为泛型问题,如果能解决不同类型兼容的话,可以考虑按字段使用对应转换器的复合转换器思路进行。而【不适用当前的 Converter】感觉还是泛型的问题,具体要考虑如何设计这个泛型以解决字段问题,这个问题还没屡清楚,晚点看看。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
adjustment 对程序的调整,无特殊说明情况下不影响现有功能 function 新功能!(更多的bug!) Priority:High 优先级 - 高 question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant