モジュラー アプリケーションを開発する場合、 Fail-fastシステムを使用する必要があることは明らかですか?
モジュールが処理できないエラー状態がある場合にモジュールを作成する場合、誰がそれを処理するかを心配することなく、エラーを報告する必要があります (例外をスローするなど)。モジュール開発の目安になりそうです。これに問題はありますか?
編集:例
module.dll 内
public class SomeClass:ISomeInterface
{
public void CreateFile(string filename)
{
//The module have no idea who calls this. But there is something wrong
//somewhere so throw an exception early. The module writer has no control over
//how the exception is handled. So if this exception is not handled by the
//Client Application the application can potentially crash.Do he need to worry
//about that?
if(filename == null)
{
throw new ArgumentNullException("Filename is null");
}
//I think the following is bad. This code is making sure that a module
//exception wont crash the application.Is it good?
//if(filename ==null)
//{
//Logger.log("filename is null");
//return;
//}
}
}