GithubHelp home page GithubHelp logo

Comments (2)

Earlonus avatar Earlonus commented on May 11, 2024 3

感谢你的问题,仅以讨论的角度来解释一下当时这样设计的想法:
RapidObject的initialize本质上是生成了一个IRapidView,这个对象经过了初始化,但未经load,是一个可复用的状态,但是一旦经过load就变成了一个唯一的界面对象,不再可以复用。也就意味着,如果要完美复用的话,需要对IRapidView的initialize后的状态进行对象深度拷贝。在initialize的时候会生成许多其它关联对象,这些关联对象也要进行深度拷贝。需要维护一份比较复杂的拷贝函数,随着项目的演进,这份列表需要同步维护,如果其它人介入项目忘记维护这个列表,有可能导致整个框架异常。

在我理解来看,工程的复杂度和性能在项某一个点总是会出现取舍。在这个点上,XML本身是有内存缓存的情况下,我倾向于认为重新initialize一份对象的代价会小于维护一份克隆函数以及可能出现的问题。所以在这个地方简单处理成缓存一份一次性对象,取走了再缓存一份。

from rapidview.

yuanyang1991 avatar yuanyang1991 commented on May 11, 2024

懂了,感谢回复

from rapidview.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.