.NET and markup attributes - why?

Results 1 to 2 of 2

Thread: .NET and markup attributes - why?

  1. #1
    Join Date
    Dec 1969

    Default .NET and markup attributes - why?

    As a legacy VB and ASP programmer, I&#039;m confused by the rationale behind the new system in .NET of "attributes" marking up classes and methods. Why suddenly are we "decorating" our code with XML-type tags? Why are the attributes available both in the code object model and in this XMLish form, but not using the same syntax? Weren&#039;t ASP .NET code-behind pages supposed to help alleviate the confusion of mixing code and markup language on the same page? Instead, we have more markup.<BR><BR>Can you direct me to any articles that talk about the rationale behind attributes, or explain how .NET parses them, etc.? Or can someone brilliant like Scott Mitchell write an article about it for us?<BR><BR>Thanks<BR>Nancy Steinmann<BR>Working on MCAD .NET certification

  2. #2

    Default RE: .NET and markup attributes - why?

    The xml comments make it much harder to "miss" a method when you document your code. They are not compiled into the code.<BR><BR><BR>The attributes (System.Attribute) open up a lot of stuff when you are using reflection. I just did one where instead of looking at a property&#039;s name and calculating annother name from it, I was able to put an attribute on the property giving me the exact value.<BR>You could try starting from the System.Attribute namespace or http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpcondesign-timeattributesforcomponents.asp<BR><BR>TypeConvert ers and Designers are associated to properties and controls with a attributes.<BR><BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts