lundi 30 novembre 2020

Specific Design pattern JAVA

I'm trying to implement some get/post operations on different APIs (3-4) and I really don't know which design pattern to use to improve my code readability.

For the moment I have a custom visitor pattern implemented, with the get/post methods inside my API classes instead of visitor class because it seems cleaner. Every time I want to use a new API i just make the API class, add the following methods and call them in Visitor, but this is not how to use visitor pattern.

Example how this should look like:

1 job -> getAllPictures() -> getAllPicturesFromGoogle()
                          -> getAllPicturesFromFacebook()
                          -> getAllPicturesFromTwitter()
      -> postPicture()    -> postPictureOnGoogle()
                          -> postPictureOnFacebook()
                          -> postPictureOnTwitter()

Aucun commentaire:

Enregistrer un commentaire