Comments (2)
感谢你的问题,仅以讨论的角度来解释一下当时这样设计的想法:
RapidObject的initialize本质上是生成了一个IRapidView,这个对象经过了初始化,但未经load,是一个可复用的状态,但是一旦经过load就变成了一个唯一的界面对象,不再可以复用。也就意味着,如果要完美复用的话,需要对IRapidView的initialize后的状态进行对象深度拷贝。在initialize的时候会生成许多其它关联对象,这些关联对象也要进行深度拷贝。需要维护一份比较复杂的拷贝函数,随着项目的演进,这份列表需要同步维护,如果其它人介入项目忘记维护这个列表,有可能导致整个框架异常。
在我理解来看,工程的复杂度和性能在项某一个点总是会出现取舍。在这个点上,XML本身是有内存缓存的情况下,我倾向于认为重新initialize一份对象的代价会小于维护一份克隆函数以及可能出现的问题。所以在这个地方简单处理成缓存一份一次性对象,取走了再缓存一份。
from rapidview.
懂了,感谢回复
from rapidview.
Related Issues (14)
- 文档只能说糙的不行,懒到一定程度了 HOT 1
- 考虑跨平台么? HOT 1
- Where can we get a copy of Rapid Studio? HOT 1
- 在for循环中使用RapidImageLoader加载本地图片,出现内存溢出问题 HOT 1
- Rapid Studio HOT 2
- 请问如果应用需要上谷歌商店,这个支持吗
- typo in repo description HOT 1
- osx support for Rapid Studio HOT 2
- xml外部实体注入 HOT 1
- zip条目覆盖 HOT 1
- 资源未删除:临时文件
- RapidView轻到什么程度? HOT 4
- 有使用案例吗 HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rapidview.