Grails Mansura Habiba 13 november 2011. Introduction What is Grails? Runs on the Java Virtual Machine Used Java like dynamic language Groovy Inspired.

Slides:



Advertisements
Similar presentations
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 15 Introduction to Rails.
Advertisements

May 13th, Lucek Consulting Basic Java Servlet/JSP Web Development David Lucek Lucek Consulting
Introduction to Maven 2.0 An open source build tool for Enterprise Java projects Mahen Goonewardene.
Developing in CAS. Why? As distributed you edit CAS 3 with Eclipse and build with Maven 2 – Best Practice for Release Engineering – Difficult edit-debug.
Java Script Session1 INTRODUCTION.
Apache Struts Technology
1.  Understanding about How to Working with Server Side Scripting using PHP Framework (CodeIgniter) 2.
Introduction To Java Objectives For Today â Introduction To Java â The Java Platform & The (JVM) Java Virtual Machine â Core Java (API) Application Programming.
Copyright Dr Peter Lappo Copy only with credits. 1 Building an Online Conference Booking Programme with Grails In an Hour !
JSP: JavaServer Pages Juan Cruz Kevin Hessels Ian Moon.
Groovy & Grails Jean Barmash CTO, EnergyScoreCards.com
Apache Struts Technology A MVC Framework for Java Web Applications.
Web Applications Basics. Introduction to Web Web features Clent/Server HTTP HyperText Markup Language URL addresses Web server - a computer program that.
Introduction to Java web programming Dr Jim Briggs JWP intro1.
Tomcat Celsina Bignoli History of Tomcat Tomcat is the result of the integration of two groups of developers. – JServ, an open source.
Intro to Servlets Lec 26. Web-Based Enterprise Applications in Java Figure shows a simplified view of one application and its layers.
Creating a Hello App Using Google App Engine. What are Google apps? Apps is an abbreviation for application. An app is a piece of software. It can run.
Struts 2.0 an Overview ( )
DAT602 Database Application Development Lecture 15 Java Server Pages Part 1.
Android Introduction Platform Overview.
Apache Tomcat Web Server SNU OOPSLA Lab. October 2005.
Submitted by: Madeeha Khalid Sana Nisar Ambreen Tabassum.
M. Taimoor Khan * Java Server Pages (JSP) is a server-side programming technology that enables the creation of dynamic,
Rails and Grails. To get started Make sure you have java installed You can get the sdk and jre at:
Groovy WHAT IS IT? HOW DOES IT WORK? IS IT USEFUL?
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)

INTERNET APPLICATION DEVELOPMENT For More visit:
® IBM Software Group © 2006 IBM Corporation Kick-start your Java Apps: Free Software, fast development Eclipse IDE, WASCE, DB2 Express-C.
Secure ASP.NET MVC5 Application with Asp.Net Identity Changde Wu Self Introduction Professional.NET Developer in greater Boston area Specialized in WPF.
Groovy in 15 minutes… Johannes Carlén Callista Enterprise AB
COLD FUSION Deepak Sethi. What is it…. Cold fusion is a complete web application server mainly used for developing e-business applications. It allows.
FUNCTIONS AND STORED PROCEDURES & FUNCTIONS AND PROTECTING A DB AND PHP (Chapters 9, 15, 18)
Java Users Group Charleston, SC June 25, 2008 Introduction to Grails by Jason McDonald.
An Introduction To Building Groovy Web Applications With Grails Jeff Brown – Principal Software Engineer Object Computing Inc.
Apache Struts RIFE Ruby on Rails Harry R. Erwin, PhD University of Sunderland CIT304/CSE301.
By: Saurabh Dixit.  Groovy server pages  Taglibs  Validators in grails.
Ruby on Rails Your first app. Rails files app/ Contains the controllers, models, views and assets for your application. You’ll focus on this folder for.
Lecturer: Prof. Piero Fraternali, Teaching Assistant: Alessandro Bozzon, Advanced Web Technologies: Struts–
Introduction to 12/13/20111 Prepared by: Vincent Schwarzer, Chih-Hung Hsieh Java Enterprise Application Development.
Creating Dynamic Web Pages Using PHP and MySQL CS 320.
Ch 1. A Python Q&A Session Spring Why do people use Python? Software quality Developer productivity Program portability Support libraries Component.
2006 JavaOne SM Conference | Session BOF-2521 | Rapid Web Application Development with Grails Graeme Rocher Managing Director Agilize it
George Gonsalves.  Free and lightweight web development tool.  Create, publish, and maintain your website  Optimized for Open Source  Designed for.
Core Java Introduction Byju Veedu Ness Technologies httpdownload.oracle.com/javase/tutorial/getStarted/intro/definition.html.
Web Technologies Lecture 8 Server side web. Client Side vs. Server Side Web Client-side code executes on the end-user's computer, usually within a web.
Ch 1. A Python Q&A Session. Why do people use Python? Software Quality Developer productivity Program portability Support Libraries Component integration.
CS562 Advanced Java and Internet Application Introduction to the Computer Warehouse Web Application. Java Server Pages (JSP) Technology. By Team Alpha.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
Date : 3/04/2010 Web Technology Solutions Class: PHP Web Application Frameworks.
Java Programming: Advanced Topics 1 Building Web Applications Chapter 13.
10 Copyright © 2004, Oracle. All rights reserved. Building ADF View Components.
Session 11: Cookies, Sessions ans Security iNET Academy Open Source Web Development.
Ruby on Rails. Web Framework for Ruby Designed to make it easier to develop, deploy, and maintain web applications Design with Model-View-Controller –almost.
Apache Struts Technology A MVC Framework for Java Web Applications.
Tutorial 6 Creating a Web Form
START Application Spencer Johnson Jonathan Barella Cohner Marker.
Basics Components of Web Design & Development Basics, Components, Design and Development.
Presented by Alexey Vedishchev Developing Web-applications with Grails framework American University of Nigeria, 2016 Intro To MVC Architecture.
Presentation Title Up to Three Lines Long Arial 28pt Name, 26pt Speaker Company, 18pt Misc. Info, 16pt Speaker logo centered below photo.
Web Technology Solutions
PHP using MySQL Database for Web Development (part II)
JSP (Java Server Page) JSP is server side technology which is used to create dynamic web pages just like Servlet technology. This is mainly used for implementing.
PHP / MySQL Introduction
Apache Tomcat Web Server
Introduction to Grails
Google App Engine Ying Zou 01/24/2016.
International Living Atlases Workshop Madrid 2018
Web Application Development Using PHP
Presentation transcript:

Grails Mansura Habiba 13 november 2011

Introduction What is Grails? Runs on the Java Virtual Machine Used Java like dynamic language Groovy Inspired by Rubi on rails Created and used by Google 2

Feature of Grails Grails is a rapid web application development framework built on Groovy and Spring Grails has full stack environement Grails is modular and extensible through a plugin system Just like Spring Grails deployed in any environment 3

Stack 4

Full Stack Web Framework 5 Web MVCGSP ViewesServlet Container DatabaseI18n Test SupportDoc Engine GORM (Data Access) Build An easy to use MVC Framework Embedded Servlet Simple but Powerful Build in DB access and Modelling In Memory SQL Database Build in Internationalizartion WiKi based HTML Doc Engine

Grails MVC Framework 6 Spring Dispatcher Servlet Grails Dispatcher Servlet Simple Grails Controller Simple Grails Controller Helper User Interface (GSP) Grails Controller Grails Service/ Plug-ins Grails Domain DB GORM Template (Sitemesh) Extends URI Request View Model & View mapping

Comparison of Groovy with Ruby and Java ConsiderationJava ( JVM ?)Ruby on Rails Groovy and Grails Reduced Time to Market NoYes Reduced CostsNoYes Long term scalability YesNoYes Recommended for applications currently on Java and PHP YesNoYes 7

ConsiderationJava ( JVM ?)Ruby on RailsGroovy and Grails Lines of codes to write (Prototypical form validation example) 2086 ReadabilityLengthy lines of codes make it less readable Small size helps in readabilityGood IDE support and hence increases readability. Also size of code governs readability PerformanceHighComparitively lower than Java and Grails Higher than RoR but lesser than Java Well-structured and updated knowledge base YesNoYes Adaptability with AgileNoYes Enterprise supportYesSmall applications. The support of enterprise technologies is not at the focus of the community Could be used for prototyping and also for real applications In built testing tools availableNoYes Developer availabilityHuge supplyNot as much compared to JavaGroovy is a natural transition for Java developers ScalabilityYesNoYes Richness of API/libraries available YesNoYes Ability to embed in desktop (Java/C++) applications YesNoYes Ease of deploymentNoYes Learning curveYesDepends on the history of the developer. Generally start with the database schema and generate domain objects, view and controller from there Depends on the history of the developer. Start with the domain objects and generate view, controller and database schema. A lot more people can write proper domain classes than proper database schemata. 8

Installation (JDK) Download JDK from the following Url Invoke the installer and follow the installation Setup JAVA_HOME as User variable Add % JAVA_HOME %\bin to Path 9

Installation (Grails) Download GGTS from the following link Unzip the binary Plug and play –No need to set up GRAILS_HOME –No need to modify Path varible –No need to set up Server 10

Grails Installation Folder 11 IDE Grails Server Open Source Licence

Create a Web Application grails create-app HelloWorld install-plugin spring-security-core s2-quickstart com.grails.tutorial User Role Add properties to generated User Class grails generate-all com.grails.tutorial.User grails run-app Application will be available at 12

Grails Web Application: Important files 13

Grails Web Application: Url mapping Custome DSL for Mapping URLs to view, controller, action Support rich constraints for mechanism Support HTTP method for REST 14

15 Grails Web Application: Url mapping

Grails & validation 16 class User { String login String password String Integer age Date birthDate static constraints = { login size: 5..15, blank: false, unique: true password size: 5..15, blank: false true, blank: false age min: 18 birthDate max: new Date() } ${err} 1 2 3

Validating the data : Standerd validation nullable - Ensures the property value cannot be null blank- Prevents empty fields - Checks for well-formed addresses inList - Displays a combo-box Unique - Prevents duplicate values in the database 17 min, max - Minimum, maximum value for a numeric field minSize, maxSize Minimum, maximum length for a text field matches - Applies a regular expression against a string value validator - Set to a closure or block to use as a custom validation

Grails & Internationalization Grails ships with several message bundles for a whole range of languages within the grails-app/i18n directory. For example: –messages.properties –messages_da.properties –messages_de.properties –messages_es.properties –messages_fr.properties 18 Default

19 Grails & Internationalization

Reading Messages in the View Reading Messages in Controllers Reading Messages in Tag Libraries 20 def show() { def msg = message(code: "my.localized.content", args: ['Juan', 'lunes']) } def myTag = { attrs, body -> def msg = g.message(code: "my.localized.content", args: ['Juan', 'lunes']) } Grails & Internationalization

grails-app/conf/UrlMappings.groovy /grails-app/conf/spring/resources.groovy 21 Grails & Internationalization Category

Grails Plugin All available plugin – Plugins are themeselves Grails applications Plugins are provided with several hooks during install Plugin resources are added to the main application at startup 22

Grails Plugin > grails list-plugins > grails install-plugin > grails plugin-info > grails create-plugin 23

24

Grails Testcase 25

Most used Grails Command – grails create-app [project_Name] – grails create-domain-class [qualified_domain_class_Name] – grails generate-all/view/controller [qualified_domain_class_Name] – grails install-plugin [plugin-name] – grails run-app – grails test-app – grails war – grails console 26

Grails and Mobile Application Development 27 1.Sencha/ExtJS ( 2.Grails ( 3.MySQL ( 4.Tomcat (tomcat.apache.org) 5.Apache (

SOA and REST with Grails 28

Why Grails is Popular 29 InfoQ's Top 20 Web Frameworks for the JVMInfoQ's Top 20 Web Frameworks for the JVM 2013

Why Grails is Popular (Cont..) Agile and dynamic language for the Java Virtual Machine Java + Additional features. Makes modern programming features available to Java developers with almost- zero learning curve Supports Domain-Specific Languages and other compact syntax so your code becomes easy to read and maintain 30

Why Grails is Popular (Cont..) Makes writing shell and build scripts easy with its powerful processing primitives, OO abilities and an Ant DSL Increases developer productivity by reducing scaffolding code when developing web, GUI, database or console applications 31

Why Grails is Popular (Cont..) Simplifies testing by supporting unit testing and mocking out-of-the-box Seamlessly integrates with all existing Java objects and libraries Compiles straight to Java byte code so you can use it anywhere you can use Java 32

33