You are viewing a plain text version of this content. The canonical link for it is here.
Posted to droids-dev@incubator.apache.org by Eugen Paraschiv <ha...@gmail.com> on 2010/08/14 18:24:20 UTC

proposal for SaveHandler

As mentioned in a previous discussion, I want to propose a change for
SaveHandler or, as it has been suggested, a more advanced SaveHandler. Here
goes.
The *SaveHandler* class has an *outputDirectory* field; that only allows the
files to be stored in a single directory, without the flexibility of
choosing more than one save directory path based on some logic that the
client would provide. My suggestion is that the process of choosing the file
path can be more flexible, based on client logic; this can be done via a
simple object that would decide the path based on that logic -
PathEvaluator.
An added advantage of this would be a clean separation of concerns - now the
*SaveHandler *class has the responsability of both deciding the path where
the data is to be saved, and actually doing the save operation. This way the
two responsibilities would sit in their own class - SaveHandler will save
the data and PathEvaluator will decide where to put it.
Also, what is the reason the WriterHandler is extended by SaveHandler (and
SysoutHandler)? It seems that it only has a static method and a constant.
Can this be refactored by moving the utility method in the helper package as
in DROIDS-90?
Hope the proposed changes make sense in context. Thanks.
Eugen.