Naming convention for properties in property file

后端 未结 7 1302
感情败类
感情败类 2021-02-03 20:05

What are the naming conventions for property names defined in properties files in Java? Can I use uppercase or only lowercase?

For example: bankAccountNumber or bank.acc

7条回答
  •  离开以前
    2021-02-03 20:35

    There's no particular standard for naming properties, but convention appears to be of the form

    a.b.c.d = x
    

    in lowercase. I would expect some sort of informal hierarchy e.g.

    bank.
    bank.account.
    bank.account.name.
    bank.account.pin.
    

    etc.

    If it's a property which directly affects a particular class I may name it after that class (or at least use the package name). However that is also an example of implementation leak, and I'd think seriously before doing that.

提交回复
热议问题