News for hackers. Stuff that matters.
Re:How to Design Programs 2nd Edition by simplotek on Tuesday May 02, 2023 @11:15AM (#35788803)
> it's merely adding a bunch of public methods (and interfaces)

What do the interfaces represent?

Re:How to Design Programs 2nd Edition by Joker_vD on Tuesday May 02, 2023 @11:42AM (#35789316)
In this case, nothing particularly meaningful or useful, they mostly just shrink wrap the underlying (single) implementation's details and re-expose them as-is for the caller to cope with. Some people also think that that somehow helps with encapsulation too.
Re:How to Design Programs 2nd Edition by simplotek on Tuesday May 02, 2023 @02:27PM (#35792080)
> In this case, nothing particularly meaningful or useful

You're either playing dumb or weren't able to understand what was in the code. IHelloWorldString is an abstraction over the way the string was implemented, IPrintStrategy is a strategy pattern that abstracts away how the abstract hello world string is supposed to be printed, and finally IStatusCode is an abstraction over how a status code is implemented.

> they mostly just shrink wrap the underlying (single) implementation's details and re-expose them as-is for the caller to cope with.

No, not really. Their purpose is to abstract away implementations. Just because there's a single implementation that does not mean this wasn't abstracted away.