July 2001
Intermediate to advanced
656 pages
15h 51m
English
Similar to previous examples of factories in the case study, the configuration of the PersistenceFacade with a set of IMapper objects can be achieved with a factory object, MapperFactory. However, as a slight twist, it is desirable to not name each mapper with a different operation. For example, this is not desirable:
class MapperFactory { public IMapper getProductSpecificationMapper() {...} public IMapper getSaleMapper() {...} ... }
This does not support Protected Variations with respect to a growing list of mappers—and it will grow. Consequently, the following is preferred:
class MapperFactory { public Map getAllMappers() {...} ... }
where the java.util.Map (probably implemented with a HashMap ...
Read now
Unlock full access