Programming with Attributes

I l @ ve RuBoard

.NET makes practical use of an attributed programming system that allows objects or methods to be extended in a particular way. C# has no provision for templates or macros. These are well known to C++ programmers as a way to aggregate functionality or provide cookie cutter behaviors. Attributes, like macros or templates, insert code into your software that applies certain rules to replaceable elements. For example, it is possible to turn a seemingly mundane C# class with three or four lines of code into a full-blown Internet Web service by using the attribute [WebMethod] in the source code. Using this technique, it is possible to create something akin to a full IIS server extension DLL in just a few moments, and have the service running live on the Internet in a minute or two. It's even possible to design your own attributes.

I l @ ve RuBoard


C# and the .NET Framework. The C++ Perspective
C# and the .NET Framework
ISBN: 067232153X
EAN: 2147483647
Year: 2001
Pages: 204

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net