Mail app in JAVA using common programming patterns