Skip to main content
2 of 3
deleted 52 characters in body
gnat
  • 20.9k
  • 29
  • 115
  • 295

Explanation needed, for “Ask, don't tell” approach?

I'm taking a course on design patterns in software engineering and here I'm trying to understand the good and the bad way of design relating to "coupling" and "cohesion".

I could understand the concept described in the following image. enter image description here The example of code shown in the image is ambiguous to me, so I can't quite clearly get what exactly "Ask, don't tell!" approach mean. Could you please explain?

the_naive
  • 143
  • 1
  • 5