Quickly implement data additions and deletions using Dojo and grails (CRUD)

Source: Internet
Author: User
Tags vector graphics library fast web grails netbeans

Reasons to choose Grails and Dojo

With the wide application of Web, the development of Web application is more and more, and most of web development is to check the deletion of database. For the deletion of a database table, the development of the design pattern based on MVC (model-view-controller) often requires Domain class, Controller, 4 pages to be censored, and the form input data to be checked. This will inevitably involve a lot of duplicate and paste modifications of similar functionality. If you want to liberate yourself from repetitive work, Grails is a good choice. Using Grails only write a domain class can automatically generate CRUD 4 pages and corresponding controller methods to achieve the database deletion and deletions, and to achieve the server-side data verification, thus greatly improve the development efficiency.

Similar web rapid development frameworks include Rails, Django, and TurboGears, and Grails has the following advantages over them:

Grails is a set of open source frameworks for fast WEB application development, written by 15% Groovy code and 85% Java code, and built on a classic framework (SPRING,HIBERNATE,SITEMESH) that gives you a solid The one-stop frame with super high productivity now.

Grails learns fast and easy to use, and if you are familiar with Hibernate, Spring, Sitemesh, and JSP, you can learn grails within one hours.

Grails runs on top of the JVM, and the resulting war package can be deployed on a variety of mature servers Tomcat, Jboss,weblogic,webspere, and so on.

Performance is much faster than RAILS2 (100% Ruby).

Grails is acquired by SpringSource and has strong technical support.

The CRUD pages generated by the default templates for Grails are a bit shabby, and the actual projects often require richer, more visually attractive, and more convenient controls. such as page layout controls, Tab controls, trees, menus, calendars, editors, progress bars, and so on. Now there are a lot of JS frameworks dedicated to Web UI, such as Dojo, Extjs, Jquery, YUI and so on. We chose Dojo because Dojo has the following advantages:

The component is rich and has a strong UI (Dijit). This will reduce our heavy workload, and the current development is very active.

The functionality outside the UI is also powerful, and the full Stack framework extends the capabilities of DHTML, for example:

Support for integration with browser Back/forward buttons.

Dojo Offline, a cross-platform, offline storage API.

The Chart component makes it easy to generate graphs on the browser side.

A vector graphics library based on SVG/VML.

Google Maps, Yahoo! Maps components to facilitate the development of MASHUP applications.

Dojox Socket, "Server Push" technology based on WebSocket or XHR long connections.

Dojo is a good infrastructure with object-oriented design, a unified namespace, and package management mechanisms (the Package system and Custom builds) extensibility. Dojo is actually a component model, similar to Spring, to support large-scale component-based development. The role of component models is to enhance the reuse of code, which is critical to improve development efficiency.

Dojo has strong support for IBM, Oracle, etc. behind the scenes, which is a very important advantage. Dojo is now the choice of many open source frameworks, including: WebWork, Tapestry, Eclipse ATF, myfaces. The Dojo development team is led by Alex Russell, a large and powerful force.

Open source, using BSD software licenses.

Quick-Build CRUD framework (MVC)

Development environment Configuration

First you need to install the JDK and set the Java_home. This article is using JDK 1.6.

Grails official website downloads and extracts grails.zip. This article uses the Grails1.3.7.

Create a Grails_home environment variable to add $GRAILS _home/bin to the PATH.

It is customary to use the IDE's choice of IntelliJ Idea,netbeans and Spring STS. This article takes the free Netbeans7.0.1 as an example, the configuration is very simple, only need to set up Grails home under the tools->options->miscellaneous->groovy, can carry on the development of the Grails project. (See Figure 1)

Figure 1. Grails Configuration in Netbeans

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.