mercredi 11 décembre 2019

When is it okay to depend on concrete classes?

Today I was asked a question I could not find an answer for so here I am, asking for your help! The dependency inversion principle states that both concrete classes and abstractions should depend on abstractions right?

Regardless of that we still depend on framework classes like Integer and String. Is there a good answer as to why that is okay?

I know we should not reinvent the wheel just because it may change ever so slightly, besides these particular classes I mentioned will most likely never change in a way their users will notice (their interfaces won't change).

Have a good one!

Aucun commentaire:

Enregistrer un commentaire