Number of Members in Interfaces

Problem
You want to know how many methods to include in an interface.

Solution
Limit interfaces to six methods. If additional methods are needed, create base interfaces and derive from them.

Comments
A great example of interface inheritance is IList in the System.Collections namespace. The interface contains 13 methods if you include extension methods, and many of them inherit from ICollection and IEnumerable.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s