Deprecated: Function get_magic_quotes_gpc() is deprecated in /export/home/www/jpatterns/htdocs/wp-includes/load.php on line 926

Notice: Trying to access array offset on value of type bool in /export/home/www/jpatterns/htdocs/wp-includes/theme.php on line 2360

Deprecated: Function get_magic_quotes_gpc() is deprecated in /export/home/www/jpatterns/htdocs/wp-includes/formatting.php on line 4764

Deprecated: Function get_magic_quotes_gpc() is deprecated in /export/home/www/jpatterns/htdocs/wp-includes/formatting.php on line 4764

Deprecated: Function get_magic_quotes_gpc() is deprecated in /export/home/www/jpatterns/htdocs/wp-includes/formatting.php on line 4764

Deprecated: Function get_magic_quotes_gpc() is deprecated in /export/home/www/jpatterns/htdocs/wp-includes/formatting.php on line 4764
Inner Annotation Attributes – Java Design Patterns
Deprecated: Function get_magic_quotes_gpc() is deprecated in /export/home/www/jpatterns/htdocs/wp-includes/formatting.php on line 4764

Deprecated: Function get_magic_quotes_gpc() is deprecated in /export/home/www/jpatterns/htdocs/wp-includes/formatting.php on line 4764

Deprecated: Function get_magic_quotes_gpc() is deprecated in /export/home/www/jpatterns/htdocs/wp-includes/formatting.php on line 4764

Deprecated: Function get_magic_quotes_gpc() is deprecated in /export/home/www/jpatterns/htdocs/wp-includes/formatting.php on line 4764

Deprecated: Function get_magic_quotes_gpc() is deprecated in /export/home/www/jpatterns/htdocs/wp-includes/formatting.php on line 4764

Deprecated: Function get_magic_quotes_gpc() is deprecated in /export/home/www/jpatterns/htdocs/wp-includes/formatting.php on line 4764

Deprecated: Function get_magic_quotes_gpc() is deprecated in /export/home/www/jpatterns/htdocs/wp-includes/formatting.php on line 4764

Deprecated: Function get_magic_quotes_gpc() is deprecated in /export/home/www/jpatterns/htdocs/wp-includes/formatting.php on line 4764

Inner Annotation Attributes

jonnybbb made a suggestion that we rather use attributes for the participants and comments.  I’ve done this for all of the annotations and inner annotations, so instead of

@CompositePattern.Component
@PatternParticipants({DistributionList.class, Person.class})
public abstract class Contact {
  public abstract void sendMail(String msg);
  public void add(Contact contact) {}
  public void remove(Contact contact) {}
}

We can now do the following:

@CompositePattern.Component(participants = {
    DistributionList.class, Person.class})
public abstract class Contact {
  public abstract void sendMail(String msg);
  public void add(Contact contact) {}
  public void remove(Contact contact) {}
}

That is even better, because then users will see the options available with autocompletion. Lots of duplication inside the annotations, but it is not our fault that you cannot inherit annotations 🙁

Heinz


Deprecated: Function get_magic_quotes_gpc() is deprecated in /export/home/www/jpatterns/htdocs/wp-includes/formatting.php on line 4764