JPatterns is a collection of annotations describing the used design patterns in your Java source code. They make you classes more readable for fellow developers and of course yourself as well. Most of the GOF patterns and a few JEE patterns are already supported. Have a look at the following command object pattern example right from the sources at github:

@CommandPattern.Command(participants = CommandReceiver.class)
interface Command {
 void execute();

@CommandPattern.ConcreteCommand(comment = "This is our TestCommand")
public class TestCommand implements Command {
 private boolean ran;

 public void execute() {
 ran = true;

@CommandPattern.Receiver(participants = Command.class)
public class CommandReceiver {
 public void receive(Command command) {

Source code at

Short URL for this post:
This entry was posted in Java and Quality, Java Basics and tagged , . Bookmark the permalink.