samedi 29 février 2020

Which design pattern can be used instead of Manager class?

I have a class called PhotoManager it's a singleton. This class contains methods like:

fun downloadPhoto(context: Context, photoUrl: String) { }

fun savePhotoUri(context: Context, uri: Uri) { } 

fun setWallpaper(context: Context, photoUri: Uri) { }

I also have some other classes that have Manager postfix in their names. For example, SuggestionManager that receives some input data and returns user-based suggestions.

I'd like to refactor these two classes but I don't know which pattern to use. Can it be the Facade pattern? Thank you.

Aucun commentaire:

Enregistrer un commentaire