简体   繁体   中英

Composition with inheritance?

my question is if it's possible/right to model something like this:

在此处输入图片说明

The problem is that tutorial can't exist without the lecture, BUT they're both very very similar in their attributes and methods, that's why I thought that maybe it could be easier to have an inheritance there. Thanks for the ideas and answers

That should work just fine. There is nothing wrong with your model .... though it is conventional to draw the diagram with the superclass above the subclasses, not below them as your diagram does.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM