You're definitely right, abstract classes are not meant to be instantiated. That does not mean that the methods they implement are clean from pulling in dependencies, and when mixins/modules end up depending on their child classes (same with abstract classes), then you have problems.
moduleCommentabledefcomment(text)# You now depend on methods of the child classself.comments<<textendendclassPostincludeCommentableend
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.
Thanks for the reply! I thought this seemed like a good approach to the pattern, so it's nice to hear someone else has used it effectively.
I thought abstract classes weren't meant to be instantiated, just to provide behavior to their subclasses. Have I misunderstood?
You're definitely right, abstract classes are not meant to be instantiated. That does not mean that the methods they implement are clean from pulling in dependencies, and when mixins/modules end up depending on their child classes (same with abstract classes), then you have problems.