Making java groovy

369 92 0
Making java groovy

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

Kenneth A Kousen FOREWORD BY Guillaume Laforge MANNING www.it-ebooks.info Making Java Groovy www.it-ebooks.info www.it-ebooks.info Making Java Groovy KENNETH A KOUSEN MANNING SHELTER ISLAND www.it-ebooks.info 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: orders@manning.com ©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 20 Baldwin Road PO Box 261 Shelter Island, NY 11964 Development editor: Copyeditor: Proofreader: Typesetter: Cover designer: Cynthia Kane Melinda Rankin Melody Dolab Dennis Dalinnik Marija Tudor ISBN: 9781935182948 Printed in the United States of America 10 – MAL – 19 18 17 16 15 14 13 www.it-ebooks.info 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 www.it-ebooks.info www.it-ebooks.info brief contents PART PART PART UP TO SPEED WITH GROOVY 1 ■ Why add Groovy to Java? ■ Groovy by example 18 ■ Code-level integration ■ Using Groovy features in Java 46 64 GROOVY TOOLS 91 ■ Build processes 93 ■ Testing Groovy and Java projects 126 GROOVY IN THE REAL WORLD 165 ■ The Spring framework ■ Database access 199 ■ RESTful web services 227 10 ■ Building and testing web applications 257 vii www.it-ebooks.info 167 www.it-ebooks.info contents foreword xv preface xvii acknowledgments xix about this book xxii about the cover illustration xxvi PART UP TO SPEED WITH GROOVY 1 Why add Groovy to Java? 1.1 Issues with Java Is static typing a bug or a feature? Methods must be in a class, even if you don’t need or want one Java is overly verbose 10 Groovy makes testing Java much easier 11 Groovy tools simplify your build 13 ■ ■ ■ 1.2 1.3 Groovy features that help Java 14 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 www.it-ebooks.info ... WITH GROOVY 1 ■ Why add Groovy to Java? ■ Groovy by example 18 ■ Code-level integration ■ Using Groovy features in Java 46 64 GROOVY TOOLS 91 ■ Build processes 93 ■ Testing Groovy. .. Testing Groovy and Java projects 126 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... www.it-ebooks.info CHAPTER Why add Groovy to Java? Compiled Groovy bytecodes + groovy- all jar Compiled Java bytecodes Java Runtime Environment (JVM + standard libraries) Groovy script source groovy command (compiles

Ngày đăng: 12/03/2019, 09:25

Từ khóa liên quan

Mục lục

  • Front cover

  • brief contents

  • contents

  • foreword

  • preface

  • acknowledgments

  • about this book

    • Who are you?

    • Roadmap

    • Code conventions and downloads

    • Author Online

    • About the author

    • about the cover illustration

    • Part 1—Up to speed with Groovy

      • 1 Why add Groovy to Java?

        • 1.1 Issues with Java

          • 1.1.1 Is static typing a bug or a feature?

          • 1.1.2 Methods must be in a class, even if you don’t need or want one

          • 1.1.3 Java is overly verbose

          • 1.1.4 Groovy makes testing Java much easier

          • 1.1.5 Groovy tools simplify your build

          • 1.2 Groovy features that help Java

          • 1.3 Java use cases and how Groovy helps

            • 1.3.1 Spring framework support for Groovy

            • 1.3.2 Simplified database access

Tài liệu cùng người dùng

Tài liệu liên quan