I have a web app, in the startup a servlet creates various instances of the same 'Product', Gateway, with different configuration settings defined. Here is a small description.
Gateway: abstract class defines different types of gateways.
MessageParser: Interface, Every type of Gateway
has its own parsers, process and returns a specific Message
.
Mesage: an interface which has a method returning String getMessage()
, all beans implement this message, and is serializable.
Listener: each type of gateway will register a listener of its own to process the incoming data.
GatewaySettings: all info the gateway needs how, when and where to connect, port etc.
GatewayBuilder produces the gateway product using the settings, Gateway buildGateway()
, setting all appropriate implementations of its properties? what methods go into this, should it have setters for making it immutable?
Do the builder patter do the work or any other pattern? if builder pattern can be used where do the director of the pattern comes in this situation?
Post me if more info required!
Thanks, V.