The advantages of a class diagram are that:
1. It forces the programmer to think out the structure of his/her classes and how they will interact with each other before actually writing any code. This may lead to a more robust application.
2. It provides a blueprint for maintenance programmers to get an overview of how the application is structured before examining the actual code. This may reduce maintenance time.
The disadvantages are:
1. The programmer may need to learn UML to build the class diagram in the first place.
2. The time spent building the class diagram may add to overall development time.
3. If the class diagram is overcomplicated, then it may be difficult to correlate with the actual code.