0

I was reading this question about the singleton pattern (the singleton pattern is a design pattern, and a design pattern is rather like an "idiom for programmers").

Now, someone said:

[the Singleton Pattern is] a fully paid up member of the GoF Design Patterns book.

(the GoF book is a well-known book describing various design patterns). What did he mean by that statement?

  • It is a strained metaphor. – Tᴚoɯɐuo Aug 14 '18 at 12:47
1

It's a metaphor.

When you apply to join a club (for example a golf club), you may be accepted, but you don't get the benefits until you pay the club fees. When you have paid the fees, then you are a "fully paid-up member of the club" A "fully paid-up member" can use the golf course and all the club facilities. Some clubs offer "associate membership" or "honorary membership" or other lesser forms of membership.

The metaphor has the book in place of the club, and the various design patterns as members of the club. So it means that this pattern is fully discussed and recommended by the book, and not just mentioned in passing.

  • I can't quite agree with your last statement; you're missing a key point here. It's not merely that the pattern "is not just mentioned in passing." Rather, it's expressing some surprise that this pattern is recognized as a member of this prestigious club. There could be several reasons for such surprise, but, in this case, it's because the author believes that, more often than not, it would be a bad idea to use this pattern. Because design patterns are supposed to promote sound, reusable designs, it's surprising (to some) that this one gets included. – J.R. Aug 14 '18 at 9:35
  • @J.R. Where do you detect the surprise? The reason they're bad is that they feel like a global and they're a fully paid up member of the GoF Design Patterns book. – Tᴚoɯɐuo Aug 14 '18 at 12:47
  • 1
    I've now looked at the linked S.O. question. The author thinks singletons are okay and mentions that they are in a well-known book as further evidence that they are a good idea; then they ask why others have a problem with them. I don't think the surprise is actually relevant to this question. The metaphor decodes to mean that "Singletons are fully discussed in the GoF book" whether that is surprising or not is not really relevant. – James K Aug 14 '18 at 12:54
  • @Tᴚoɯɐuo - The way I read it, it's as though the writer is saying, "they feel like a global and yet they're a fully paid up member of the GoF Design Patterns book", or "[even though] they feel like a global, they're [still] a fully paid up member of the GoF Design Patterns book." – J.R. Aug 14 '18 at 13:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.