M
Merlin
Hi
For any of you that own a copy of GOF book, on page 38 there is a
class diagram showing the Glyph hierarchy. Two questions
Am I right to say that Image(or Graphic) would be another class that
should inherit from Glyph in order to follow from Fig 2.2 and Fig 2.3
on the previous page.
Secondly, why does Glyph have Insert() operation in its interface if
only some of the classes that inherit from it need this operation. The
interface for Glyph should be all the operations common to the classes
that derive from it. I have come across the ISP priciple by Robert C.
Martin that says this is a bad thing and designers should segregate
the interface and use multiple inheritance. The Glyph interface has
been polluted by Insert()...
If I am right then how can we resolve the issue without
overcomplicating the design.
Kind Regards
Merlin
For any of you that own a copy of GOF book, on page 38 there is a
class diagram showing the Glyph hierarchy. Two questions
Am I right to say that Image(or Graphic) would be another class that
should inherit from Glyph in order to follow from Fig 2.2 and Fig 2.3
on the previous page.
Secondly, why does Glyph have Insert() operation in its interface if
only some of the classes that inherit from it need this operation. The
interface for Glyph should be all the operations common to the classes
that derive from it. I have come across the ISP priciple by Robert C.
Martin that says this is a bad thing and designers should segregate
the interface and use multiple inheritance. The Glyph interface has
been polluted by Insert()...
If I am right then how can we resolve the issue without
overcomplicating the design.
Kind Regards
Merlin