PC Review


Reply
Thread Tools Rate Thread

Attribute question

 
 
CSharper
Guest
Posts: n/a
 
      4th May 2009
I have bunch of dll's I want to add attribute to it so that at run
time, I can find out which dll method to invoke. My current plan is to
write a custom attribute and give it to the developers to use to
decorate the methods they want me to invoke during runtime. Custom
attribute works good. But every new dll people write they need to know
about my custom attributes. Is there a predefined attribute i can use
like comments or something? All I want in the attribute for the
developers to put is just method name and its description. I am trying
to avoid custom attribute and if there is an existing one I can use, I
can document it and pass it to developers. Less coupling.

Thanks.
 
Reply With Quote
 
 
 
 
Ignacio Machin ( .NET/ C# MVP )
Guest
Posts: n/a
 
      4th May 2009
On May 4, 2:59*pm, CSharper <cshar...@gmx.com> wrote:
> I have bunch of dll's I want to add attribute to it so that at run
> time, I can find out which dll method to invoke. My current plan is to
> write a custom attribute and give it to the developers to use to
> decorate the methods they want me to invoke during runtime. Custom
> attribute works good. But every new dll people write they need to know
> about my custom attributes. Is there a predefined attribute i can use
> like comments or something? All I want in the attribute for the
> developers to put is just method name and its description. I am trying
> to avoid custom attribute and if there is an existing one I can use, I
> can document it and pass it to developers. Less coupling.
>
> Thanks.


Hi,

It will be the same, they need to remember and know the "system"
attribute. The only possible advantage is that the dlls do not need to
make reference to your dll where you declare your attribute
 
Reply With Quote
 
CSharper
Guest
Posts: n/a
 
      4th May 2009
On May 4, 3:16*pm, "Ignacio Machin ( .NET/ C# MVP )"
<ignacio.mac...@gmail.com> wrote:
> On May 4, 2:59*pm, CSharper <cshar...@gmx.com> wrote:
>
> > I have bunch of dll's I want to add attribute to it so that at run
> > time, I can find out which dll method to invoke. My current plan is to
> > write a custom attribute and give it to the developers to use to
> > decorate the methods they want me to invoke during runtime. Custom
> > attribute works good. But every new dll people write they need to know
> > about my custom attributes. Is there a predefined attribute i can use
> > like comments or something? All I want in the attribute for the
> > developers to put is just method name and its description. I am trying
> > to avoid custom attribute and if there is an existing one I can use, I
> > can document it and pass it to developers. Less coupling.

>
> > Thanks.

>
> Hi,
>
> It will be the same, they need to remember and know the "system"
> attribute. The only possible advantage is that the dlls do not need to
> make reference to your dll where you declare your attribute


What attribute can I use? I am looking for a way to not to distribute
my dll and asking everyone to use it. If I could use default
attribute, that would be great. What default attribute would be a best
fit to enter name of the method and its description?
Thanks,
 
Reply With Quote
 
CSharper
Guest
Posts: n/a
 
      4th May 2009
On May 4, 3:35*pm, "Peter Duniho" <NpOeStPe...@nnowslpianmk.com>
wrote:
> On Mon, 04 May 2009 13:26:28 -0700, CSharper <cshar...@gmx.com> wrote:
> > What attribute can I use? I am looking for a way to not to distribute
> > my dll and asking everyone to use it. If I could use default
> > attribute, that would be great. What default attribute would be a best
> > fit to enter name of the method and its description?

>
> You can look at the attributes defined in .NET here:http://msdn.microsoft..com/en-us/lib...attribute.aspx
>
> Scroll down to the "Inheritance Hierarchy" section.
>
> That said, I didn't see anything in there that looks appropriate as a *
> general-purpose attribute. *And given the assumption that anyone writing *
> code that targets your code will need access to your code for testing *
> anyway, I don't think requiring them to reference your code so that they *
> can access your custom attribute is likely to be a serious problem.
>
> Pete


Ok then I will stay with my custom attribute logic. One side
question, there is allterante approach that i was looking at is to
have everyone follow an interface for the implementation. In this
approach all the need to know is the interface definition. Anyway, I
thought attribute is better than interface.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Question about the word Attribute in attribute class names KJ Microsoft C# .NET 2 15th Sep 2006 06:02 PM
A question about attribute Tony Johansson Microsoft C# .NET 3 8th Aug 2006 09:44 AM
attribute question Bob Microsoft VB .NET 1 16th May 2004 07:55 PM
Attribute question Zoltan Hernyak Microsoft Dot NET 0 4th Nov 2003 04:19 PM
attribute question Bob Microsoft VB .NET 1 25th Sep 2003 11:35 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:37 PM.