When you're writing a program, the likelihood that there will be only a single object referencing another object is nearly zero. When you write programs using a language such as Java, object hierarchies will be created. There might be a root-level object referencing another object, which references a group of objects, each referencing multiple objects. When you consider such an architecture from a high-level point of view, the hierarchy can become very daunting.
The solution to such a hierarchy is to consider the hierarchy as a set of data that can be filtered, manipulated, collected, and moved. The hierarchy needs higher-level classes that allow a developer to treat the hierarchy as a dynamic data set that can be dynamically manipulated. Overall, this means that Java programs must be programmed using dynamic programming techniques. Of course, this refers only to the hierarchies, not to the entire program.
Some people may comment that writing dynamic code is not a good idea because it causes problems when a program is executed. People who like strong data typing say that a compiler will find errors ahead of time and hence will make an application more stable and robust. The programming language Python is an excellent example of how to manage dynamic data types. In Python, all data is dynamic but strongly typed. Python variables , once assigned, cannot be converted willy-nilly to another data type. That type of dynamic programming is the task of this chapter.