O'Reilly logo

Design Patterns Java™ Workbook by Steven John Metsker

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Composites with Cycles

The nontree composite that Challenge 5.4 refers to was an accident. For physical objects, you may want to disallow the notion that an object is contained by more than one other object. Physical objects also usually cannot appear in cyclic models, in which an object ultimately contains itself. However, a problem domain can have nonphysical elements where cycles of containment make sense. This occurs frequently when modeling process flows.

Consider the construction of aerial shells such as the one that Figure 5.6 depicts. We launch a shell from a mortar by igniting the lifting charge of black powder that is seated beneath the core charge. The secondary fuses burn while the shell in the air, eventually reaching the core. When ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required