Google
 
Web www.download-reference-books.blogspot.com

Tuesday, July 17, 2007

A Programmer’s Introduction to C#, Second Edition


A Programmer's Introduction to C#, Second Edition
By Eric Gunnerson
IN MOST PROGRAMMING LANGUAGES, some information is expressed through declaration, and other information is expressed through code. For example, in the following class member declaration
public int Test;
the compiler and runtime will reserve space for an integer variable and set its protection so that it is visible everywhere. This is an example of declarative information; it's nice because of the economy of expression and because the compiler handles the details for us.
Typically, the types of declarative information are predefined by the language designer and can't be extended by users of the language. A user who wants to associate a specific database field with a field of a class, for example, must invent a way of expressing that relationship in the language, a way of storing the relationship, and a way of accessing the information at runtime. In a language like C++, a macro might be defined that stores the information in a field that is part of the object. Such schemes work, but they're error-prone and not generalized. They're also ugly.
The .NET Runtime supports attributes, which are merely annotations that are placed on elements of source code, such as classes, members, parameters, etc. Attributes can be used to change the behavior of the runtime, provide transaction information about an object, or convey organizational information to a designer. The attribute information is stored with the metadata of the element and can be easily retrieved at runtime through a process known as reflection.
C# uses a conditional attribute to control when member functions are called. A use for the conditional attribute would look like this:
using System.Diagnostics;
class Test
{
[Conditional("DEBUG")]
public void Validate()
{
}
}
Most programmers will use predefined attributes much more often than writing an attribute class.........

Labels: ,

Programming Tutorials Links

  • C Programming Tutorials

  • C++ (C Plus Plus) Programming Tutorials

  • CGI Programming Tutorials

  • CORBA Programming Tutorials

  • CSS2, CVS & DHTML Tutorials

  • EMAC Programming Tutorials

  • Expect & Fortran Programming Tutorials

  • GIMP Tutorials & Guide

  • GNOME Programming Tutorials

  • GTK Tutorials & Reference Manuals

  • Gnuplot - Plotting Program Tutorials

  • HTML Tutorials & Examples

  • ILU Tutorials & Reference Manuals

  • IP Masquerade, IPChains Tutorials

  • IPC - Interpprocess Communication Tutorials

  • JAVA Programming Tutorials 1

  • JAVA Programming Tutorials 2

  • JavaScript Tutorials & Reference

  • LISP Programming Tutorials

  • MIDI & Music Synthesis Tutorials

  • ML Tutorials

  • MPI Programming Tutorials

  • Matlab Tutorials & Manuals

  • Misc., Tutorials

  • Motif Programming Tutorials

  • OpenGL Programming Guide & Tutorials

  • PHP - MySQL Tutorials

  • PVM & Pascal Tutorials

  • Perl Programming Tutorials

  • PostScript Programming Tutorials

  • Povray & Prolog Programming Tutorials

  • Python Reference Manuals & Tutorials

  • REXX Programming Tutorials

  • RPC - Remote Procecure Call Tutorials

  • Ruby Programming Tutorials

  • SCSI, SSI & STL Tutorials

  • SQL, MySQL Tutorials


  • Google
     
    Web www.download-reference-books.blogspot.com

    Download 1000's of ebook links in one zip file(10KB)