Interesting read, thanks! In many cases you have to choose, which object will have more behaviour and which is more anemic. Student.attend(lesson), lesson.add(student). It feels very awkward most of the time.
I believe that if it feels awkward, then probably there is a better way to model it. The key take-away here is that where there is confusion about which object in the relationship should host the "behavior", then probably the relationship should be its own object which hosts the behavior. Also that not all nouns are objects with behavior... sometimes they are just data.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Interesting read, thanks! In many cases you have to choose, which object will have more behaviour and which is more anemic. Student.attend(lesson), lesson.add(student). It feels very awkward most of the time.
I believe that if it feels awkward, then probably there is a better way to model it. The key take-away here is that where there is confusion about which object in the relationship should host the "behavior", then probably the relationship should be its own object which hosts the behavior. Also that not all nouns are objects with behavior... sometimes they are just data.