Skip to Content
Visual Modeling with Rational Rose 2002 and UML
book

Visual Modeling with Rational Rose 2002 and UML

by Terry Quatrani
October 2002
Intermediate to advanced content levelIntermediate to advanced
288 pages
5h 4m
English
Addison-Wesley Professional
Content preview from Visual Modeling with Rational Rose 2002 and UML

Inheritance Versus Aggregation

Inheritance is often misused—the “inheritance is good, therefore, the more I use the better my code will be” syndrome. This is not true—in fact, the misuse of inheritance can lead to problems. For example, a student may be full time or part time. A Student superclass with two subclasses—FulltimeStudent and ParttimeStudent—could be created. Multiple problems can arise with this structure. What happens if:

  • A full-time student decides to go to school only part time? This implies that an object would have to change its class.

  • Another dimension is added (e.g., on scholarship or not on scholarship)? Here you would have to add additional subclasses to model the scholarship information along with multiple inheritance to ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

UML for Mere Mortals®

UML for Mere Mortals®

Robert A. Maksimchuk, Eric J. Naiburg
Software Architecture and Design Illuminated

Software Architecture and Design Illuminated

Kai Qian, Xiang Fu, Lixin Tao, Chong-wei Xu
Professional Application Lifecycle Management with Visual Studio® 2010

Professional Application Lifecycle Management with Visual Studio® 2010

Mickey Gousset, Brian Keller, Ajoy Krishnamoorthy, Martin Woodward

Publisher Resources

ISBN: 0201729326Purchase book