A little thought on the agreement superior to the disposition _maven

Source: Internet
Author: User
Tags advantage

Starting to think about the problem, which stems from recent projects and the growing weakness of using ant scripts, started trying to build projects with Maven, and was amazed at the need for a few simple lines of XML to do the work that ant needed a lot of XML to do. Have to say, people after a certain technology accumulation, always think of ways to simplify their work. Before doing a project, always write ant configuration file, satisfied with their more flexible configuration, without thinking, this is worth it.
Imagine what our world would be like if each one of us were content with our own desires and whatever we wanted. In the software world, if every programmer has a set of their own specifications, then our software will become a mess. Each version of the browser has been a headache for many programmers, not to mention the others. Think of this, you have no feeling, in fact, Java success, XML success, MAVEN's success has its inevitability, their design concept contains a very simple but profound truth, that is "universal."
Why GM. Because follow the convention.
GM will bring another advantage, that is, the learning cost is low, when the new entrants, it is easy to use, mainly he understood the agreement, or to say that the norms on it. Compare the ant script and maven scripts for the same project, that is, Build.xml and Pom.xml, and you'll see why I say the cost of learning is low. If there is no agreement, there is no building standard, n projects can be able to have N project directory structure, n construction methods.
Is this the best way to follow a convention to write an XML configuration? Can only say is relative. If we follow the conventions strictly, we can even omit the writing of XML, because XML can lead to management confusion.
Many Javaweb programmers must have the experience of writing an SSH XML configuration file without knowing if you know about rails. The core idea of rails is that conventions are better than configurations, which means that XML configuration files do not appear in rails. Rails uses the various common conventions that Web applications have accumulated over the years (more specifically naming rules) instead of XML configuration files, and the mapping and discovery mechanisms within rails can implement an association between objects based on these conventions.
Using conventions instead of XML configuration files demonstrates that rails itself has done a lot of low-level work, which means that using fewer code to implement an application is highly likely. In addition, the reduction in the amount of code reduces the likelihood of bugs and reduces the difficulty of maintaining programs and upgrading programs.
If you have a "compulsive disorder", find that programmers are a little obsessive, haha, is not willing to follow the agreement how to do. I can only write a few more words to try to convince you. Do you really need to do that? Do you really need that personality? What the personality means. There is no commonality. What it means to have no versatility. Death. You may also question that Microsoft has a lot of things that are not versatile and can only run on the Windows platform and live well. But have you ever thought about so many Windows users around the world, Windows universality is not to be questioned, indirectly makes the software running on it has a certain commonality. If you want to raise the apple again, OK, friend, you are extreme. Individuality means complexity, and no one likes complex things.
Since follow the agreement so have the advantage, is not we should give up the configuration, with the agreement for the king. It has to do with Maven and Ant. If your current build contains some highly customizable processes, or your project structure can not easily be changed to the project structure of Maven, or you have written some ant script to complete a clear process in a clear way, and this process does not fit the MAVEN standard, you can still use Ant, Or use the Ant script as a plug-in to Maven. From this point of view, the Convention can not do everything, there are always some need you to customize the completion.
In summary, following the agreement, although the loss of a certain degree of flexibility, but can reduce configuration, reduce complexity, reduce learning costs, so that the program more beautiful. So I'm more inclined to agree than to configure.

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.