incubator-droids-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eugen Paraschiv <hanrisel...@gmail.com>
Subject proposal for SaveHandler
Date Sat, 14 Aug 2010 18:24:20 GMT
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.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message