There are certain common elements that I want certain doctypes to have. (E.g. all web-pages should have short names, descriptions, associated images, meta descriptions, etc.)
I can achieve this by making a master doctype. Then, when I make other doctypes I can either use inheritance or make them as children of the master doctype.
On the face of it, there doesn't seem to be much difference between the methods. However, I fear that there may be a good reason (or several pros and cons) for using one method over the other. Any thoughts on using inheritance over parent-child?
If you go down the inheritance via Composition, then you've got the flexibility to include your "master doctype" settings in any document type that you like, regardless of how things are structured - and then can easily remove this if required.
If you use the inheritance via Parent-Child relationship, then every child will have the default settings as standard, which you might not necessarily want to have. So you'll have to move the child outside of the parent to remove this inheritance, which might not always feel intuitive.
As you pointed out, there isn't a huge difference for your particular scenario, but if you're looking for a bit more flexibility and freedom as your project grows, I'd recommend using inheritance via Composition. approach.
Doctype... inherit vs child
There are certain common elements that I want certain doctypes to have. (E.g. all web-pages should have short names, descriptions, associated images, meta descriptions, etc.)
I can achieve this by making a master doctype. Then, when I make other doctypes I can either use inheritance or make them as children of the master doctype.
On the face of it, there doesn't seem to be much difference between the methods. However, I fear that there may be a good reason (or several pros and cons) for using one method over the other. Any thoughts on using inheritance over parent-child?
If you go down the inheritance via Composition, then you've got the flexibility to include your "master doctype" settings in any document type that you like, regardless of how things are structured - and then can easily remove this if required.
If you use the inheritance via Parent-Child relationship, then every child will have the default settings as standard, which you might not necessarily want to have. So you'll have to move the child outside of the parent to remove this inheritance, which might not always feel intuitive.
As you pointed out, there isn't a huge difference for your particular scenario, but if you're looking for a bit more flexibility and freedom as your project grows, I'd recommend using inheritance via Composition. approach.
is working on a reply...