Summary of Java Naming conventions

Source: Internet
Author: User

about naming conventions:
1, literally. The name is meaningful and can express meaning.
2, avoid misleading, avoid giving misleading elements, such as xxxlist.
3, make a meaningful distinction, avoid using product,product info and productdata at the same time. All the crap is redundant.
4, use the read-out name.
5, use a searchable name. mainly for constants.
6, avoid using encoding. Avoid using prefix m_des and type encoding phonestring.
7, the class name is the name, the method name is a verb or a verb phrase (multi-use GET, set, is). Static Factory method for overloaded constructors.
8, do not play with the treasure, with wonderful words.
9, each concept corresponds to a word. Fetch, retrieve, get only one. Manager, controller, driver only one.
10, don't use puns. Add is add or insert.
11, use the name of the solution domain, such as not renaming the terminology of the familiar design pattern.
12, add a meaningful context. The best way is to get a class.


Summary of Java Naming conventions

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.