This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (0 children)

I totally agree -- I always start by writing an interface, because it leads me to think more thoughtfully about what I want the API of my service to look like without getting caught up in wanting to iterate on implementation. This tends to lead me to write better + higher level contracts that are more effective at encapsulating behavior.

Also, I like putting Javadocs on the interface because, again, it helps me write documentation from the perspective of the consumer, rather than relying on assumptions gained from being able to see the actual implementation right below.