• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

Design Patteren implemented in String?

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

Can anybody please let me know what design patteren is implemented in String class of JDK?

Regards
Parag
 
author and iconoclast
Posts: 24204
44
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"Design patterns," generally, are a way of describing the relationships between classes. It makes little sense to ask what design pattern a single class implements, just as it makes little sense to ask what sound a single hand makes in clapping.

If you explain to us where you got the idea to ask this question, maybe we could help you to figure out the answer.
 
par dhar
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I got this question from one intelligent(?!) developer...
Any way before asking this question I myself was not sure about this question.But I wanted to reconfirm my doubt.

But can you pls really confirm that String as a class does not implement any design patteren?
 
Ranch Hand
Posts: 1970
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think you can have a design pattern in a single class. The most common, though not necessarily good, example would be Singleton; this design pattern is often found in a single class.

I wonder if the "intelligent developer" was thinking of immutability. That is a particular implementation pattern, which solves certain problems, such as thread-safety. String is immutable (unless certain black arts are applied).
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I wonder if it also does Flyweight with the string pool.
 
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can somebody please suggest some good reading materials on design patterns. Preferably names of some good books having some good examples.
 
Ranch Hand
Posts: 381
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Go for Head First design patterns.
 
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think spring heavily use Factory Design patteren apart from other patterens like Singleton.
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Murali Mohan:
Can somebody please suggest some good reading materials on design patterns. Preferably names of some good books having some good examples.



Murali Mohan, please don't hijack someone else's topic to ask your question. We have a forum for general questions about patterns. Have a read through the topics in there, you should get some answers to go on.
 
Whose rules are you playing by? This tiny ad doesn't respect those rules:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic