What are the similarities and differences between Java Annotations and C# Attributes?

前端 未结 4 1904
南方客
南方客 2020-12-12 22:04

I have a Java library I\'m considering porting to C#. The Java library makes extensive use of annotations (at both build time and run time.)

I\'ve never used C# att

4条回答
  •  旧巷少年郎
    2020-12-12 22:31

    Following up to what Jon said...

    Both Java 5 and Java 6 allow metaprogramming. Java 5 uses a separate apt tool; Java 6 integrates it into the compiler. (Though the Java 5 apt is still available in Java 6)

    Unfortunately each uses a different API.

    I'm currently using the Java 5 API for my Bean annotations

    See http://code.google.com/p/javadude/wiki/Annotations for an example (NOTE: I'm currently making some major updates, some of which change the API.)

    Very cool stuff... -- Scott

提交回复
热议问题