• Post Reply Bookmark Topic Watch Topic
  • New Topic

System.out.println() violates which Design Pattern?  RSS feed

 
Jay Vaghela
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
System.out.println() violates which Design Pattern?

cc. Principle of List knowledge
dd. Demeter
ee. Both A and B
 
Campbell Ritchie
Marshal
Posts: 56546
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It does of course violate design pattern F.

We don't simply give answers to that sort of question; we like you to tell us what you think, then we'll see whether we agree with you. And please tell us where that question is from.
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The answer is "G", "Neither of these are design patterns."

Additionally, neither of these applies (anyone who thinks LoD applies here doesn't understand LoD.)
 
Jay Vaghela
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Of course, I am clueless to the answer but I have been asked this question in my current organization's internal exam. And our org. bought it from the professional sources.

Apprisiate if someone throws some lights by providing answer.
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I did give you the answer. Seriously, the question is complete and total gibberish. Both of these items are actually names for the same thing, so there isn't really even a choice.
[ December 18, 2008: Message edited by: Ernest Friedman-Hill ]
 
Steve Luke
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by jay vaghela:
System.out.println() violates which Design Pattern?

cc. Principle of List knowledge
dd. Demeter
ee. Both A and B


You gave us answers C, and D, and E, which is both A and B, but what are options A and B?

What do you think these 2 (4?) designs mean? Knowing what the design patterns are, which do you think is the most likely answer? Why?

When you get questions like this, it is a good opportunity to do some research rather than simply ask in a forum for an answer.
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok, I'll bite. Why doesn't System.out.println() violate LoD ? (I guess I don't understand LoD)
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!