I'm a .NET developer learning Java EE. These two concepts seem to serve the same exact purposes in either system.
So which framework gets credit for inventing them?
I'm a .NET developer learning Java EE. These two concepts seem to serve the same exact purposes in either system.
So which framework gets credit for inventing them?
I believe they came first with .NET; Java 5 followed.
Java has unfortunately been behind the curve on language improvents despite the fact it was the language C# was modeled after.
Pierreten's comment is correct, but I think there are several factors that explain it:
.NET metadata was, I believe, introduced in .NET 1.1 which was released 3 April 2003 (it appears to be already in before that?). The Java annotations were proposed as JSR-175 on 19 March 2002 which was approved on 30 September 2004 and became part of Java SE 5.0 which was released the same day.
It's unclear when exactly .NET metadata was proposed, but when it comes to the first release, .NET wins.
Attributes have been part of the CLR since its inception. I have an old prerelease spec of C# printed out from November 1999 that describes them, but the earliest reference I can find is the C# 1.0 spec from 2001. This was clearly several years before the feature was added to Java.
EDIT: The book, C# Programming with the Public Beta, was published in 2000 and mentions attributes.