Search:

Home | Internet | Web Design & Development


.NET Metadata in the .NET Framework

By: christine layug

In the Microsoft .NET framework, the .NET metadata refers to certain data structures embedded within the Common Intermediate Language code that describes the high-level structure of the code.
Metadata describes all classes and class members that are defined in the assembly, and the classes and class members that the current assembly will call from another assembly. The metadata for a method contains the complete description of the method, including the class, the return type and all of the method parameters.
A .NET language compiler will generate the metadata and store this in the assembly containing the CIL. When the CLR executes CIL it will check to make sure that the metadata of the called method is the same as the metadata that is stored in the calling method. This ensures that a method can only be called with exactly the right number of parameters and exactly the right parameter types. Learn more of this with the austin .net consultant.
Developers can add metadata to their code through attributes. There are two types of attributes, the custom attributes and the pseudo custom attributes.
A custom attribute is a regular class that inherits from the Attribute class. A custom attribute can be used on any method, property, class or entire assembly with the syntax: [Attribute name(optional parameter, optional name=value pairs)] .
Custom attributes are used by the .NET Framework extensively. Windows Communication Framework uses attributes to define service contracts, ASP.NET uses these to expose methods as web services, LINQ to SQL uses them to define the mapping of classes to the underlying relational schema, Visual Studio uses them to group together properties of an object, the class developer indicates the category for the object's class by applying the [Category] custom attribute. Visit the austin .net consultant to learn more about this.
Custom attributes are interpreted by application code and not the CLR. When the compiler sees a custom attribute, it will generate custom metadata that is not recognized by the CLR.
A pseudo-custom attribute is used just like regular custom attributes but they do not have a custom handler; rather the compiler has intrinsic awareness of the attributes and handles the code marked with such attributes differently. For more information regarding .NET Framework, then visit the austin .net consultant for more details.
Attributes such as Serializable and Obsolete are implemented as pseudo-custom attributes. Pseudo-custom attributes should never be used by ILASM, as it has adequate syntax to describe the metadata.

Article Source: http://www.mycontentbuilder.com

www.astonishdesigns.com

Please Rate this Article

 

Not yet Rated

Click the XML Icon Above to Receive Web Design & Development Articles Via RSS!

Powered by Article Dashboard