org.jboss.as.quickstarts.numberguess
Class Generator

java.lang.Object
  extended by org.jboss.as.quickstarts.numberguess.Generator
All Implemented Interfaces:
Serializable

@ApplicationScoped
public class Generator
extends Object
implements Serializable

Random number generator.

Placing the random number generation, as well as the configuring the maximum number allows for a more loosely coupled application. We can now change out the implementation of number generation without any effect on the client code. We also produce a more intuitive design - both are identifed by the fact they are numbers (int) and that they are qualified as the maximum number or a random number.

We use the application scope to store the random number generator so that we use the same seed.

Author:
Pete Muir
See Also:
Serialized Form

Constructor Summary
Generator()
           
 
Method Summary
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Generator

public Generator()


Copyright © 2011. All Rights Reserved.