Click here to Skip to main content
16,015,177 members

Survey Results

Do you use Attributes in your .NET development?   [Edit]

Survey period: 17 Oct 2011 to 24 Oct 2011

Attributes provide a neat way to hide the plumbing. Do you use and/or create attributes yourself?

OptionVotes% 
Extensively626.31
Often17017.31
Occasionally27928.41
Rarely19419.76
Never787.94
I am unfamiliar with Attributes in .NET19920.26



 
GeneralIt's awesome when you figure its power Pin
Fabio Franco21-Oct-11 2:17
professionalFabio Franco21-Oct-11 2:17 
GeneralRe: It's awesome when you figure its power Pin
Rakesh Meel23-Oct-11 19:48
professionalRakesh Meel23-Oct-11 19:48 
GeneralYes, When in my first week of new contract Pin
raju melveetilpurayil20-Oct-11 11:54
professionalraju melveetilpurayil20-Oct-11 11:54 
GeneralAttributes are the undead citizens of the .net code world. Pin
dave.dolan20-Oct-11 8:50
dave.dolan20-Oct-11 8:50 
GeneralRe: Attributes are the undead citizens of the .net code world. Pin
Fabio Franco21-Oct-11 5:40
professionalFabio Franco21-Oct-11 5:40 
GeneralRe: Attributes are the undead citizens of the .net code world. Pin
dave.dolan21-Oct-11 5:46
dave.dolan21-Oct-11 5:46 
GeneralRe: Attributes are the undead citizens of the .net code world. Pin
Fabio Franco21-Oct-11 6:07
professionalFabio Franco21-Oct-11 6:07 
GeneralRe: Attributes are the undead citizens of the .net code world. Pin
dave.dolan21-Oct-11 6:11
dave.dolan21-Oct-11 6:11 
GeneralRe: Attributes are the undead citizens of the .net code world. Pin
Fabio Franco21-Oct-11 6:21
professionalFabio Franco21-Oct-11 6:21 
GeneralRe: Attributes are the undead citizens of the .net code world. Pin
dave.dolan21-Oct-11 6:27
dave.dolan21-Oct-11 6:27 
GeneralRe: Attributes are the undead citizens of the .net code world. Pin
Fabio Franco21-Oct-11 6:43
professionalFabio Franco21-Oct-11 6:43 
GeneralRe: Attributes are the undead citizens of the .net code world. Pin
dave.dolan21-Oct-11 6:45
dave.dolan21-Oct-11 6:45 
GeneralRe: Attributes are the undead citizens of the .net code world. Pin
Fabio Franco21-Oct-11 6:49
professionalFabio Franco21-Oct-11 6:49 
GeneralRe: Attributes are the undead citizens of the .net code world. Pin
PIEBALDconsult21-Oct-11 9:38
mvePIEBALDconsult21-Oct-11 9:38 
GeneralReflection + Attributes = FUN Pin
milkplus18-Oct-11 5:36
milkplus18-Oct-11 5:36 
GeneralRe: Reflection + Attributes = FUN Pin
Fabio Franco21-Oct-11 5:35
professionalFabio Franco21-Oct-11 5:35 
GeneralMostly with enumerations Pin
PIEBALDconsult17-Oct-11 18:13
mvePIEBALDconsult17-Oct-11 18:13 
GeneralRe: Mostly with enumerations Pin
ThatsAlok17-Oct-11 20:37
ThatsAlok17-Oct-11 20:37 
Generalwhat?? Pin
Dennis E White17-Oct-11 10:26
professionalDennis E White17-Oct-11 10:26 
GeneralRe: what?? Pin
CDP180217-Oct-11 11:27
CDP180217-Oct-11 11:27 
A webservice is implemented as a class like any other. It can have many methods, but not all should be exposed as webmethods of the service. That's why you decorate the class itself with the 'webservice' attribute to specify that this class will act as a webservice and exposes webmethods. And only those methods wich are supposed to become webmethods get the 'webmethod' attribute. When the webservice is compiled, the attributes are being read and the classes and methods with those attributes will be used to generate the service description and the code to access the webservice.

When you write your own controls, you can use attributes to show or hide them from the Visual Studio toolbox or determine which ones of the control's properties appear in the properties window.

When you intend a class for serialisation, you can use attributes to control which properties and public members are serialized and which are not.


Or, more general, attributes are simple data objects which give another class (which reads the attributes via reflection) information on how to use the class or its methods, properties or member variables. You can even write your own attributes for some purpose, but they will be of little use unless you write another class which looks for and uses those attributes when objects are passed as parameters.
And from the clouds a mighty voice spoke:
"Smile and be happy, for it could come worse!"

And I smiled and was happy
And it came worse.



GeneralRe: what?? Pin
Dennis E White17-Oct-11 11:35
professionalDennis E White17-Oct-11 11:35 
GeneralRe: what?? Pin
Stonkie17-Oct-11 11:54
Stonkie17-Oct-11 11:54 
GeneralRe: what?? Pin
Edward Steward3-Dec-11 23:15
Edward Steward3-Dec-11 23:15 
GeneralRe: what?? Pin
PIEBALDconsult17-Oct-11 18:09
mvePIEBALDconsult17-Oct-11 18:09 
GeneralRe: what?? Pin
Keith Barrow18-Oct-11 0:35
professionalKeith Barrow18-Oct-11 0:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.