Home > Articles > Programming > Java

  • Print
  • + Share This
From the author of

Interfaces and Classes

Sometimes the project has no entry point. If the project is a library, it may have no executable attached to it at all, except in sample files. At this point, the question becomes, "What classes do I want to create and what methods do I want to call?"

For Java programs, the Javadoc can be very helpful at this point. In its default mode, Javadoc looks only at public and protected methods, not at the package and private methods. Although you as the software maintainer have access to all code, no matter how private (or, for that matter, commented out), the public and protected classes and methods are a clue as to what the original developers intended to be for public consumption.

Interfaces are a very good place to begin looking for clues. Interface methods are all implicitly public. Although interfaces never contain any executable code, they define the things that the programmers considered important enough that they might be reused, or where the implementation is central enough to the program that it may change. The interface is the way a team member shares information about what's going on in one portion of the project, without having to expose the exact implementation. The implementation may not even be done, or may be in flux, but the interface gives the other developers a clue about what's important. So start by looking at interfaces. Once you find an interface you consider important, you then have to go about the further step of finding the implementation.

  • + Share This
  • 🔖 Save To Your Account