<i id='orJsy'><tr id='orJsy'><dt id='orJsy'><q id='orJsy'><span id='orJsy'><b id='orJsy'><form id='orJsy'><ins id='orJsy'></ins><ul id='orJsy'></ul><sub id='orJsy'></sub></form><legend id='orJsy'></legend><bdo id='orJsy'><pre id='orJsy'><center id='orJsy'></center></pre></bdo></b><th id='orJsy'></th></span></q></dt></tr></i><div id='orJsy'><tfoot id='orJsy'></tfoot><dl id='orJsy'><fieldset id='orJsy'></fieldset></dl></div>
  • <legend id='orJsy'><style id='orJsy'><dir id='orJsy'><q id='orJsy'></q></dir></style></legend>

    <small id='orJsy'></small><noframes id='orJsy'>

      <bdo id='orJsy'></bdo><ul id='orJsy'></ul>

    1. <tfoot id='orJsy'></tfoot>

        注释 vs XML,优点和缺点

        时间:2023-09-28

          <bdo id='xVNhQ'></bdo><ul id='xVNhQ'></ul>
            <tbody id='xVNhQ'></tbody>

              <tfoot id='xVNhQ'></tfoot>
              <i id='xVNhQ'><tr id='xVNhQ'><dt id='xVNhQ'><q id='xVNhQ'><span id='xVNhQ'><b id='xVNhQ'><form id='xVNhQ'><ins id='xVNhQ'></ins><ul id='xVNhQ'></ul><sub id='xVNhQ'></sub></form><legend id='xVNhQ'></legend><bdo id='xVNhQ'><pre id='xVNhQ'><center id='xVNhQ'></center></pre></bdo></b><th id='xVNhQ'></th></span></q></dt></tr></i><div id='xVNhQ'><tfoot id='xVNhQ'></tfoot><dl id='xVNhQ'><fieldset id='xVNhQ'></fieldset></dl></div>
            1. <small id='xVNhQ'></small><noframes id='xVNhQ'>

                <legend id='xVNhQ'><style id='xVNhQ'><dir id='xVNhQ'><q id='xVNhQ'></q></dir></style></legend>

                1. 本文介绍了注释 vs XML,优点和缺点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我是这里的java新手,我正在阅读注释和xml,我个人发现xml有很多优点,比如它可以放在应用程序之外,可以在不重新编译类文件的情况下进行更改.如果我使用注释,如果我需要进行更改,则需要转到源代码并重新编译.如果是这种情况,我们为什么要使用注释

                  i am new to java here, I was reading about annotations and xml, personally I find out xml has lot of advantages like it can be put outside application, changes can be made without recompiling class files. If i use annotations if I need to make changes need to go to source code and recompiling should be done. If this is the case why should we use annotations

                  推荐答案

                  注解的优点:

                  1) 所有信息都在一个文件中(无需打开两个文件来配置给定的行为)
                  2)类发生变化时,无需修改xml文件

                  1) All the information is in a single file (no need to open two files to configure a given behavior)
                  2) When the class changes, no need to modify the xml file

                  xml文件的优点:

                  1) POJO 与其行为之间的明确分离
                  2)当你不知道哪个POJO对行为负责时,更容易找到那个POJO(在文件子集而不是所有源代码中搜索)

                  1) Clear separation between the POJO and its behavior
                  2) When you do not know which POJO is responsible for the behavior, it is easier to find that POJO (searching in a subset of files rather than all the source code)

                  这篇关于注释 vs XML,优点和缺点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:@Component 和 @Named 都用于同一个 bean 类 下一篇:将外部化值注入 Spring 注解

                  相关文章

                  最新文章

                  1. <i id='Bn92y'><tr id='Bn92y'><dt id='Bn92y'><q id='Bn92y'><span id='Bn92y'><b id='Bn92y'><form id='Bn92y'><ins id='Bn92y'></ins><ul id='Bn92y'></ul><sub id='Bn92y'></sub></form><legend id='Bn92y'></legend><bdo id='Bn92y'><pre id='Bn92y'><center id='Bn92y'></center></pre></bdo></b><th id='Bn92y'></th></span></q></dt></tr></i><div id='Bn92y'><tfoot id='Bn92y'></tfoot><dl id='Bn92y'><fieldset id='Bn92y'></fieldset></dl></div>

                      <tfoot id='Bn92y'></tfoot>
                      • <bdo id='Bn92y'></bdo><ul id='Bn92y'></ul>

                      <small id='Bn92y'></small><noframes id='Bn92y'>

                    1. <legend id='Bn92y'><style id='Bn92y'><dir id='Bn92y'><q id='Bn92y'></q></dir></style></legend>