What was the Historical Precursor for .NET Attributes?

∥☆過路亽.° 提交于 2019-11-27 06:14:48

问题


What languages or platforms influenced the .NET 1.0 Team to build-in the concept of Attributes from the very start? Was this an Aspect-Oriented thing? Serialization? or something else? I was still in VB6-land at this time, and never used any of the pre-1.0 .NET versions.


回答1:


Believe it or not experiences/feedback from VB and Microsoft Transaction Server/COM+ dev teams had a bit part in some of the design rational of .NET, attributes and metadata.

VB6 added support for attributes/metadata that COM+/MTS could read and determine how an object should behave. Remember all those settings on your classes such as 'Requires Transaction', 'Requires New Transaction' and so on? They were effectively aspect orientated attributes. There's a great Don Box interview about all this somewhere, and when I find it again I'll post a link.




回答2:


I don't know if this is the originator, but they have been around in COM and MIDL for a long time. There weren't user-defined ones, but you had to attribute methods, types, etc, etc to make specific claims about the contracts in MIDL.




回答3:


Delphi/Object Pascal properties? If I remember correctly, one of the designers of Delphi is also one of the designers of .NET. The syntax is also similar.



来源:https://stackoverflow.com/questions/445332/what-was-the-historical-precursor-for-net-attributes

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