How to stop excessive Object creation on Samsung phones?

家住魔仙堡 提交于 2019-12-04 02:46:56

Well, there is a design pattern comes into play which we use for situation like this, Called flyweight pattern. Not sure if this helps you if the client code is under your control , if it is , rather making the new objects, use the same object, with the properties of the object ( for example Rect will have x,y coordinates ) stored in the client object in an array , and call the draw method on the Rect object , passing the coordinates of the rect object stored in the array in the client.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!