def guessFactory = [messages: GuessGameMessages, control: GuessGameControl, converter: GuessGameInputConverter] def twoupFactory = [messages: TwoupMessages, control: TwoupControl, converter: TwoupInputConverter] class GameFactory { def static factory def static getMessages() { return factory.messages.newInstance() } def static getControl() { return factory.control.newInstance() } def static getConverter() { return factory.converter.newInstance() } }