I have a addItem method that get inputs from user. I have 3 classes(Object), they are Book, CD and Item. Book and CD objects are extending from the Item object. At first, the DataEntry Person would need to input the ItemID. If the ItemID is started with "C", that means he/she is inserting CD's information, and all the inputs will be populated to CD object, and it works the same way for Book Object, ...etc. All the input parameters names will be stored in a String, such as itemDetails, cdDetails, etc.
However, the program doesn't know the User is inserting whether the Book or CD information at the beginning, so by default i will just use a forLoop to read all the parameters from String itemDetails. After the user entered the first parameter, the program knows the user is inserting wheter CD or Book. I would like to concat the cdDetails or bookDetails String array to the default itemDetails String array so that all the required parameters can be read from user.
I would like to get some nice suggestions on how to implement this thing. I want to learn how to design fast, dynamic and portable codes. Please help me out.