What was the Historical Precursor for .NET Attribu

2019-01-19 06:07发布

问题:

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.