The Artima Developer Community
Sponsored Link

Java Buzz Forum
CharSequence: one of those quiet gems

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
dion

Posts: 5028
Nickname: dion
Registered: Feb, 2003

Dion Almaer is the Editor-in-Chief for TheServerSide.com, and is an enterprise Java evangelist
CharSequence: one of those quiet gems Posted: Feb 21, 2005 10:23 AM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by dion.
Original Post: CharSequence: one of those quiet gems
Feed Title: techno.blog(Dion)
Feed URL: http://feeds.feedburner.com/dion
Feed Description: blogging about life the universe and everything tech
Latest Java Buzz Posts
Latest Java Buzz Posts by dion
Latest Posts From techno.blog(Dion)

Advertisement
When is a String not a String?. Simon Harris has brought up the nice CharSequence interface that both Strings and StringBuffers implement. This means that we can pass around the interface and let us give the implementation later. Maybe it would be nice to have had 'String' be an interface itself, and when you coded: String foo = "bar" it would create an ImmutableString which implements String. Then we could come up with crazy implementations of String :) However, we would run into a lot of security concerns, as people could sneak in BackdoorStringWhichEmailsMeYourPassword. Anyway, CharSequence has been a very useful interface for me too, for those cases where I really do want to encapsulate multiple impls.

Read: CharSequence: one of those quiet gems

Topic: [Feb 15, 2005 15:07 PST] 11 Links Previous Topic   Next Topic Topic: Off-the-Record Messaging for the Paranoid

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use