次のインターフェイスを検討してください。
interface IBar
{
void bar();
}
interface IFoo : IBar
{
void foo();
}
#region
ブロックを使用してコードをグループ化することは一般的です。を実装する具体的なクラスIFoo
では、意味のある 2 つの領域構成を考えることができます。
私の質問は; どちらが好ましい慣習ですか? あなたの答えを動機付けてください。
A:
class Foo : IFoo
{
#region IFoo interface
void foo() {}
void bar() {}
#endregion
}
B:
class Foo : IFoo
{
#region IFoo interface
void foo() {}
#endregion
#region IBar interface
void bar() {}
#endregion
}