关于聚合的文章或章节? [英] Articles or Turorials on Aggregation??

查看:80
本文介绍了关于聚合的文章或章节?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




任何人都可以让我知道在C#中学习Aggragation的网站/ Pdf吗???


谢谢

Senthil

解决方案

聚合一词简单地表示组。所以,你必须更多地了解你要问的是什么样的聚合。


-

HTH,


Kevin Spencer

Microsoft MVP

..Net开发人员

你可以把鱼带到自行车上,

但需要很长时间,

并且自行车必须*要*改变。

" SenthilVel" < SE ****************** @ misyshealthcare.com>在消息中写道

新闻:eG ************** @ TK2MSFTNGP14.phx.gbl ...



任何人都可以让我知道网站/ Pdf在C#中学习Aggragation?

谢谢
Senthil





" Kevin Spencer" <柯*** @ DIESPAMMERSDIEtakempis.com>在消息中写道

news:uh ************** @ TK2MSFTNGP10.phx.gbl ...

单词aggregation ;简单地表示组。所以,你必须更具体地了解你所询问的聚合类型。



我记得我在大学的OOP课程中聚合和组合之间有明显的区别,聚合是指类型

有另一种类型的成员变量,但只存储引用。以这种方式,内部实例可以独立于外部或

包装器类型存在。外部破坏并不意味着内部的破坏。


在合成中,当外部实例是

创建并同时销毁。


C ++确实非常清楚地实现了这两个概念。


C#当你正在使用默认情况下聚合的类。


问题是当你想使用组合时,在C#中没有办法使用组合与
类。

如果使用结构(值类型),你可以使用C ++中的组合。

欢迎任何评论,几个月前有人问我这样

问题,如何在C#中实现聚合和组合以及我的

解释不是很清楚。



-

Ignacio Machin,

ignacio.machin at dot.state.fl.us

佛罗里达州交通局


<集团kquote><" Ignacio Machin \(.NET / C#MVP \)" < ignacio.machin AT

dot.state.fl.us>>写道:

我确实记得我在大学的OOP课程中,聚合和组合之间有明显的区别,聚合是指某种类型
有另一个成员变量的时候类型,但只存储引用。以这种方式,内部实例可以独立于外部或
包装类型存在。外部破坏并不意味着内部的破坏。

在组合中,当创建外部实例并在同一时间销毁时创建内部实例时间。

C ++确实非常清楚地实现了这两个概念。

在C#中,当你使用类时,你默认使用聚合。

问题当你想要使用组合时,在C#中没有办法使用带有类的组合。
如果使用结构(值类型),你可以使用C ++中的组合。

欢迎任何评论,几个月前有人问我同样的问题,如何在C#中实现聚合和组合,我的解释不是很清楚。




我会说,在C#中,区别变得更像是对象本身是否放出的情况。这个类 - 你是否向客户公开了一个

嵌入式列表,或者你只是作为它的代理,要求

元素。你是否允许人们提供一个列表?


如果是嵌入式列表在封闭的

实例不再可访问之后,对象不再可访问,那么即使它实际上没有收集垃圾
,它也会被销毁为其他任何事情都是有关b $ b。没有任何方法可以获取其中的数据。


(当你有终结器时会崩溃,当然,这是一个

罕见情况IMO。)


-

Jon Skeet - < sk *** @ pobox.com>
http://www.pobox.com/~skeet 博客: http://www.msmvps.com/jon.skeet

如果回复该组,请不要给我发邮件


Hi

Can any one let me know the websites/Pdf for learning Aggragation in C#??

Thanks
Senthil

解决方案

The word "aggregation" simply means "group." So, you''ll have to be more
specific about what sort of aggregation you''re asking about.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
You can lead a fish to a bicycle,
but it takes a very long time,
and the bicycle has to *want* to change.

"SenthilVel" <se******************@misyshealthcare.com> wrote in message
news:eG**************@TK2MSFTNGP14.phx.gbl...

Hi

Can any one let me know the websites/Pdf for learning Aggragation in C#??

Thanks
Senthil



Hi,
"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:uh**************@TK2MSFTNGP10.phx.gbl...

The word "aggregation" simply means "group." So, you''ll have to be more
specific about what sort of aggregation you''re asking about.


I do remember from my OOP classes in the univ that there was a clear
distinction between aggregation and composition, Aggregation is when a type
has a member variable of another type, but only store a reference. In such a
way that the inner instance can exist independently of the external, or
wrapper type. The destruction of the external one does not imply the
destruction of the internal.

In Composition the internal instance is created when the external one is
created and is destroyed at the same time.

C++ does implement both concepts very clearly.

In C# when you are using classes you have the aggregation by default.

The problem is when you want to use composition, in C# there is no way of
using composition with classes.
If you use a struct (value type) you do have composition as in C++.
Any comments are welcome, a few months ago somebody asked me that very same
question, how to implement aggregation and composition in C# and my
explanation was not very clear.


--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation


<"Ignacio Machin \( .NET/ C# MVP \)" <ignacio.machin AT
dot.state.fl.us>> wrote:

I do remember from my OOP classes in the univ that there was a clear
distinction between aggregation and composition, Aggregation is when a type
has a member variable of another type, but only store a reference. In such a
way that the inner instance can exist independently of the external, or
wrapper type. The destruction of the external one does not imply the
destruction of the internal.

In Composition the internal instance is created when the external one is
created and is destroyed at the same time.

C++ does implement both concepts very clearly.

In C# when you are using classes you have the aggregation by default.

The problem is when you want to use composition, in C# there is no way of
using composition with classes.
If you use a struct (value type) you do have composition as in C++.
Any comments are welcome, a few months ago somebody asked me that very same
question, how to implement aggregation and composition in C# and my
explanation was not very clear.



I would say that in C# the distinction becomes more a case of whether
that object itself is ever "let out" of the class - do you expose an
embedded list to clients, or do you just act as a proxy for it, asking
it for elements. Do you allow people to supply a list to start with?

If the "embedded" object is no longer accessible after the enclosing
instance is no longer accessible, then even if it hasn''t actually been
garbage collected, it''s been destroyed as far as anything else is
concerned. There''s no longer any way to get at the data in it.

(This breaks down when you have finalizers, of course, but that''s a
rare situation IMO.)

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too


这篇关于关于聚合的文章或章节?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆