|Program 4: Aggregation||
Objectives: Gain experience designing classes using aggregation.
Description: This program is intended to provide you with additional experience with classes and object instantiation, as well as utilizing aggregation to take advantage of code reuse.
Develop a new class called clsReference that has the following members:
Public Class clsReference
The accessor and mutator methods for author must be capable of handling multiple names, i.e., an ArrayList of names. Refer back to the Reference Styles help sheet for examples. Make sure you define the methods in the order listed above.
Refer to the Composition notes for assistance.
The Add Authors button should call the setAuthor method of the clsReference object, and clear the textboxs. Display a message box or status line confirming what you have done.
The Save All Authors button should place the focus in the title textbox. Display a message box or status line confirming what you have done.
The Save Reference button should call the setTitle method of the clsReference object, the setPubDate method of the clsReference object, and then build the output string for the preview output box. Display a message box or status line confirming what you have done. (The demo shows only the year of the publication date, and also shows four different versions of the author using getAuthorLastFirstMi, getAuthorLastFiMi, getAuthorLastFiMi_FirstMiLast, and getAuthorLastFirstMi_FirstMiLast. Nothing is italicized since it is difficult or impossible to display portions of a textbox in italics.)