Prev | Current Page 416 | Next

Frank Zammetti

"Practical DWR 2 Projects"


After the fields are all the getters and setters for them, all their data types spelled out in
the UML diagram, although I??™d bet all of them are obvious based on only their names. And just
like the Config class, the handy overridden toString() method is also present, making for easy
debugging and logging.
ArticleComment.java
The ArticleComment class stores the details for one comment left for an article, and its UML
diagram is shown in Figure 5-14.
Figure 5-14. ArticleComment class UML diagram
As has become the pattern for these relatively simple classes, the code is not shown here.
The fields of this class are articleTitle, which is essentially a foreign key to a particular article;
text, which is the actual text of the comment; posted, which is the date/time the
comment was left; and poster, which is, of course, the username of the user who left the comment.
Recall that only registered users are allowed to leave comments. And once again, the
ubiquitous custom toString() makes another appearance!
ArticleHistoryItem.java
The ArticleHistoryItem class, whose UML diagram you can see in Figure 5-15, is very nearly
identical to the ArticleComment class in reality, and it describes a single modification event
that occurred for an article.


Pages:
404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428