Sunday, March 16, 2014

What is a Spring “stereotype”?

The JavaDoc says a bit about it.
Annotations denoting the roles of types or methods in the overall architecture (at a conceptual, rather than implementation, level).
The noun definition of sterotype from Merriam-Webster says this:
something conforming to a fixed or general pattern; especially : a standardized mental picture that is held in common by members of a group and that represents an oversimplified opinion, prejudiced attitude, or uncritical judgment
It seems that it is for suggesting a role of particular class that is being annotated. This seems to make sense because it is often recommended that you annotate your Controller classes with @Controller, Service classes with @Service, and so on.
In general, Spring suggests that they make nice point-cut demarcations for your AOP needs. (besides the obvious component-scanning functionality)

No comments:

Post a Comment