Newsletter sign-up
View all newsletters

Sign up for our technology specific newsletters.

Enterprise Java
Email Address:

Automate dependency tracking, Part 1

Design an information model for automatically discovering dependencies in interactive object-oriented applications

  • Digg
  • Reddit
  • SlashDot
  • Stumble
  • del.icio.us
  • Technorati
  • dzone
In any interactive application, dependency tracking is one of the most significant problems you must solve. Usually, you apply some manual mechanism to update user interface (UI) components when the information model changes. For example, you might use the Observer pattern to notify registered objects of changes to a given subject. Or you might use the Publish/Subscribe pattern to broadcast changes to all listeners. Or you can route update messages with appropriate hints to all views. All these mechanisms work, but they all require effort by a person -- and that person will be you, the overworked programmer.

An automatic dependency tracking mechanism can handle most of that work for you. Using the automatic mechanism resembles programming with a spreadsheet; you simply enter formulas, and the computer figures out when to calculate them. The major difference is that the automatic mechanism is object-oriented and speaks Java.

The choice to track dependencies automatically is not based on laziness -- well, not entirely. By relieving the programmer from manually tracking dependencies, an automatic dependency mechanism removes a potential bug source. It also reduces the work needed to add features to the program. With a manual dependency mechanism, a program addition usually requires you to revisit prior dependencies to keep the user interface in sync with the model. However, when dependency is tracked automatically, the program discovers new dependencies on its own at runtime, with no programmer intervention. Of course, setting up such a mechanism takes some preparation.

In this series, you will learn what it takes to create an interactive application using automatic dependency tracking. Automatic dependency tracking separates the information model (IM) from the UI so that the UI discovers dependencies upon the IM and automatically updates itself. In this first installment, you will find out how to construct the IM for a dependency-tracking application. In Part 2, you will see how to build the UI on top of the IM. In Part 3, you will use dependency to solve some common application problems. Part 1 lays the groundwork for automatic dependency tracking. You won't actually see automatic dependency tracking in action until Part 2, but your patience will be rewarded.

Throughout the series we will develop Nebula, a drag-and-drop application for visually designing computer networks. With this application, network designers can model a physical network, determine addressing, and run simulations to discover problems. Admittedly, this is a complex example, but as you will see by the end of the series, automatic dependency tracking makes even complex problems quite manageable.

Read the whole series on automatic dependency tracking:



Let's start at the beginning: a properly designed information model.

  • Digg
  • Reddit
  • SlashDot
  • Stumble
  • del.icio.us
  • Technorati
  • dzone
Comment
Login
Forgot your account info?
Add comment
Anonymous comments subject to approval. Register here for member benefits.
Have a JavaWorld account? Log in here. Register now for a free account.
Resources