Making Java Groovy

Total Page:16

File Type:pdf, Size:1020Kb

Making Java Groovy Kenneth A. Kousen FOREWORD BY Guillaume Laforge MANNING Making Java Groovy Making Java Groovy KENNETH A. KOUSEN MANNING SHELTER ISLAND For online information and ordering of this and other Manning books, please visit www.manning.com. The publisher offers discounts on this book when ordered in quantity. For more information, please contact Special Sales Department Manning Publications Co. 20 Baldwin Road PO Box 261 Shelter Island, NY 11964 Email: [email protected] ©2014 by Manning Publications Co. All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by means electronic, mechanical, photocopying, or otherwise, without prior written permission of the publisher. Photographs in this book were created by Martin Evans and Jordan Hochenbaum, unless otherwise noted. Illustrations were created by Martin Evans, Joshua Noble, and Jordan Hochenbaum. Fritzing (fritzing.org) was used to create some of the circuit diagrams. Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in the book, and Manning Publications was aware of a trademark claim, the designations have been printed in initial caps or all caps. Recognizing the importance of preserving what has been written, it is Manning’s policy to have the books we publish printed on acid-free paper, and we exert our best efforts to that end. Recognizing also our responsibility to conserve the resources of our planet, Manning books are printed on paper that is at least 15 percent recycled and processed without the use of elemental chlorine. Manning Publications Co. Development editor: Cynthia Kane 20 Baldwin Road Copyeditor: Melinda Rankin PO Box 261 Proofreader: Melody Dolab Shelter Island, NY 11964 Typesetter: Dennis Dalinnik Cover designer: Marija Tudor ISBN: 9781935182948 Printed in the United States of America 1 2 3 4 5 6 7 8 9 10 – MAL – 19 18 17 16 15 14 13 To my father, Morton Kousen, MD, who taught me everything I know about dedication, persistence, and facing the future with a positive and upbeat attitude, despite whatever pain and difficulties lay ahead. He will always be my best example of what a man should be. brief contents PART 1 UP TO SPEED WITH GROOVY. ........................................1 1 ■ Why add Groovy to Java? 3 2 ■ Groovy by example 18 3 ■ Code-level integration 46 4 ■ Using Groovy features in Java 64 PART 2 GROOVY TOOLS ..........................................................91 5 ■ Build processes 93 6 ■ Testing Groovy and Java projects 126 PART 3 GROOVY IN THE REAL WORLD....................................165 7 ■ The Spring framework 167 8 ■ Database access 199 9 ■ RESTful web services 227 10 ■ Building and testing web applications 257 vii contents foreword xv preface xvii acknowledgments xix about this book xxii about the cover illustration xxvi PART 1 UP TO SPEED WITH GROOVY . ............................1 Why add Groovy to Java? 3 1 1.1 Issues with Java 4 Is static typing a bug or a feature? 5 ■ Methods must be in a class, even if you don’t need or want one 7 ■ Java is overly verbose 10 Groovy makes testing Java much easier 11 ■ Groovy tools simplify your build 13 1.2 Groovy features that help Java 14 1.3 Java use cases and how Groovy helps 15 Spring framework support for Groovy 16 ■ Simplified database access 16 ■ Building and accessing web services 16 Web application enhancements 17 1.4 Summary 17 ix x CONTENTS Groovy by example 18 2 2.1 Hello, Groovy 19 2.2 Accessing Google Chart Tools 19 Assembling the URL with query string 20 ■ Transmitting the URL 23 ■ Creating a UI with SwingBuilder 24 2.3 Groovy Baseball 26 Database data and Plain Old Groovy Objects 29 Parsing XML 35 ■ HTML builders and groovlets 42 2.4 Summary 45 Code-level integration 46 3 3.1 Integrating Java with other languages 46 3.2 Executing Groovy scripts from Java 48 Using JSR223 scripting for the Java Platform API 50 Working with the Groovy Eval class 56 ■ Working with the GroovyShell class 57 ■ Calling Groovy from Java the easy way 59 ■ Calling Java from Groovy 62 3.3 Summary 63 Using Groovy features in Java 64 4 4.1 Treating POJOs like POGOs 65 4.2 Implementing operator overloading in Java 67 4.3 Making Java library classes better: the Groovy JDK 71 4.4 Cool AST transformations 74 Delegating to contained objects 74 ■ Creating immutable objects 76 ■ Creating singletons 81 4.5 Working with XML 82 4.6 Working with JSON data 89 4.7 Summary 90 PART 2 GROOVY TOOLS ..............................................91 Build processes 93 5 5.1 The build challenge 94 5.2 The Java approach, part 1: Ant 95 CONTENTS xi 5.3 Making Ant Groovy 97 The <groovy> Ant task 97 ■ The <groovyc> Ant task 98 Writing your build in Groovy with AntBuilder 100 Custom build scripts with Gant 102 ■ Ant summary 104 5.4 The Java approach, part 2: Maven 105 The Groovy-Eclipse plugin for Maven 106 The GMaven project 110 ■ Maven summary 113 5.5 Grapes and @Grab 114 5.6 The Gradle build system 117 Basic Gradle builds 118 ■ Interesting configurations 122 5.7 Summary 124 Testing Groovy and Java projects 126 6 6.1 Working with JUnit 128 A Java test for the Groovy implementation 131 A Groovy test for the Java implementation 133 A GroovyTestCase test for a Java implementation 134 6.2 Testing scripts written in Groovy 137 Useful subclasses of GroovyTestCase: GroovyShellTestCase 139 Useful subclasses of GroovyTestCase: GroovyLogTestCase 141 6.3 Testing classes in isolation 142 Coerced closures 144 ■ The Expando class 146 StubFor and MockFor 151 6.4 The future of testing: Spock 156 The Search for Spock 156 ■ Test well, and prosper 157 Data-driven specifications 159 ■ The trouble with tribbles 161 Other Spock capabilities 163 6.5 Summary 164 PART 3 GROOVY IN THE REAL WORLD ........................165 The Spring framework 167 7 7.1 A Spring application 168 7.2 Refreshable beans 175 7.3 Spring AOP with Groovy beans 179 7.4 Inline scripted beans 185 7.5 Groovy with JavaConfig 186 xii CONTENTS 7.6 Building beans with the Grails BeanBuilder 190 7.7 Summary 197 Database access 199 8 8.1 The Java approach, part 1: JDBC 200 8.2 The Groovy approach, part 1: groovy.sql.Sql 203 8.3 The Java approach, part 2: Hibernate and JPA 208 8.4 The Groovy approach, part 2: Groovy and GORM 213 Groovy simplifications 213 ■ Grails Object-Relational Mapping (GORM) 213 8.5 Groovy and NoSQL databases 220 Populating Groovy vampires 220 ■ Querying and mapping MongoDB data 223 8.6 Summary 226 RESTful web services 227 9 9.1 The REST architecture 229 9.2 The Java approach: JAX-RS 230 JAX-RS resource and tests 232 9.3 Implementing JAX-RS with Groovy 239 9.4 RESTful Clients 242 9.5 Hypermedia 243 A simple example: Rotten Tomatoes 244 ■ Adding transitional links 246 ■ Adding structural links 249 ■ Using a JsonBuilder to control the output 250 9.6 Other Groovy approaches 253 Groovlets 253 ■ Ratpack 255 ■ Grails and REST 255 9.7 Summary 256 Building and testing web applications 257 10 10.1 Groovy servlets and ServletCategory 258 10.2 Easy server-side development with groovlets 263 A “Hello, World!” groovlet 264 ■ Implicit variables in groovlets 266 CONTENTS xiii 10.3 Unit- and integration-testing web components 268 Unit-testing servlets with Spring 268 ■ Integration testing with Gradle 270 ■ Automating Jetty in the Gradle build 272 Using an integration-test source tree 274 10.4 Grails: the Groovy “killer app” 277 The quest for the holy Grails 279 10.5 Summary 288 appendix A Installing Groovy 289 appendix B Groovy by feature 295 appendix C Soap-based web services available online at manning.com/kousen index 327 foreword When we designed the Groovy language almost 10 years ago, our main goal was to cre- ate a language that is a complement to Java, a close companion, that Java developers would be familiar with and could learn easily. The idea was to empower users to be more productive by removing the boilerplate of Java, and to simplify their program- ming lives by giving them compelling and straightforward APIs to work with. I’m proud to say that the Groovy team attained that goal, making Groovy the most popu- lar alternative language for the Java platform. Along the way, and by virtue of its nature, Groovy was adopted by Java developers in a number of ways. For example, it was introduced in Java projects for testing pur- poses, because the Groovy syntax is light and readable but still resembles that of Java. For interacting with XML payloads, web services, or databases, Groovy provides handy and elegant wrappers around the Java Development Kit that make those tasks a breeze. And for writing business rules in Java applications, Groovy shines, thanks to its metaprogramming capabilities and its concise and expressive grammar. I had the pleasure and honor of meeting Ken a few years ago at a Groovy confer- ence, and our paths have crossed several times since then. Among other topics, we talked about how Groovy is a great fit for various assignments that Java developers have to accomplish every day but that are painful with the heavier-weight Java. So when Ken told me that he envisioned writing a book on this same topic, I was excited about the idea! What makes this book stand out of the pack of Groovy books is its focus on the tasks that Java developers must tackle every day. How can I more easily parse or emit xv xvi FOREWORD XML or JSON documents? How can I test my Java code with a more expressive syntax? How can I talk to my database without the error-prone JDBC API? How can I build and test Java applications more efficiently? In this book, Ken answers all of these questions and shows you a Groovy solution for each of those chores.
Recommended publications
  • A Study on Functioning of Selenium Automation Testing Structure
    Volume 7, Issue 5, May 2017 ISSN: 2277 128X International Journal of Advanced Research in Computer Science and Software Engineering Research Paper Available online at: www.ijarcsse.com A Study on Functioning of Selenium Automation Testing Structure 1Jyoti Devi, 2Kirti Bhatia, 3Rohini Sharma* 1, 2 Sat Kabir Institute of Technology and College Management Bahadurgarh, Haryana, India 3 Jesus and Mary Delhi University Delhi, India DOI: 10.23956/ijarcsse/V7I5/0204 Abstract— In recent years, there is advancement in the field of software engineering, applications are getting automated. As the software is error prone, there should some easy and automated way to test the software application. It is very challenging to test such complicated web applications. Human intervention can be reduced by using automation tools. Selenium is an online web based software testing tool. In this article, we have study the design and functioning of the selenium tool and used it to test various online applications. In order to test an application, testers do need not to learn the selenium web driver tool completely. This tool is helpful for a developer and tester, they can analyse their code owing to screen shot characteristics of framework. It generates the adapted test report to the tester. It is very simple to sustain and restore the test suite for new version of the application by this tool. Keywords—Selenium; Automated Testing; Test Cases; Report Generation I. INTRODUCTION The objective of software testing is to discover faults and errors in a software application. Software testing utilizes more than 50 % time of software development lifecycle. Testing time depends upon the algorithm used, programming language, line of codes, function points, external and internal interfaces [1].
    [Show full text]
  • Pexpect Documentation Release 4.8
    Pexpect Documentation Release 4.8 Noah Spurrier and contributors Apr 17, 2021 Contents 1 Installation 3 1.1 Requirements...............................................3 2 API Overview 5 2.1 Special EOF and TIMEOUT patterns..................................6 2.2 Find the end of line – CR/LF conventions................................6 2.3 Beware of + and * at the end of patterns.................................7 2.4 Debugging................................................8 2.5 Exceptions................................................8 2.6 Pexpect on Windows...........................................9 3 API documentation 11 3.1 Core pexpect components........................................ 11 3.2 fdpexpect - use pexpect with a file descriptor.............................. 23 3.3 popen_spawn - use pexpect with a piped subprocess.......................... 23 3.4 replwrap - Control read-eval-print-loops................................. 24 3.5 pxssh - control an SSH session...................................... 25 4 Examples 33 5 FAQ 35 6 Common problems 39 6.1 Threads.................................................. 39 6.2 Timing issue with send() and sendline()................................. 39 6.3 Truncated output just before child exits................................. 40 6.4 Controlling SSH on Solaris....................................... 40 6.5 child does not receive full input, emits BEL............................... 40 7 History 41 7.1 Releases................................................. 41 7.2 Moves and forks............................................
    [Show full text]
  • Ajuba Solutions Version 1.4 COPYRIGHT Copyright © 1998-2000 Ajuba Solutions Inc
    • • • • • • Ajuba Solutions Version 1.4 COPYRIGHT Copyright © 1998-2000 Ajuba Solutions Inc. All rights reserved. Information in this document is subject to change without notice. No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form or by any means electronic or mechanical, including but not limited to photocopying or recording, for any purpose other than the purchaser’s personal use, without the express written permission of Ajuba Solutions Inc. Ajuba Solutions Inc. 2593 Coast Avenue Mountain View, CA 94043 U.S.A http://www.ajubasolutions.com TRADEMARKS TclPro and Ajuba Solutions are trademarks of Ajuba Solutions Inc. Other products and company names not owned by Ajuba Solutions Inc. that appear in this manual may be trademarks of their respective owners. ACKNOWLEDGEMENTS Michael McLennan is the primary developer of [incr Tcl] and [incr Tk]. Jim Ingham and Lee Bernhard handled the Macintosh and Windows ports of [incr Tcl] and [incr Tk]. Mark Ulferts is the primary developer of [incr Widgets], with other contributions from Sue Yockey, John Sigler, Bill Scott, Alfredo Jahn, Bret Schuhmacher, Tako Schotanus, and Kris Raney. Mark Diekhans and Karl Lehenbauer are the primary developers of Extended Tcl (TclX). Don Libes is the primary developer of Expect. TclPro Wrapper incorporates compression code from the Info-ZIP group. There are no extra charges or costs in TclPro due to the use of this code, and the original compression sources are freely available from http://www.cdrom.com/pub/infozip or ftp://ftp.cdrom.com/pub/infozip. NOTE: TclPro is packaged on this CD using Info-ZIP’s compression utility.
    [Show full text]
  • Technical Project and Product Manager Solution Architect and Senior Full Stack Developer
    Technical project and product manager Solution architect and senior full stack developer Profile Technical project and product manager, working with R&D software innovation processes, with a background as solution architect and senior full stack developer. Experienced manager of outsourced teams in many different countries, working with team efficiency based on pragmatic Scrum approach. Experience from scaled agile projects with hundreds of people involved. I am used to working with confidential information and have been security cleared several times. Knowledge I have been programming more than 20 different programming, script and database languages the last 36 years. My recent programming skills include NodeJS, JavaScript, Python, C#, Java, React for progressive web apps (PWA) and some courses in React-Native Expo. I have worked mostly with REST API architecture and a little GraphQL. I have specialist knowledge from leading CMS and DMS systems like Sitecore, DOCUMENTUM and Public 360, were I as product manager had to know Danish law on personal data and record management (ESDH). I worked many years on products for the educational sector and non-profit projects like Oligo Academy, that uses virtual worlds in primary schools for teaching environmental issues and other study subjects. Nikolaj Lisberg Hansen Born 1973 and started programming early in 1984. Got first programming job in 1995 and started working as freelance solution architect and technical project manager in 2006. I practice Tai Chi, love music and like to travel the world. Languages Very good Danish, English and German. Availability 10-25 hours per week normally remote or on-site near Copenhagen. Flexible salary between 96€ / hour (600 DKK) for remote work and 144€ / hour (900 DKK) for on-site work on product innovation or as technical project manager, solution architect or senior developer.
    [Show full text]
  • Introduction to Groovy and Grails
    Introduction to Groovy and Grails Mohamed Seifeddine November 25, 2009 1 Contents 1 Foreword 5 2 Introduction to Groovy 7 3 Getting started 9 3.1 Installing Groovy . .9 3.1.1 JDK - A Prerequisite . .9 3.1.2 Installing Groovy . .9 3.2 Updating Groovy . 10 3.3 Editors for Groovy and Grails . 10 3.4 groovysh, groovyConsole & groovy . 10 4 Boolean Evaluation, Elvis Operator & the Safe Navigation Op- erator 13 4.1 Elvis Operator . 15 4.2 Safe Navigation Operator . 15 5 String & GString 19 6 Classes, Dynamic type, Methods, Closures the & Meta-Object Protocol 21 6.1 Dynamic type . 25 6.2 Closure . 29 6.2.1 Create . 29 6.2.2 Call . 30 6.2.3 Getting Information . 33 6.2.4 Method Reference Pointer . 33 6.3 More on Methods . 35 6.3.1 Optional Parantheses . 35 6.3.2 Positional Parameters . 35 6.3.3 Optional Parameters . 36 6.3.4 Mapped Parameters . 37 6.3.5 Dynamic Method Call . 37 6.4 Meta-Object Protocol . 39 6.4.1 Adding Methods & Properties . 39 6.4.2 Add Constructor . 41 6.4.3 Intercepting Method Calls . 41 6.4.4 Getting Information . 42 7 Collections (List, Range, Map) and Iterative Object Methods 47 7.1 List . 47 7.2 Range . 50 7.3 Map . 52 8 Other 55 8.1 Groovy Switch . 55 8.2 Groovy SQL . 56 8.3 File . 58 8.4 Exception Handling . 60 2 8.5 Other . 60 9 Introduction to Grails 61 10 Getting Started 63 10.1 Installing Grails .
    [Show full text]
  • Fast and Scalable Automation Framework : “Booster”
    WHITEPAPER Fast and Scalable Automation Framework : “Booster” Testing is a form of software business insurance. More automation coverage means less risk. and that is good news for everyone. Sonal Pallewar Email : [email protected] “Automation Framework” and “Why do we need a framework for test automation?” A framework is a software solution that can be used in place of ordinary code that offers generic functions. Some of the challenges of automation are: ● Writing and maintaining test automation frameworks Booster– Linux based ● Scaling to high number of simultaneous tests in multithreaded various environments automation framework ● Reporting and analytics of large number of test results to assess test coverage and build quality ● Ease of use to extend and maintain the framework ● Rich libraries that can be leveraged for quick delivery of automation ”Booster” addresses the above challenges and is used to automate and test several web and mobile frontend applications as well as backend components by executing hundreds of simultaneous tests. Booster is a best-fit Linux based multithreaded automation framework that is fast, scalable and easily extensible. Booster also has readily available rich web, mobile, Linux libraries that can be leveraged to quickly build product specific tests without investing much time in interaction with web and mobile UI interfaces. 1 Need of Booster framework Linux Based Booster is a Linux based framework Supports remote execution of web tests Supports remote execution of tests in target environments with the help of paramiko python library. Supports frontend and backend automation Consists of a rich set of Selenium, mobile and Linux libraries Selenium Grid Supports serial and parallel execution of tests, Multi-platform support i.e.
    [Show full text]
  • A Multiplatform Pseudo Terminal
    A Multi-Platform Pseudo Terminal API Project Report Submitted in Partial Fulfillment for the Masters' Degree in Computer Science By Qutaiba Mahmoud Supervised By Dr. Clinton Jeffery ABSTRACT This project is the construction of a pseudo-terminal API, which will provide a pseudo-terminal interface access to interactive programs. The API is aimed at developing an extension to the Unicon language to allow Unicon programs to easily utilize applications that require user interaction via a terminal. A pseudo-terminal is a pair of virtual devices that provide a bidirectional communication channel. This project was constructed to enable an enhancement to a collaborative virtual environment, because it will allow external tools such to be utilized within the same environment. In general the purpose of this API is to allow the UNICON runtime system to act as the user via the terminal which is provided by the API, the terminal is in turn connected to a client process such as a compiler, debugger, or an editor. It can also be viewed as a way for the UNICON environment to control and customize the input and output of external programs. Table of Contents: 1. Introduction 1.1 Pseudo Terminals 1.2 Other Terminals 1.3 Relation To Other Pseudo Terminal Applications. 2. Methodology 2.1 Pseudo Terminal API Function Description 3. Results 3.1 UNIX Implementation 3.2 Windows Implementation 4. Conclusion 5. Recommendations 6. References Acknowledgments I would like to thank my advisor, Dr. Clinton Jeffery, for his support, patience and understanding. Dr. Jeffery has always been prompt in delivering and sharing his knowledge and in providing his assistance.
    [Show full text]
  • Networking Telnet
    IBM i Version 7.2 Networking Telnet IBM Note Before using this information and the product it supports, read the information in “Notices” on page 99. This edition applies to IBM i 7.2 (product number 5770-SS1) and to all subsequent releases and modifications until otherwise indicated in new editions. This version does not run on all reduced instruction set computer (RISC) models nor does it run on CISC models. This document may contain references to Licensed Internal Code. Licensed Internal Code is Machine Code and is licensed to you under the terms of the IBM License Agreement for Machine Code. © Copyright International Business Machines Corporation 1998, 2013. US Government Users Restricted Rights – Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. Contents Telnet................................................................................................................... 1 What's new for IBM i 7.2..............................................................................................................................1 PDF file for Telnet........................................................................................................................................ 1 Telnet scenarios...........................................................................................................................................2 Telnet scenario: Telnet server configuration.........................................................................................2 Telnet scenario: Cascaded Telnet
    [Show full text]
  • Selenium Python Bindings Release 2
    Selenium Python Bindings Release 2 Baiju Muthukadan Sep 03, 2021 Contents 1 Installation 3 1.1 Introduction...............................................3 1.2 Installing Python bindings for Selenium.................................3 1.3 Instructions for Windows users.....................................3 1.4 Installing from Git sources........................................4 1.5 Drivers..................................................4 1.6 Downloading Selenium server......................................4 2 Getting Started 7 2.1 Simple Usage...............................................7 2.2 Example Explained............................................7 2.3 Using Selenium to write tests......................................8 2.4 Walkthrough of the example.......................................9 2.5 Using Selenium with remote WebDriver................................. 10 3 Navigating 13 3.1 Interacting with the page......................................... 13 3.2 Filling in forms.............................................. 14 3.3 Drag and drop.............................................. 15 3.4 Moving between windows and frames.................................. 15 3.5 Popup dialogs.............................................. 16 3.6 Navigation: history and location..................................... 16 3.7 Cookies.................................................. 16 4 Locating Elements 17 4.1 Locating by Id.............................................. 18 4.2 Locating by Name............................................ 18 4.3
    [Show full text]
  • Cloud Computing Synopsis and Recommendations
    Special Publication 800-146 Cloud Computing Synopsis and Recommendations Recommendations of the National Institute of Standards and Technology Lee Badger Tim Grance Robert Patt-Corner Jeff Voas NIST Special Publication 800-146 Cloud Computing Synopsis and Recommendations Recommendations of the National Institute of Standards and Technology Lee Badger Tim Grance Robert Patt-Corner Jeff Voas C O M P U T E R S E C U R I T Y Computer Security Division Information Technology Laboratory National Institute of Standards and Technology Gaithersburg, MD 20899-8930 May 2012 U.S. Department of Commerce John Bryson, Secretary National Institute of Standards and Technology Patrick D. Gallagher, Under Secretary of Commerce for Standards and Technology and Director CLOUD COMPUTING SYNOPSIS AND RECOMMENDATIONS Reports on Computer Systems Technology The Information Technology Laboratory (ITL) at the National Institute of Standards and Technology (NIST) promotes the U.S. economy and public welfare by providing technical leadership for the nation’s measurement and standards infrastructure. ITL develops tests, test methods, reference data, proof of concept implementations, and technical analysis to advance the development and productive use of information technology. ITL’s responsibilities include the development of management, administrative, technical, and physical standards and guidelines for the cost-effective security and privacy of other than national security-related information in Federal information systems. This Special Publication 800-series reports on ITL’s research, guidance, and outreach efforts in computer security and its collaborative activities with industry, government, and academic organizations. National Institute of Standards and Technology Special Publication 800-146 Natl. Inst. Stand. Technol. Spec. Publ.
    [Show full text]
  • Perception and Effects of Implementing Kotlin in Existing Projects
    Bachelor thesis Undergraduate level Perception and effects of implementing Kotlin in existing projects A case study about language adoption Author: Emil Sundin Supervisor: Wei Song Examiner: Azadeh Sarkheyli Discipline: Informatics Course: IK2017 Credit: 15 credits Examination date: 2018-05-25 Dalarna University provides the opportunity for publishing the thesis through DiVA as Open Access. This means that the thesis work will become freely available to read and download through their portal. Dalarna University encourages students as well as researchers to publish their work in the Open Access format. We approve the publishing of this thesis work under the Open Access format: Yes ☒ No ☐ Dalarna University – SE-791 88 Falun – Phone +4623-77 80 00 Abstract The Kotlin programming language has seen an increase of adoption since its launch in 2011. In late 2017 Google announced first-class support for Kotlin on the Android platform which further popularized the language. With this increase in popularity we felt it was interesting to investigate how Kotlin affects the developer experience. We performed a case study to see how Java developers perceive the Kotlin language, and how it meets the requirements of these developers. To gather the developer requirements and their perception of Kotlin we performed two sets of interviews and rewrote parts of their codebase. The first set of interviews identified developer requirements and the second set of interviews showcased the Kotlin language and its potential use in their codebase. The results show that Kotlin can meet most of the developer requirements and that the perception of Kotlin is positive. Kotlin’s ability to be incrementally adopted was a prominent feature which reduced the inherent risks of technology adoption while providing them the ability to further evaluate the language.
    [Show full text]
  • Tooling Support for Enterprise Development
    TOOLING SUPPORT FOR ENTERPRISE DEVELOPMENT RYAN CUPRAK & REZA RAHMAN JAVA EE DEVELOPMENT • Java EE has had a bad reputation: • Too complicated • Long build times • Complicated/expensive tooling • Copious amounts of repetitive code • Expensive application servers • Overkill for most projects • Times have changed since 2000! • Java EE 5 made great strides leveraging new features introduced in Java 5. Java EE 6 pushes us forward. • Excellent tooling support combined with a simplification of features makes Java EE development fast, easy, and clean (maintainable). • It is Java EE – NOT J2EE!!! OBJECTIVE Challenge: Starting a new project is often painful. In this presentation you’ll learn: • How to setup a new Java EE project. • Disconnect between theory and practice. • Tools that you should consider learning/adding. • Best practices for Java EE development from tools side. When is the last time you evaluated your tools? APPLICATION TYPES Types of Java EE applications: • Prototype – verify technology, try different techniques, learn new features. • Throw-away – application which has a short-life space, temporary use. • Internal/external portal – application with a long life expectancy and which will grow over time. • Minimize dependence on tools. • Product – an application which deployed at a more than one customer site. Possibly multiple code branches. • Minimize dependence on tools. Life expectancy drives tooling decisions. PRELIMINARIES Considerations for a Java EE toolbox: • Build system: Ant, Maven, IDE specific? • Container: GlassFish/JBoss/ WebLogic/etc. • Technologies: EJB/JPA/CDI/JSF • IDE: Eclipse, NetBeans, IntelliJ IDEA • Other tools: Unit testing, integration testing, UI testing, etc. IDES • NetBeans • Easy to use Java EE templates. • Includes a pre-configured GlassFish container.
    [Show full text]