Why do most system architects insist on first programming to an interface?

后端 未结 16 2327
离开以前
离开以前 2020-12-05 00:32

Almost every Java book I read talks about using the interface as a way to share state and behaviour between objects that when first \"constructed\" did not seem to share a r

16条回答
  •  情话喂你
    2020-12-05 01:15

    Its all about designing before coding.

    If you dont know all the relationships between two objects after you have specified the interface then you have done a poor job of defining the interface -- which is relatively easy to fix.

    If you had dived straight into coding and realised half way through you are missing something its a lot harder to fix.

提交回复
热议问题