I have a class that I writes iCal events, and it contains nested classes that are public. The class are bascially complex types for components in the iCal such as events, alarms, etc, and it made sense to make them public nested classes that were used by the rest of the program.
I have read that having public nested classes is a sign of bad programming is. Why is it bad and when is it appropriate nested classes?
This is all IMHO but comes from about 15 years of analysing other people’s creations:
It is appropriate if the nested classes are private and are not exposed by the public interface of the containing class.
For example a linked list class would have a linked list node class nested inside it which is specific to the implementation internals but will not be exposed to the consumer of the linked list class.
Otherwise, I would not bother as it just adds unnecessary complexity.
For the sake of your example, I’d change all your classes to normal ones if they are exposed by the iCal event class.