Groovy WHAT IS IT? HOW DOES IT WORK? IS IT USEFUL?

Slides:



Advertisements
Similar presentations
Lilian Blot 11 Spring 2014 TPOP 1. Lilian Blot 22 Spring 2014 TPOP 2.
Advertisements

Language of the Month If it’s December, it must be Ruby! Adam Coffman and Brent Beer.
WPSM Programming Language A simple language that transform simple data structure into complex xML format Wai Y. Wong Peter Chen Seema Gupta Miqdad Mohammed.
Ruby The Gem of new programming languages. An interpreted scripting language.
Scripting Languages For Virtual Worlds. Outline Necessary Features Classes, Prototypes, and Mixins Static vs. Dynamic Typing Concurrency Versioning Distribution.
History  We first begin with Java which was released in 1995 by Sun Microsystems  Initially Java was 100% interpreted at runtime and was very slow 
1 Java Grande Introduction  Grande Application: a GA is any application, scientific or industrial, that requires a large number of computing resources(CPUs,
Groovy & Grails Jean Barmash CTO, EnergyScoreCards.com
Compilers and Interpreters. Translation to machine language Every high level language needs to be translated to machine code There are different ways.
Chapter 10 Application Development. Chapter Goals Describe the application development process and the role of methodologies, models and tools Compare.
Building An Interpreter After having done all of the analysis, it’s possible to run the program directly rather than compile it … and it may be worth it.
BY: KYLE ROGAHN COMPUTER SCIENCE SEMINAR UW PLATTEVILLE 4/3/2012 Web Browser Automation - Geb.
JAVA v.s. C++ Programming Language Comparison By LI LU SAMMY CHU By LI LU SAMMY CHU.
Introduction to Python Dr. Bernard Chen Ph.D. University of Central Arkansas July 9 th 2012
+ Java vs. Javascript Jessi Style. + Java Compiled Can stand on its own Written once, run anywhere Two-stage debugging Java is an Object Oriented Programming.
Ch 1. Introduction Dr. Bernard Chen Ph.D. University of Central Arkansas Spring 2012.
CS 355 – Programming Languages
C++ Programming. Table of Contents History What is C++? Development of C++ Standardized C++ What are the features of C++? What is Object Orientation?
Christopher Jeffers August 2012
PHP TUTORIAL. HISTORY OF PHP  PHP as it's known today is actually the successor to a product named PHP/FI.  Created in 1994 by Rasmus Lerdorf, the very.
Hans-Peter Plag October 16, 2014 Session 3 Programming Languages Data Types and Variables Expressions and Operators Flow Control.
Java Introduction Lecture 1. Java Powerful, object-oriented language Free SDK and many resources at
Why Java? A brief introduction to Java and its features Prepared by Mithat Konar.
1 Groovy for Java developers and testers How Java developers and testers could use Groovy to increase their efficiency AUGUST 6, 2015.
A brief introduction to 11ACM 朱旻申. Outline What is Groovy ? Differences between Groovy & Java About closure & Dagger Methods.
Ruby! Ronald L. Ramos. What is Ruby? Ruby is a scripting language designed by Yukihiro Matsumoto, also known as Matz. It runs on a variety of platforms,
1 Module Objective & Outline Module Objective: After completing this Module, you will be able to, appreciate java as a programming language, write java.
Introduction to 12/13/20111 Prepared by: Vincent Schwarzer, Chih-Hung Hsieh Java Enterprise Application Development.
Introduction and Features of Java. What is java? Developed by Sun Microsystems (James Gosling) A general-purpose object-oriented language Based on C/C++
Ch 1. A Python Q&A Session Spring Why do people use Python? Software quality Developer productivity Program portability Support libraries Component.
Copyright © 2007 Addison-Wesley. All rights reserved.1-1 Reasons for Studying Concepts of Programming Languages Increased ability to express ideas Improved.
Hans-Peter Plag November 6, 2014 Session 4 (Programming Languages) (Data Types and Variables) Expressions and Operators Flow Control.
Eagle: Maturation and Evolution 17th Annual Tcl Conference Joe Mistachkin.
CS 4720 Dynamic Web Applications CS 4720 – Web & Mobile Systems.
C463 / B551 Artificial Intelligence Dana Vrajitoru Python.
We will talking about story of JAVA language. By Kristsada Songpartom.
Getting started with Programming using IDE. JAVA JAVA IS A PROGRAMMING LANGUAGE AND A PLATFORM. IT CAN BE USED TO DELIVER AND RUN HIGHLY INTERACTIVE DYNAMIC.
RUBY by Ryan Chase.
Chapter 1 Introducing Ant. What is ant? Ant is a build tool  Automate the tasks of compiling code, running test, and packaging the results for redistribution.
Ch 1. A Python Q&A Session. Why do people use Python? Software Quality Developer productivity Program portability Support Libraries Component integration.
Software Development Introduction
Text TCS INTERNAL Oracle PL/SQL – Introduction. TCS INTERNAL PL SQL Introduction PLSQL means Procedural Language extension of SQL. PLSQL is a database.
Terms and Rules II Professor Evan Korth New York University (All rights reserved)
Dr. Abdullah Almutairi Spring PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages. PHP is a widely-used,
1 CSC160 Chapter 1: Introduction to JavaScript Chapter 2: Placing JavaScript in an HTML File.
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Chapter 13 A & B Programming Languages and the.
Perl Ed Finegan. Overview of Pearl Perl is a high-level programming language written by Larry Wall. It derives from the C programming language and to.
By: Chad Gallati, Melissa Plakyda, Jenny Wilkes References: /a-z_programming_languages_groovy/
Presented by Alexey Vedishchev Developing Web-applications with Grails framework American University of Nigeria, 2016 Intro To MVC Architecture.
Presented By P.SRIVIDYA 085D1A0552 Programming Language.
CodeBeamer Bootcamp 2007 Customizing CodeBeamer features through scripting Aron Gombas Architect, Intland.
Part 1: Overview of LINQ Intro to LINQ Presenter: PhuongNQK.
CSC 533: Programming Languages Spring 2016
Python Programming Unit -1.
COMP 2100 From Python to Java
The language focusses on ease of use
CST 1101 Problem Solving Using Computers
CSC 533: Programming Languages Spring 2015
Spark Presentation.
Programming Basics Web Programming.
Text by: Lambert and Osborne
Ch 1. A Python Q&A Session Bernard Chen 2007.
Introduction to JSP Liu Haibin 12/09/2018.
SVTRAININGS. SVTRAININGS Python Overview  Python is a high-level, interpreted, interactive and object-oriented scripting language. Python is designed.
Spark and Scala.
(Computer fundamental Lab)
Eagle: Maturation and Evolution
FEATURES OF PYTHON.
IS 135 Business Programming
Presentation transcript:

Groovy WHAT IS IT? HOW DOES IT WORK? IS IT USEFUL?

What Groovy Is… Basic’s ◦Described as being a dynamically typed language for the Java Virtual Machine (JVM). ◦Built on the strengths of Java with additional features inspired by Python, Ruby, and Smalltalk. ◦Allows for static type check and statically compile your code for robustness and *performance. ◦Reduces programming time by reducing scaffolding code when developing web, GUI, and database applications ◦Scaffolding– Is a framework that allows for CRUD(create, read, update, delete) operations against your database with as little to no code as possible. ◦Compiles with Java byte code, thus making it possible to port code wherever Java code can run. ◦Easy to learn for current Java developers.

Three main use cases Tooling / Testing / Shell scripting ◦Shell or build scripting, data manipulation, unit testing, code generation, driving native applications Building standalone applications Perfect for small to mid-sized applications with prototyping capabilities Quick scripting with full use of Java libraries Writing dynamic websites (Grails)

Example of Groovy class Speaker { String name def age String toString() { "My name is $name and I'm $age" } def speaker = [ new Speaker(name:"George Karaszi", age:24), new Speaker(name:"John Doe", age:44) ] def upper = (it.toString().toUpperCase() ) speaker.findAll(name -> name =- /.*orge.*/ ).collect(upper).each(println it) MY NAME IS GEORGE KARASZI AND I’M 24 Output of code: Syntax much like java

Example of Groovy class Speaker { String name def age String toString() { "My name is $name and I'm $age" } def speaker = [ new Speaker(name:"George Karaszi", age:24), new Speaker(name:"John Doe", age:44) ] def upper = (it.toString().toUpperCase() ) speaker.findAll(name -> name =- /.*orge.*/ ).collect(upper).each(println it) MY NAME IS GEORGE KARASZI AND I’M 24 Output of code: Easily define lists

Example of Groovy class Speaker { String name def age String toString() { "My name is $name and I'm $age" } def speaker = [ new Speaker(name:"George Karaszi", age:24), new Speaker(name:"John Doe", age:44) ] def upper = (it.toString().toUpperCase() ) speaker.findAll(name -> name =- /.*orge.*/ ).collect(upper).each(println it) MY NAME IS GEORGE KARASZI AND I’M 24 Output of code: Easily search and interact with class outputs

Simplify Simplify Simplify…. By far one of the most powerful advantages that Groovy has, is its simplified syntax and programming structure. Groovy gets rid of the use of semicolons and other end of statement precedents. And give developers a magnitude of different ways of declaring and changing values on the fly. ◦Using the keyword def (AKA Object). Allows for multiple data types to be assigned to a variable. Groovy utilizes many types of syntactic sugar to become a super set of Java. Java original looping Groovy’s equivalent code for looping for(int i = 0; i < 3; i++) { System.out.println("United United..." ); } 3.times { println "United United..." }

Notable: XML and JSON Processing Groovy employs a Builder pattern for XML handling. Making production of data structure less verbose Original XML document Groovy’s way of doing XML java Object oriented Static ruby Object oriented, Functional Dynamic, duck typing groovy Object oriented, Functional Dynamic, Static, Duck typing def writer = new StringWriter() def builder = new groovy.xml.MarkupBuilder(writer) builder.languages { language(year: 1995) { name "java" paradigm "object oriented" typing "static" } language (year: 1995) { name "ruby" paradigm "object oriented, functional" typing "dynamic, duck typing" } language (year: 2003) { name "groovy" paradigm "object oriented, functional" typing "dynamic, static, duck typing" }

Type checking Because of the dynamic nature of Goovy, compile time is nearly non-existent. The parser in the compiler never has to check the types that are being assigned, thus allowing for faster compile time of larger projects. Since Goovy 2.0+, developers have implemented a type of static type checking during compile time with Class tester{…} This annotation will type check everything in the tester class statically. *However this does not make runtime any faster, as groovy is still dynamic.

Static Groovy The developers of Groovy set out to make sure that the primary functionality of Groovy was as dynamic as possible. However the dynamic nature raised many concerns with many Groovy developers who where accustom to static type checking. Goovy 2.0+ annotation to address the concerns that people have when it comes to compiling statically Vs. This annotation is said to speed the performance of Groovy programs. However according to Goovy’s documentation, it drastically changes the semantics of your compiled code.

Downsides of Groovy… Due to Groovy’s dynamic nature, many developers find the readability fairly hard to understand. The performance of Groovy is incredibly slow. C/C++ -> Java ->Java VM->Groovy ->Other extensions Lack of good tool support. Nothing compared to its parent Java. Not ideal for large projects. Bugs are more prevalent to applications. The creator Groovy said himself he’d never developed Groovy if someone showed him Scala first.

In The End… Groovy is a good language if you need something done fast without the unnecessary overhead java requires. Groovy is also becoming more integrated with other technologies such as Spring. Which is an attempt to reduce even more code scaffolding for enterprise application development. Groovy is a scripting language and not an all in one solution for complex problems