arther/Library-Management-System — Issue #1: If-else chain in addItemsToList
Author: sudhirj
Created: 2011-12-16 05:08:02+00:00
State: open

This code here:

public static void addItemToList(String title, String creator,
String itemType) {
if (itemType.trim().equalsIgnoreCase("Movie")) {
new Movie(title, creator).save();
new ItemRegistry().save();
} else if (itemType.trim().equalsIgnoreCase("Book")) {
new Book(title, creator).save();
new ItemRegistry().save();
} else {
inputTypeError();
}

addItem();
}

Contains a lot of if-else statements, and will grow in proportion to the number of things our library holds.