• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Java 7: A Beginner's Tutorial": What not to use

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome Budi Kurniawan  to the ranch and good luck with your new book "Java 7: A Beginner's Tutorial".

With each new version of Java comes new features and depreciation of old features and APIs. I am curious, what old features are best to leave behind and which new features should be used in its place?
 
Author
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Eric,
Thank you for your question. Please see my answer below.

--> With each new version of Java comes new features and depreciation of old features and APIs. I am curious, what old features are best to leave behind and which new features should be used in its place?

I would certainly say the old IO API is one to leave behind in favor of NIO.2, even though, admittedly, this is not going to be easy as there are still billions of apps that contain the old API. If you're starting a new project, however, you should consider the new API as it's more stable than its predecessor.

Another one: the Java’s built-in support for writing multi-threaded applications, such as the Thread class and the synchronized keyword, should not be used anymore. They are hard to use correctly because they are too low level. Java 5 added the Concurrency Utilities in the java.util.concurrent package and subpackages. The types in these packages have been designed to provide better alternatives to Java’s built-in thread and synchronization features. (In my book, threads and the Concurrency Utilites are discussed in Chapter 23 and Chapter 24, respectively.)

Sample chapters (198 pages) are available here: http://books.brainysoftware.com/download/java7SampleChapters.pdf
 
Hold that thought. Tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic