My task is to write a program to store files in object store. One of the subtasks requires to send json or xml format response to the file uploader/downloader as requested by client. The following rules must be followed:
entry
+-------------------------+
v v
upload download
+-----------+ +--------------+
v v v v
succ err succ err
+-----+ +-----+ +-----+
v v v v v v
json1 xml1 json2 xml2 josn2 xml2
- if user uploads file with success, return json/xml type 1
- if user uploads file with error, return json/xml type 2
- if user downloads file with success, do nothing
- if user downloads file with error, return json/xml type 2
I've managed to solve the task but I'm not satisfied with the class dependencies I got. I think mixture of abstract factory and strategy are suitable for the issue. Can you give me a hint how to deal with the problem?
Aucun commentaire:
Enregistrer un commentaire