【发布时间】:2009-09-11 17:46:00
【问题描述】:
我在这里很困惑。哪个是较轻的物体?是 orgWithNullImageCollection 还是 orgWithImageCollection ?在下面的代码中。或者它是更轻的对象概念。请在下面找到代码 sn-p 以供参考。
class Orgnization
{
public Collection ImageCollection { get; set; }
}
Organization orgWithNullImageCollection = new Organization();
org.ImageCollection = null;
Collection imageCollection = new Collection();
// Adding 100 images to imageCollection
Organization orgWithImageCollection = new Organization();
org.ImageCollection = imageCollection;
如果我将这两个对象传递给任何其他方法,性能会有什么不同吗?即通过 orgWithImageCollection 传递 orgWithNullImageCollection ?
我相信,Organization 对象的 ImageCollection 属性是否指向某个东西不会有任何区别。
请澄清。
【问题讨论】: