Showing posts with label wtf. Show all posts
Showing posts with label wtf. Show all posts

Friday, February 13, 2009

FactoryFactories

Something somewhere went terribly wrong and we ended up with APIs like this.

http://ws.apache.org/xmlrpc/apidocs/org/apache/xmlrpc/server/RequestProcessorFactoryFactory.html?rel=html

The default RequestProcessorFactoryFactory is the RequestProcessorFactoryFactory.RequestSpecificProcessorFactoryFactory. It creates a new processor instance for any request. In other words, it allows the request processor to have some state. This is fine, if the request processor is a lightweight object or needs request specific initialization. In this case, the actual request processor is created and invoked when calling RequestProcessorFactoryFactory.RequestProcessorFactory.getRequestProcessor(XmlRpcRequest).

The really sad part is that in the Java world this specific example cannot be considered that extreme any more.

FactoryFactories indeed.