考虑这些接口:
interface IBar
{
void bar();
}
interface IFoo : IBar
{
void foo();
}
#region
使用块对代码进行分组是很常见的。在实现的具体类IFoo
中,我可以想到两个有意义的区域配置。
我的问题是;哪个是首选约定?请激发你的回答。
A:
class Foo : IFoo
{
#region IFoo interface
void foo() {}
void bar() {}
#endregion
}
乙:
class Foo : IFoo
{
#region IFoo interface
void foo() {}
#endregion
#region IBar interface
void bar() {}
#endregion
}