Hi,
Bei mir hat jedes Bauteil einen standard Error Ausgang. Die einfachen
FUs leiten sich dabei immer von der "ComponentBase" ab.
Beispiel:
class Count_Uppercase_Characters : ComponentBase<string, int>,
ICount_Uppercase_Characters
{
public override int Process(string msg)
{
if(msg == null)
throw new YourCustomException();
// implementation...
}
}
Meine einfachen Bauteile bieten immer eine Input Methode und eine
Output Action, die über ComponentBase implementiert werden.
Die Input Methode:
public TOut Input(TIn msg)
{
//common validation logic (depencies, config, etc.)
try
{
Output(Process(msg));
}
catch(Exception e)
{
OnError(e);
}
}
Gruß,
Patrick