473,387 Members | 1,545 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Attributes and Reflection

Hello,
I am quite new to C# and when reading over a couple of books discovered
the presence of reflection and attributes.

While, I do understand them a little, it would be great if I could know a
little more about how they are actually used in commercial apps that devs
are writing.

Any pointers to articles/books/websites would be very helpful.

Thanks.
Nov 15 '05 #1
1 1397
Using Custom Attributes for Validation
http://www.microsoft.com/belux/nl/ms...ttributes.mspx
Attributes can be used to decorate language elements with additional
information that can be retrieved at run time by using Reflection. You can
easily build your own custom attributes to create powerful generic
solutions. At first sight they might to seem a little bit useless. But this
article shows how they can be used to create a simple extensible framework
to provide validation of property values.

Being flexible: CodeDom + Reflection = Killer Combo
http://weblogs.asp.net/jan/posts/28744.aspx

--
Greetz,
Jan
__________________________________
Read my weblog: http://weblogs.asp.net/jan
"Hari" <an*******@discussions.microsoft.com> schreef in bericht
news:uw**************@TK2MSFTNGP12.phx.gbl...
Hello,
I am quite new to C# and when reading over a couple of books discovered the presence of reflection and attributes.

While, I do understand them a little, it would be great if I could know a
little more about how they are actually used in commercial apps that devs
are writing.

Any pointers to articles/books/websites would be very helpful.

Thanks.

Nov 15 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: AlexB | last post by:
A windows forms .NET application has various built in attributes like: <Assembly: AssemblyTitle("MyAssembly")> <Assembly: AssemblyDescription("Blahblah")> <Assembly: AssemblyCompany("XYZ")> ...
5
by: Martin | last post by:
Hi All, I'm trying to get at the data in a variable marked with my custom attribute. I'm not entirely sure where to begin. I've created my attribute class which is okay but at runtime I want to...
3
by: Mark R. Dawson | last post by:
Hi all, I am trying to get custom attributes from a property. I can do this if I pass in the name of the property i.e. "Name" to the reflection methods, but if I pass in set_Name which is what...
3
by: vivekian | last post by:
Hi , I am moving on from C++ to C# . Though have understood how attributes work , still dont understand what need do the fullfil ? Where should they be used ? What are their advantages ? some...
2
by: prabhupr | last post by:
Hi Folks I was reading this article (http://www.dotnetbips.com/articles/displayarticle.aspx?id=32) on "Custom Attribute", written by Bipin. The only thing I did not understand in this article...
15
by: Jeff Mason | last post by:
Hi, I'm having a reflection brain fog here, perhaps someone can set me on the right track. I'd like to define a custom attribute to be used in a class hierarchy. What I want to do is to...
2
by: Marc Gravell | last post by:
It appears that when using the component model (or the default implementation, at least), then any duplicated attributes (e.g. from properties) are dropped. In my test, component-model outputs...
5
by: =?Utf-8?B?cGFnYXRlcw==?= | last post by:
Hello All, I am sure that I am just overlooking something, but here's something I can't quite get right... I want to be able to get the value of a parameter of an unknown custom attribute at...
7
by: bstieve | last post by:
Hi all, i'm looking at the next problem. i'm trying to get the names of attributes of object or of types. example class test private name as string sub new (byval test as string) me.name =...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.