Groovy.

Slides:



Advertisements
Similar presentations
Bringing Procedural Knowledge to XLIFF Prof. Dr. Klemens Waldhör TAUS Labs & FOM University of Applied Science FEISGILTT 16 October 2012 Seattle, USA.
Advertisements

Configuration management
Verification and Validation
Department of Computer Engineering Faculty of Engineering, Prince of Songkla University 1 5 – Abstract Data Types.
ITEC200 – Week03 Inheritance and Class Hierarchies.
Syntax & terminology review While the following slides are not exactly what we did on the board (object diagrams are not shown here) they cover most of.
CSE115: Introduction to Computer Science I Dr. Carl Alphonce 219 Bell Hall
Programming with Objects: Class Libraries and Reusable Code.
Objects and Classes First Programming Concepts. 14/10/2004Lecture 1a: Introduction 2 Fundamental Concepts object class method parameter data type.
Confined Types Encapsulation and modularity Seminar November, 2005 presented by: Guy Gueta.
Encapsulation by Subprograms and Type Definitions
1 Chapter 4 The Fundamentals of VBA, Macros, and Command Bars.
1 Memory Model of A Program, Methods Overview l Memory Model of JVM »Method Area »Heap »Stack.
OBJECT ORIENTED PROGRAMMING IN C++ LECTURE
1CMSC 345, Version 4/04 Verification and Validation Reference: Software Engineering, Ian Sommerville, 6th edition, Chapter 19.
I NTRODUCTION TO P ROGRAMMING ICS 3U 1. W HAT I S A P ROGRAM ? A program is a set of instructions that makes the computer do something. There are two.
Inheritance using Java
Verification and Validation Yonsei University 2 nd Semester, 2014 Sanghyun Park.
Java Virtual Machine Java Virtual Machine A Java Virtual Machine (JVM) is a set of computer software programs and data structures that use.
JIT in webkit. What’s JIT See time_compilation for more info. time_compilation.
1 Groovy for Java developers and testers How Java developers and testers could use Groovy to increase their efficiency AUGUST 6, 2015.
Introduction to 12/13/20111 Prepared by: Vincent Schwarzer, Chih-Hung Hsieh Java Enterprise Application Development.
MD – Object Model Domain eSales Checker Presentation Régis Elling 26 th October 2005.
DB2 Universal Database Confidential | July 2012 | India Software Lab Click to add text © 2012 IBM Corporation An End to End Windows Automation Framework.
CS 153: Concepts of Compiler Design August 26 Class Meeting Department of Computer Science San Jose State University Fall 2015 Instructor: Ron Mak
Jaroslav Šnajberk, Tomáš Potužák, Richard Lipka Department of Computer Science and Engineering Faculty of Applied Sciences University of West Bohemia,
Chapter 12 Support for Object oriented Programming.
Component 4: Introduction to Information and Computer Science Unit 5: Overview of Programming Languages, Including Basic Programming Concepts Lecture 2.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University IWPSE 2003 Program.
JAVA Ekapap Julnonyang When it was implemented? Developed by Sun Microsystems. The first public implementation was Java 1.0 in 1995 The language.
Programming Assignment 4 Code generator Md. Zahurul Islam Center for Research on Bangla Language Processing (CRBLP) BRAC University.
Inheritance and Class Hierarchies Chapter 3. Chapter 3: Inheritance and Class Hierarchies2 Chapter Objectives To understand inheritance and how it facilitates.
YG - CS Concept of Encapsulation What is encapsulation? - data and functions/methods are packaged together in the class normally.
Object and Classes อ. ยืนยง กันทะเนตร คณะเทคโนโลยีสารสนเทศและการสื่อสาร มหาวิทยาลัยพะเยา Chapter 3.
Review A program is… a set of instructions that tell a computer what to do. Programs can also be called… software. Hardware refers to… the physical components.
By: Chad Gallati, Melissa Plakyda, Jenny Wilkes References: /a-z_programming_languages_groovy/
JAVA TRAINING IN NOIDA. JAVA Java is a general-purpose computer programming language that is concurrent, class-based, object-oriented and specifically.
HIGH-LEVEL LANGUAGE PROGRAMMING PARADIGMS. Programming languages come in many forms or 'paradigms'. Each form of language offers advantages over other.
Chapter 1 Object Orientation: Objects and Classes.
Python : highlights Based on T. K. Prasad’s slides.
Laurea Triennale in Informatica – Corso di Ingegneria del Software I – A.A. 2006/2007 Andrea Polini XVII. Verification and Validation.
Sung-Dong Kim, Dept. of Computer Engineering, Hansung University Java - Introduction.
CIS 234: Object-Oriented Programming with Java
The language focusses on ease of use
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
Chapter 5: Enhancing Classes
Chapter 10 Programming Fundamentals with JavaScript
Objects as a programming concept
PROGRAMMING LANGUAGES
Designing a DSL in KOTLIN
Upgrading Your C# Programming Skills to Be a More Effective Developer
Creating Objects & String Class
Verification and Validation
Generics, Lambdas, Reflections
Verification and Validation
Object Oriented Programming
Designing for Inheritance
12 Product Configurator
Chapter 10 Programming Fundamentals with JavaScript
6 Delegate and Lambda Expressions
Concepts From Alice Switching to Java Copyright © Curt Hill.
Lecture 15 (Notes by P. N. Hilfinger and R. Bodik)
Sridhar Narayan Java Basics Sridhar Narayan
Creating Objects A variable holds either a primitive value or a reference to an object A class name can be used as a type to declare an object reference.
The Challenge of Cross - Language Interoperability
Hans Zaunere, Managing Member
Reasons To Study Programming Languages
Functions By Anand George.
Chengyu Sun California State University, Los Angeles
Presentation transcript:

Groovy

Overview First released in 2004 Dynamically compiled to JVM bytecode Most Java code is syntactically valid Groovy Unlike Java, Groovy can be used as a scripting language

Groovy vs. Java

Domain Specific Languages A DSL is a computer language that’s targeted to a particular kind of problem, rather than a general purpose language that’s aimed at any kind of software problem Three main Groovy features make it easy to write DSL’s: Method Interception - every class has an invokeMethod() method that can be overridden and will be called first when you call a non-existent method on an object of the class. Dynamic Invocation - Groovy can call methods and get and set properties/fields of objects dynamically. Closures + Delegates – A closure in Groovy is an open, anonymous, block of code that can take arguments, return a value, and be assigned to a variable. The context in which a closure is defined is stored in a closure’s delegate property and can be modified dynamically.

Problem Given the Customer class to the left, we want to create a Validator class that will validate the fields based on the constraints closure in the Customer class The Validator class will be instantiated and the validate() method will be called as seen on the right

Solution: Groovy to the rescue

Further Reading Closures: http://groovy-lang.org/closures.html DSL example in more detail: http://www.artima.com/weblogs/viewpost.jsp?thread=291467 Another great DSL example: https://dzone.com/articles/groovy-dsl-simple-example More about DSL’s: http://www.martinfowler.com/bliki/DomainSpecificLanguage.html