17.3. Attributes

Modern programming languages often use declarative constructs to change the runtime behavior of the program. These constructs often exist in property files, .ini files, or configuration files. The Enterprise JavaBeans specification of Java uses declarative syntax to define the transactional behavior of the EJB. The standard policy file that ships with the JDK distribution contains security-related declarative constructs that dictate which Java classes get which permissions at runtime.

The C# language provides the System.Attribute class, which is used to model a declarative construct. Java does not have a first-class object for modeling declarative constructs. C# attributes can be used in the source code on specific code elements ...

Get .NET for Java Developers: Migrating to C# now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.