UML and Documenting Simple Diagrams
- by Jason
As part of a rewrite of an old Java application into C#, I'm writing an actual Software Design Specification. A problem I run into is when a method is too simple to bother with a Sequence Diagram (it doesn't interact with other objects).
As an example, I have a simple POJO called Item, containing the following method:
public String getCategoryKey() {
StringBuffer value = new StringBuffer("s-");
value.append(this.getModelID());
value.append("-c");
return value;
}
The purpose and the algorithm for the method needs to be documented. However, a sequence diagram is overkill. How would others document it?
(I take no credit/blame for the given method, it's very old code and the author "forgot" to put their name in the Javadoc).