c# - Is it best practice for every property on a class to conform to an interface? -


i increasingly seeing examples of style. happens irrespective of whether interface ever needed. in other case, adoption of new interfaces prove helpful. however, cannot predicted whether used or not new interfaces created new properties conform to... best practice or not?

as usual, depends. if you're writing public api, approach extremely powerful. example of progistics / connectship api. @ time used it, there single concrete class. rest of public interface interfaces. able rip out entire implementation of product , rewrite it, leaving interfaces untouched.

of course, there cost associated this. have put lot of front time , effort making elegant api if you're going want cast in stone (of course, case whether choose use interfaces or not).

on other hand, if you're writing data access layer internal business application, might not reap many rewards.


Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -