let's say that I have
public delegate DataSet AutoCompleteDelegate(
string filter, long rowOffset);
Can I make the following class to enforce this method signature? (just a hint idea):
public class MiddleTier
{
[Follow(AutoCompleteDelegate)]
public DataSet Customer_AutoComplete(string filter, long rowOffset)
{
var c = Connect();
}
[Follow(AutoCompleteDelegate)]
public DataSet Item_AutoComplete(string filter, long rowOffset)
{
var c = Connect();
}
[Follow(AutoCompleteDelegate)]
public DataSet BranchOffice_AutoComplete(string filter, string rowOffset)
{
var c = Connect();
}
}
[EDIT]
Purpose: I have already placed the attributes in my middletier methods. I have methods like this:
public abstract class MiddleTier : MarshalByRefObject
{
[Task("Invoice", Operation.Save)]
public Invoice_Save(object pk, DataSet delta);
[Task("Receipt", Operation.Save)]
public Receipt_Save(object pk, DataSet delta);
[Task("Receipt", Operation.Save)]
public Receipt_Save(object pk, object[] delta);
}
then at runtime I will iterate over all the middletier methods and put them in a collection (there are a lot of attributes here), and then map them to the winform delegate functions (facilitated by the interface, a system based on plugins) as loadable
I think if I can make the attributes more self-describing, so the compiler can catch the inconsistencies.
namespace Craft
{
public abstract class MiddleTier : MarshalByRefObject
{
[Task("Invoice", SaveDelegate)]
public abstract Invoice_Save(object pk, DataSet delta);
[Task("Receipt", SaveDelegate)]
public abstract Receipt_Save(object pk, object[] delta);
}
}
, , , Remoting. , , , , Invoice_Save Receipt_Open. (), Remoting middletier DataSet, , DataSet, Middletier, roundtrips, ( )