Hey Ranchers,
I need some help in how to properly use stereotypes in Class diagram.
Cade's book suggests that we can use <<@Stateless>> and <<@Entity>> stereotypes.
Amritendu De's book uses <<@JSF>> and <<@managedBean>> stereotypes, in addition to those from Cade's book.
So I take as granted that using the stereotypes above won't cause lost marks.
Now, here's my questions:
1. Class-level stereotypes: Do you think it is stll OK to use a <<@managedBean>> stereotype for CDI beans annotated as @Named ?
As you probably know,
JSF dependency injection is inferior to CDI, and in
Java EE6 we should annotate backing beans with javax.inject.Named, not with javax.faces.ManagedBean
Should we use a stereotype <<@Named>> for backing beans instead ?
2. Will it be OK to use stereotype for operations ?
For instance, I'd like to use stereotypes <<@Asynchronous>> for the methods in stateless beans that are annotated as @Asynchronous and meant to be asynchronously executed,
and <<@PostConstruct>> for the methods annotated with @PostConstruct
3. is it OK to annotate dependencies (a.k.a dashed lines with arrows) ? I consider on adding stereotypes like <<@Inject>> or <<@EJB>> to denote different kinds of dependency injection, or <<Include>> to show when JSF views (xhtml) are included into template.
The purpose for all these these stereotypes from p.1-3 above would be to enhance the diagram and to give the inspector an additional information about the logic behind it. I also planned to create a glossary for stereotypes I use.
Then I learned from this post:
https://coderanch.com/t/595412/java-Architect-SCEA/certification/Jar-resubmit#2715109
that someone in the past have lost marks on class diagram because of "Incorrect inconsistent use of stereotype" and now I much more sceptical about stereotypes.
4. So, what do you think is better - to use non-standard stereotypes and have a glossary for them, or only use "trusted" stereotypes from books, and use comments to diagrams to provide necessary information as comments ?
5. Most importantly, what stereotypes did you use in your assignments, and do you think that they did not cause lost marks ?
Thanks !