Analysis of the advantages and disadvantages of grails framework and comparison of similar

Source: Internet
Author: User
Tags comparison mixed grails

The advantages of Grails

DRY (don ' t Repeat yourself, don't repeat yourself), the Convention is better than the configuration (Convention over Configuration)

The idea that dry and conventions take precedence over configuration is a new idea of the web framework that rails sprang up and was quickly and widely received and appreciated. As the rails of the Jee World, Grails brings these cutting-edge design concepts to the JEE community, which has become obsolete, with distinctive features and the resulting excellent development efficiency.

DRY's idea is to avoid duplication of information. The dry in grails is mainly about the URL mapping definition (urlmappings.groovy). After defining the application's individual URLs in Urlmappings.groovy, developers will no longer have to hard-code the program URLs everywhere by using Grails's predefined dynamic controller methods and GSP tags. For example, using GSP tags <g:createLink>,<g:createLinkTo> and <g:link>, you can produce the required URL only if you provide controller,action and optional parameters. You can consult your grails documentation for specific uses.

Grails and rails are very similar in that the conventions are better than the configuration. The so-called convention is superior to configuration, is to organize the resources according to the framework Convention, can dispense any additional configuration. For example, grails custom tags, stored in the application directory under the Grails-app/taglib path, and named in Xxxtaglib.groovy, can be used in the GSP without any configuration of the tag library. There are also service classes, job classes, including the entire Grails application directory structure, are agreed because of the embodiment of the principle of configuration. In these aspects JEE developers will be very excited to get rid of all the cumbersome configuration, and really save a lot of development time.

Jvm

By running on top of the JVM, Grails has a very mature, industry-standard level of operating environment that has been developed over many years. The stability of the JVM and the latest version of the performance are already quite mature. Compared with the most direct comparison object Rails,grails in the performance of the operating environment is more obvious. In addition, existing Java reusable components can be used directly to grails, which is undoubtedly one of the obvious advantages of grails.

Groovy language

The relationship between Grails and the groovy language is inseparable. For groovy, Grails is its biggest killer application. For Grails, groovy is the core technology that enables flexible, rapid development that distinguishes it from other web frameworks that run on the JVM.

Groovy's dynamic features are its biggest bright spot, and there is little to lose from other popular dynamic languages such as Ruby. Meta-programming,closure, etc. popular dynamic language features are well implemented in groovy. Also, groovy programs can be compiled as a. class file of JVM bytecode and run directly on the JVM, and the performance of groovy programs can be helped. Groovy can be mixed with Java and mixed-compilation, making it easier and faster for Java programmers to get into the groovy world without wasting much of their input in the Java language. Programming with groovy is much faster and easier than using Java, and is attractive to a large number of Java programmers.

Plug-in system

Grails's plug-in system is also one of its highlights. First, similar to the Rails,django web framework, the idea of a plug-in (reusable module) is a first-class citizen of the framework, based on the concept of microkernel. The functionality of Grails, except for the core modules, is almost always implemented through Plug-ins. In fact, a grails plug-in is basically exactly the same as a grails application and can also be run using the grails run-app command. The difference lies in the fact that a plugin's root directory requires a Fooplugin.groovy file to provide some descriptive information about the plug-in.

Grails Plug-ins can do almost anything, and the Grails community already offers a wide variety of plug-ins that are posted on the Grails official plug-in source. To view the existing official Plug-ins, you can execute the following command.

grails list-plugins

The plugin name (for example, Foo-plugin) is seen in the official source and only one command is required to install the plugin.

grails install-plugin foo-plugin

Grails downloads the appropriate plug-in package and extracts it to the local grails application's plugin path and automatically executes the plug-in's own installation script.

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.