Posted By:
Kiril_Dunn
Posted On:
Monday, January 13, 2003 04:46 PM
Being a strong believer in hiding all implementation details from the user of one of my classes :), I would not do any of the above.
Rather, I'd probably add addElement(), removeElement() and getElement() methods for each list that you manage internally, or perhaps create my own implementation of Iterator to replace the getElement() and removeElement() methods.
By doing this, I have complete control over what the user of the class can and cannot do to my lists, and I can execute other code in response to adding, removing or retrieving an element from each list.
Cheers,
Kiril