[mms2r-users] MMS2R 2.0 features

Mike Mondragon mikemondragon at gmail.com
Thu Nov 8 16:45:45 EST 2007


There are four things I would like to do for a 2.0 release of MMS2R.
Please give me your feedback if these are wise design decisions or if
other features should be implemented.

One:
Refactor MMS2R's name space, decoupling "Media" from specific
implementations.  For instance MMS2R::NextelMedia would become
MMS2R::Media::Nextel .  Programs would still interact with the generic
interface provided MMS2R::Media, only the classes that represent
specif carriers would be pushed down one level deeper.

Two:
Make MMS2R::Media.new the factory method for the library rather than
calling create() explicitly.  That is idiomatic of Ruby.

Three:
Make processing of the MMS greedy within the initialize() method.
Thus MMS2R::Media.new returns an object that has already called the
process() method and programs don't have to call process() explicitly.
 However, a greedy flag will be available to initialize and if greedy
is false then the program will have to call process() explicitly.

Four:
Define a generic Error class for MMS2R so that programs can implement
rescuing behavior.  Something such as:
class MMS2RError < RuntimeError; end
class NotProcessedError < MMS2RError; end
class ProcessingError < MMS2RError; end
For instance if an MMS2R object is created without being greedy then
NotProcessedError should be raised if any of the MMS accessors are
called such as subject() default_media()  Also the network level
errors that the Sprint class is susceptible to can be wrapped into
ProcessingError


-- 
Mike Mondragon
Work> http://sas.quat.ch/
Blog> http://blog.mondragon.cc/
Small URLs> http://hurl.it/


More information about the mms2r-users mailing list