[Technical posts] Annotation

Source: Internet
Author: User

First, I would like to criticize blogdriver's RSS. It seems that it has been lagging behind since it was acquired by BC. It often takes several days to see it update RSS, so I missed a lot of new gigixArticle, 874.

In the morning, I talked to Ling Hu about the annotation sucks in gigix's RSS feed "latest" (it has been nearly half a month-_-|). Both gigix and Robbin obviously oppose annotation. Robbin considers this to undermine the purity of Java, and gigix thinks this is not as flexible as XML.

The feature added in this Java is obviously learned from the. NET attribute. But Ling Hu and I thought this feature was good.

Ling Hu said:I liked it very much and thought that I put all the content in the expression.CodeThe code is not synchronized due to multiple modifications. It is also clear. However, gigix seems to make sense. That is, attribute. However, it seems that attribute is more radical because it has less burdens..

I think annotation is good in terms of performance. After all, the aspects that require annotation are rarely changed. And if it needs to be changed, the source code also needs to be changed accordingly.

Ling Hu also turned to a saying that he saw it in javaeye:Basically, there is no need to modify the XML instead of the Code..

I am paying attention to this issue because when I use Delphi to implement dynamic proxy to develop a Web framework, the business logic is implemented using BPL, the two intend to insert the login verification Section through the AOP method. But the difficulty is that not all page calls require verification. How can we differentiate them?

When
However, as gigix said, it can be described through external XML. However, if there is metadata such as attribute/annotation, I think it is a better solution.
Solution. After all, whether to verify itself is also part of the business logic. It is closely related to the Business Code. Separating it into external XML not only brings performance problems, but also has potential inconsistency risks, and
Flexibility is unnecessary.

Therefore, attribute/annotation is good.

BTW: to add, gigix annotation vs. Configuration

-- August 2

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.