search

Home  >  Q&A  >  body text

java - 项目中页面下拉框里面的常量(如性别:男/女;学历:初中/高中/大专/本科),如何存储?

处理这些常量,我现在知道的有以下几种做法:
1.直接写在页面
2.数据库建立字典表
3.项目里面添加一个文件记录下这些常量
可以存储为xml\静态变量\json格式
想请教下,你们用的是哪种方式?不同的方式之间选择的原则是什么?

PHP中文网PHP中文网2821 days ago700

reply all(2)I'll reply

  • 高洛峰

    高洛峰2017-04-17 11:07:50

    Write big changes into the database, use constant arrays for small changes, and write unchanged ones into the page

    reply
    0
  • 黄舟

    黄舟2017-04-17 11:07:50

    If it doesn’t change frequently, write it directly on the page, such as gender~ Only men and women don’t need a database at all. There are only a few academic qualifications. If there are changes, they will be saved in the database.

    reply
    0
  • Cancelreply