Look at the BaseTypeFactory class in libdap and look for specializations in the various handlers of the BES. For example, AsciiOutputFactory.cc. The handlers generally don’t have factory classes because they have always used function/methods specific to the data access APIs to build the Byte, Array, …, objects. But in most cases we can build factories for the types.
This task is to write the factory and verify that it works.