开发者

Is it acceptable for an interface definition to contain references to other interfaces?

I was looking at the definition of Spring's PlatformTransactionManager which contains references to TransactionStatus and TransactionDefinition, two other interfaces.

Is this 开发者_如何学Cacceptable in general, an interface's definition containing references to other interfaces? When is it useful?


Yes it's acceptable. Why wouldn't it be ?

It's even better to have references to Interfaces instead of concrete classes for what it worth.


It's absolutely acceptable. Sometimes types need to refer to other types - and if those types in turn represent potentially complex services, it's useful to be able to abstract out a general type, often in the form of an interface.


Its possible... Thats one of the key aspects in implementing multiple inheritence


Yes. It is possible. I can not think of any scenario where it may create any problems.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜