Answer the question
In order to leave comments, you need to log in
Where to put the image upload method?
There is a registration class and a user profile class. And there , and there the same method of loading the image is needed . The question is where is the best place to put this method? Create a separate class that only works with images and then use delegation to load those images ? or how ?
Answer the question
In order to leave comments, you need to log in
Each class should only be responsible for one thing. This is indicated by the letter S in the abbreviation SOLID (single responsibility, single responsibility). Therefore, neither the user nor the registration class "needs" to know anything about how images are loaded. This functionality needs to be moved to a separate class (service).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question