mercredi 6 juillet 2016

Better way to organize read/write actions in my project

My code contains the following read/write methods to write data to database

Read methods like

  1. public byte[]readFile(arg1)
  2. public byte[] readFile(arg1, arg2)
  3. public InputStream readFile(arg1, arg2)
  4. public MyStream readFile(arg1, arg2)
  5. public byte[] readFile(arg1, arg2, arg3)

Write methods like

  1. public String[] writeFile(arg1)
  2. public String[] writeFile(arg1, arg2)
  3. public MyStream writeFile(arg1, arg2) -> file is written from this outputted stream
  4. public String[] writeFile(arg1, arg2, arg3)

Various classed access these methods for read and write purpose. Kindly provide me a better way to organize this in a better way.

I would like to have a centralized part where all my read/write would happen.

Someone please help me to choosing an appropriate pattern to organize this well.

Aucun commentaire:

Enregistrer un commentaire