I just realized that partial classes will encourage AOP. A small example of this is with respect to import statements. A class might have a dozen import statements. Each import relates to specific functionality of the class. If those functions are largely independent, you can now separate them into multiple partial classes, even within the same source file. Consequently, the import statements are closely associated with the implementation.
For example, this code would appear within one file. Obviously, only one class is being defined.
namespace Sample.Something
{
using System.Web;
using System.Web.Services;
[WebService]
public partial class FooService : System.Web.Services.WebService
{
[WebMethod] public Foo[] Search() { ... }
}
}
namespace Sample.Something
{
using System.Xml;
using System.Xml.Serialization;
public partial class FooService
{
internal void SerializeToXml(XmlWriter writer) { ... }
}
}
namespace Sample.Something
{
using System.IO;
public partial class FooService
{
internal void WriteLog(Stream s) { ... }
}
}