Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Flyweight and java.lang.String

 
Dan Drillich
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good Day,

My study guide says that the java.lang.String class is associated with the Flyweight pattern.

Do you know what the authors meant by this statement?

Thanks,
Dan
 
Ajith Kallambella
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you search?

Here is a thread that I answered a while ago on the same topic.
 
Dan Drillich
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Ajith for your responses.

We spoke about this issue in the yahoo forum and Kirill posted a nice Java code which demonstrates the pattern.

http://groups.yahoo.com/group/scea_j2ee/message/23717



It's also interesting to see what the java.lang.String.intern
documentation says:

Returns a canonical representation for the string object.
A pool of strings, initially empty, is maintained privately by the
class String.


Thanks,
Dan
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic