lundi 16 mars 2015

Is Bridge Pattern Suitable Here?

I have a Model class and an abstract Item class in my problem domain. A Model object contains a list of Item objects. Each Item object has three jobs to do:



  1. Read from/write to Excel files.

  2. Read from/write to binary files.

  3. Read from/write to hardware.


Due to some reasons, I would like to put these three jobs in three separate class instead of putting them all together in Item subclass, and each Item subclass has different implementation for these three jobs.


The link below is UML class diagram of my current design. As the Item subclasses grow, there will be more ItemXXXHandler_X. It seems there should be a better design.


http://ift.tt/1EXEna3


Aucun commentaire:

Enregistrer un commentaire