The Artima Developer Community
Sponsored Link

A more real world example?

Advertisement

Advertisement

This page contains an archived post to the Design Forum (formerly called the Flexible Java Forum) made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

A more real world example?

Posted by Sieg du Preez on 11 Sep 1998, 4:38 AM

A further extension to your example could be made to reflect the real world.

Telephone is a sub-class of a SoundGenerator. Person is a aggregated class and one of it is members is Ear. Ear is an implementation of SoundListener which listens to SoundEvents. SoundEvents have a dB-level attribute of the sound. SoundGenerator has locality so that each Ear should make a calculation to determine if he can hear the sound. It depends on the dB-level, his distance from the source and his own hearing ability.

In the real world, there is a medium, namely air, which determine if SoundEvent will reach Ear. There are a lot more external factors that may influence this calculation but it is getting too complex. It just reminds us of how complex the world really is and we are taking it all for granted´┐Ż




Replies:
  • dflgkjds koen January 29, 2001 at 10:23 AM (0)

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us