Good day.
The other day I encountered the following problem:
public void SomeMethod() { //Π·Π΄Π΅ΡΡ Π΄Π΅ΠΉΡΡΠ²ΠΈΡ ΡΠΎ ΡΡΠ°ΡΠΈΡΠ΅ΡΠΊΠΈΠΌ ΠΊΠ»Π°ΡΡΠΎΠΌ A } public void AnotherMethod() { //ΡΠ΅ ΠΆΠ΅ Π΄Π΅ΠΉΡΡΠ²ΠΈΡ, Π½ΠΎ ΡΠΎ ΡΡΠ°ΡΠΈΡΠ΅ΡΠΊΠΈΠΌ ΠΊΠ»Π°ΡΡΠΎΠΌ B } public void SomeAnotherMethod() { //ΠΎΠΏΡΡΡ ΡΠ΅ ΠΆΠ΅ Π΄Π΅ΠΉΡΡΠ²ΠΈΡ, Π½ΠΎ ΡΠΎ ΡΡΠ°ΡΠΈΡΠ΅ΡΠΊΠΈΠΌ ΠΊΠ»Π°ΡΡΠΎΠΌ C }
I repeat the same actions only with different classes, if it were an ordinary class, I would create a generalized method and not be steamed, but the classes are static. Maybe there is a way to somehow get rid of repetitive actions without getting rid of static classes?
Or how to achieve a global scope for instances of non-static classes, if that is easier?