mercredi 19 mai 2021

Can too many interfaces be a bad thing? [closed]

I'm having a bit of a debate with another software engineer. His position is that you should break out interfaces as much as possible, to future-proof the design. For example:

class Employee
{
  String name, address, phone;
}

Would become:

class Employee : INameProvider, IAddressProvider, IPhoneProvider
{
  ...
}

At some point it gets ridiculous to have hundreds of interfaces, each with only one item in them. But where is the sweet spot?

Aucun commentaire:

Enregistrer un commentaire