D
Dathan
I'm working with a data retrieval / reporting system that I've
designed which is capable of generating sets of data from a database
according to some criteria. The various data set generators are
implemented via classes which inherit from my DataRetriever class, and
all interactions with them are done using a reference to the base
class. This all works fine. However, I've developed enough of these
reports now that it's becoming problematic to keep track of which one
does what. So I'd like to add static properties for name and
description. I'd like to do something like this:
interface IDataSetGenerator
{
static string Name { get; }
static string Description { get; }
}
That way when I create a list of available reports to run for the user
to choose, I can add the value of this static member as a description
to help the user pick the right report. However, the above code
doesn't compile, and I can't figure out if there's a general way to do
this. The only other idea I've had is to implement my own custom
attribute and attach it to each class, which would be fine except that
then these values would ONLY (AFAIK) be available for access via
reflection.
Any ideas on how I can implement this functionality?
designed which is capable of generating sets of data from a database
according to some criteria. The various data set generators are
implemented via classes which inherit from my DataRetriever class, and
all interactions with them are done using a reference to the base
class. This all works fine. However, I've developed enough of these
reports now that it's becoming problematic to keep track of which one
does what. So I'd like to add static properties for name and
description. I'd like to do something like this:
interface IDataSetGenerator
{
static string Name { get; }
static string Description { get; }
}
That way when I create a list of available reports to run for the user
to choose, I can add the value of this static member as a description
to help the user pick the right report. However, the above code
doesn't compile, and I can't figure out if there's a general way to do
this. The only other idea I've had is to implement my own custom
attribute and attach it to each class, which would be fine except that
then these values would ONLY (AFAIK) be available for access via
reflection.
Any ideas on how I can implement this functionality?