Home > Articles > Programming > Java

  • Print
  • + Share This
Like this article? We recommend

Conclusion

Inheritance and interfaces are powerful mechanisms in Java. We have seen that UML generalization and realization relationships can be used to visualize these two Java concepts. We have noted a couple of weaknesses of UML in this area, especially when working informally. However, a couple of additional non-standard shorthand conventions can help UML class diagrams continue to communicate clearly the overall structure of classes, interfaces, and the different relationships between them. The next article in the series will introduce one of the main ways of extending UML, and look at one way we can use it to help us build better object models. I'll leave you with a quote from Peter Coad's book:

"A number of years ago (and perhaps still, in the minds of some designers), inheritance was the only tool for extending responsibilities, and designers used it everywhere. But extending responsibilities with inheritance is applicable only in very specific contexts. In nearly every case, extending the responsibilities with interfaces or with composition is more appropriate."1

  • + Share This
  • 🔖 Save To Your Account