The dynamic programmer

A REST API in 20 minutes - Part 2.

In this second part we look at the factory methods to handle the different request
and the formatters classes.

h3 The Factory.

The use of a factory allow us to easily extend this framework with minimun coding.

h3 Some base classes.

We need to encapsulate some code, so we apply the DRY principle, that code will reside
in two base classes.

The first class is used by our formatter classes, they need to format different type
of objects so they need to call a class that knows how to process the call for that
given object, get the object, modify it according to the parameters and commands and
them returned to the formatter class that will format it and do the response.

The second object, is one of our objects handlers, some scheleton code at this moment.
This objects implement IServiceRequestHandler.

h3 The Formatter class