I have no education in computer science and always struggled with the concept of classes in OOP. Basically, I always found the decision very contingent what I put into a class, where I make two classes out of the things I am concerned with etc.
I often didn't had the feeling that in libraries I use, decision principles were applied for the semantic or logical scope of classes which seemed less contingent.
In the end I started to learn Haskell and familiarised myself with functional programming because the building blocks seemed more intuitive to me. However, I am always coming back to this issue, especially because I need to do more things in Python these days.
Thus - for someone with no computer science background - can anyone explain to me a good design pattern that helps to decide what the semantic and logical scope of a class should be, where to better split a class into two or where to better extend the scope of a class. References to further research literature on this topic would also be nice.
Aucun commentaire:
Enregistrer un commentaire