just looking at this class diagramit feels like we are doing something wrong it is bulky and fragile it may do everything we needbut it feels like it will be hard to maintain or extend there are too many relationshipsand too many classes would be affected by modifications to any one class it looks like spaghetti and meatballs now that we've explored inheritance as an optionand found it wantingwe might look back at our previous composition-based diagramwhere contributor was attached directly to libraryitem with some thoughtwe can see that we actually only need to add one more relationship to brand-new class to identify the type of contributor this is an important step in object-oriented design we are now adding class to the design that is intended to support the other objectsrather than modeling any part of the initial requirements we are refactoring the design to facilitate the objects in the systemrather than objects in real life refactoring is an essential process in the maintenance of program or design the goal of refactoring is to improve the design by moving code aroundremoving duplicate code or complex relationships in favor of simplermore elegant designs this new class is composed of contributor and an extra attribute identifying the type of contribution the person has made to the given libraryitem there can be many such contributions to particular libraryitemand one contributor can contribute in the same way to different items the diagram communicates this design very welllibraryitem catalog +search(+title +upc +subject +contributors contributorwithtype +contributor +type +locate(contributor +name book +isbn +title +subject +dds number magazine cd dvd +genre +volume +issue