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

重构Mirror类,实现一个重量级的Mirror #353

Closed
wendal opened this issue Dec 9, 2012 · 4 comments
Closed

重构Mirror类,实现一个重量级的Mirror #353

wendal opened this issue Dec 9, 2012 · 4 comments
Milestone

Comments

@wendal
Copy link
Member

wendal commented Dec 9, 2012

重量级,是指初始化时尽可能地加载不变的信息,例如:

全部Field,并预先设置为可访问的
全部Method, 并预先设置为可访问的
预先判断好Getter/Setter,保存为Map
类型预判, 例如isStringLike()之类的判断

并使用一个MirrorCache来保存转换结果

进一步改进, 就是引入FastClass,即通过asm为Mirror生成一个动态的访问类,目标是直接访问非private方法及字段.

@zozoh
Copy link
Member

zozoh commented Dec 9, 2012

如果那样的话,应该默认是懒加载的哦
建议实现一个类名叫 "Reflector"
然后,现在的 Mirror 类那些静态函数都通过 Reflector 来实现,并且都标上 "@deprecated"

@crskyp
Copy link
Contributor

crskyp commented Jun 17, 2013

支持

@zozoh
Copy link
Member

zozoh commented Sep 3, 2013

应该弄的根 Entity 类似,缓存解析过后的 Mirror
因此不如把 Mirro 变成抽象类,提供一个子类实现这部分逻辑
而原来那些静态方法还是放在那里不动

@zozoh zozoh modified the milestones: 1.b.51, 1.b.50 Apr 12, 2014
@zozoh zozoh modified the milestones: 1.b.51, 1.b.52 Oct 12, 2014
@wendal
Copy link
Member Author

wendal commented Feb 10, 2015

不弄了

@wendal wendal closed this as completed Feb 10, 2015
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

No branches or pull requests

3 participants