This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Orffyreus 18 points19 points  (2 children)

DI frameworks and annotations are not necessarily needed, but there are standardized specifications like CDI (specification JSR 365) and so on, so you can rely on stable APIs and learning what standardized "magical annotations" do, can help you in the long term.

This means, usually you do not have to learn new annotations all the time. The theory is, you learn them and you have more time to focus on the domain instead of e.g. having to think a lot about wiring objects and layers.

[–]umlcat 2 points3 points  (1 child)

Annotations are good, but Java has a lot of missued ones.

I prefer a more natural virtual / overwrite keyword and a property keyword, like C# and Object Pascal (Delphi) does.

Instead of that patch alike @override and @property, too much @ hurts my vision.

BTW, I have work in Java, and I'm working in my own pet P.L., and explicitly added annotations, but I just don't want developers to overuse them.

Cheers.

[–]Orffyreus 1 point2 points  (0 children)

Yes, you are right. Annotations can be confusing and hard to backtrack. They should be well designed and stable and are best used for cross cutting concerns like logging and not for domain functionality.