Kourosh Ebrahiminejad’s Post

View profile for Kourosh Ebrahiminejad

Senior .NET Developer | C#, ASP.NET Core, EF Core | Microservices | Integration Expert | Open to Remote Opportunities

Good architecture whispers. Bad architecture shouts. That’s exactly how I see the Interface Segregation Principle in action. You don’t need one giant interface doing everything - you need small, focused contracts that quietly keep your domain clean. Here’s how I keep things clean:   public interface ISoftDeletable   {   bool IsDeleted { get; set; }   }       public interface IExpirable   {   DateTime? PublishDateTime { get; set; }   DateTime? ExpiryDateTime { get; set; }   bool IsPublished { get; }   bool IsExpired { get; }   }   public interface ITrackable   {   DateTime CreatedAt { get; set; }   DateTime? ModifiedAt { get; set; }   } And in my domain:   public class Page : Int32EntityBase, IExpirable, ITrackable   {   // Properties omitted for brevity       public DateTime? PublishDateTime { get; set; }   public DateTime? ExpiryDateTime { get; set; }   public bool IsPublished { get; private set; }   public bool IsExpired { get; private set; }       public DateTime CreatedAt { get; set; }   public long CreatedById { get; set; }   public DateTime? ModifiedAt { get; set; }   public long ModifiedById { get; set; }   } Each entity gets only what it really needs. No extra noise. No “NotImplementedException” drama. ✅ Why it works - Clean separation of concerns - Easier to test and refactor - More composable and reusable - Better readability and intent clarity Because at the end of the day: Good design doesn’t scream for attention - it just works.  #DotNet #CSharp #SOLID #InterfaceSegregation #CodeQuality #CleanCode

To view or add a comment, sign in

Explore content categories