Dynamic Behaviors in Java

Dynamically adapt program behavior at runtime

1 2 3 Page 3
Page 3 of 3

The Dynamic Behaviors pattern can provide better organization to programs that would otherwise need many if statements scattered throughout the code to implement conditional functions. However, like AOP, introducing Dynamic Behaviors into an application also complicates the control flow and makes it difficult to tell what code might execute before or after any given method of a particular class instance. Many problem domains are appropriate to the use of Dynamic Behaviors, but it is not a general-purpose programming technique. The judicious programmer must ensure that the benefits of a technology outweigh its costs before adopting it. Careful planning and diligent documentation practices are a must. If used correctly and carefully, the Dynamic Behaviors pattern provides a useful tool that will make your dynamic system design task easier to manage.

Greg Anderson is an engineering manager at Ricoh corporation. He has been involved in software development since 1990; he has worked in groups building application frameworks (MacApp), system software (Macintosh Finder), international software (Macintosh Japanese Input Method) and network appliances (Ricoh eCabinet and Ricoh embedded Java).

Learn more about this topic

This story, "Dynamic Behaviors in Java" was originally published by JavaWorld.

Copyright © 2004 IDG Communications, Inc.

1 2 3 Page 3
Page 3 of 3