C# Annotations – History and Concept of Code Annotation

annotationsc

C# and Java has code attribute and code annotation. I don't know about other languages, but I know the code annotation feature is used to expand language itself.

I knew what it is, but I want to know how it developed over time. I want to know its history. How it demanded and how it implemented. Is this possible to implement this in kind of concept on LISP, Smalltalk or C++?

And is there a general term to call the concept of annotation?

Best Answer

This usually is related to reflection, since reflection is the only way to look at attributes or annotations (depending on the language). So it might be possible for LISP but not for C++.

Also, annotations are only a series of name/values that are tagged to a specific class, method, field, etc.

So inside the meta-object that stores information about a class (ex. it's methods, fields, etc.), one needs to add another map (or list) that contains information about all the attributes an class or method contains.

Obviously, if you don't know what a meta-object is, you should study meta-programming a little, particularly CLOS (Common Lisp Object System), that is the mother of all languages implementing metaprogramming.

Related Topic