阅读背景:

通过对象共享数据的最佳设计是什么?

来源:互联网 

I would like to share data between the objects. Actually, for example, there is a World composed of Water and Individuals. I would like the Individuals to access the Water. I looked at transforming the Individual table in Collection, or making the Water a Singleton, but really, what would be the best design? (we might have multi threading processes on the Individual object... So we might need a Thread safe implementation.) (Also, I wonder about passing by argument or instantiate the Water for each Individuals, but it seems not to be the most efficient implementation (processing instantiation) ?...)I would like to share data between the objects.




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: