The Artima Developer Community
Sponsored Link

Java Buzz Forum
Whatever Happened to "Never Change Your Interfaces" (JDK 5.0 Horrors)

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
Weiqi Gao

Posts: 1808
Nickname: weiqigao
Registered: Jun, 2003

Weiqi Gao is a Java programmer.
Whatever Happened to "Never Change Your Interfaces" (JDK 5.0 Horrors) Posted: Sep 25, 2004 12:09 AM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Weiqi Gao.
Original Post: Whatever Happened to "Never Change Your Interfaces" (JDK 5.0 Horrors)
Feed Title: Weiqi Gao's Weblog
Feed URL: http://www.weiqigao.com/blog/rss.xml
Feed Description: Sharing My Experience...
Latest Java Buzz Posts
Latest Java Buzz Posts by Weiqi Gao
Latest Posts From Weiqi Gao's Weblog

Advertisement

Reading through the new JDK 5.0 documentation, I found this piece of gem:

In DOM level 3, additional methods were defined in the following interfaces:

  • Attr
  • Document
  • DOMImplementation
  • Element
  • Entity
  • Node
  • Text

The added methods only affect applications that implement the interfaces directly, and only then when the application is recompiled. Applications that use the factory methods to obtain implementation classes for these interfaces will have no problems.

After years of yelling at people "Don't ever change your interfaces, you will break other peoples code," I feel pretty annoyed by this.

True, 5.0 is a compatibility breaking upgrade (if you have ever written code like Enumeration enum = myVector.elements(); back in the 1.1.4 days), but adding public methods to interfaces is a crime much more severe.

Even in the old 1.1.x days people know to introduce new and improved interfaces with a different name: LayoutManager2 vs. LayoutManager.

On a practical level, this means that even after I have upgraded to JDK 5.0, I have to keep a copy of JDK 1.4.2_05 around just to compile old code that implements the narrower interfaces, until everybody in the world have patched their code for 5.0!

Read: Whatever Happened to "Never Change Your Interfaces" (JDK 5.0 Horrors)

Topic: [Sep 13, 2004 14:13 PDT] 12 Links Previous Topic   Next Topic Topic: Any suggestions for the Oracle OpenWorld in Amsterdam

Sponsored Links



Google
  Web Artima.com   

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