Amazon.com: Scripting in Java: Languages, Frameworks, and Patterns (9780321321930): Dejan Bosanac: Books
Scripting in Java: Languages, Frameworks, and Patterns and over one million other books are available for Amazon Kindle. Learn more


or
Sign in to turn on 1-Click ordering.
or
Amazon Prime Free Trial required. Sign up when you check out. Learn More
Kindle Edition
 
   
Sell Back Your Copy
For a $0.50 Gift Card
Trade in
More Buying Choices
Have one to sell? Sell yours here
Scripting in Java: Languages, Frameworks, and Patterns
 
 
Start reading Scripting in Java: Languages, Frameworks, and Patterns on your Kindle in under a minute.

Don't have a Kindle? Get your Kindle here, or download a FREE Kindle Reading App.

Scripting in Java: Languages, Frameworks, and Patterns [Paperback]

Dejan Bosanac (Author)
3.8 out of 5 stars  See all reviews (4 customer reviews)

List Price: $59.99
Price: $37.75 & this item ships for FREE with Super Saver Shipping. Details
You Save: $22.24 (37%)
o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o
In Stock.
Ships from and sold by Amazon.com. Gift-wrap available.
Want it delivered Friday, February 24? Choose One-Day Shipping at checkout. Details
Textbook Student FREE Two-Day Shipping for students on millions of items. Learn more

Formats

Amazon Price New from Used from
Kindle Edition $21.60  
Paperback $37.75  

Book Description

August 19, 2007 0321321936 978-0321321930 1

Groovy and Beyond: Leverage the Full Power of Scripting on the JavaTM Platform!

 

Using the JavaTM platform’s new scripting support, you can improve efficiency, streamline your development processes, and solve problems ranging from prototyping to Web application programming. In Scripting in Java, Dejan Bosanac covers key aspects of scripting with Java, from the exciting new Groovy scripting language to Java’s new Scripting and Web Scripting APIs.

 

Bosanac begins by reviewing the role and value of scripting languages, and then systematically introduces today’s best scripting solutions for the Java platform. He introduces Java scripting frameworks, identifies proven patterns for integrating scripting into Java applications, and presents practical techniques for everything from unit testing to project builds. He supports key concepts with extensive code examples that demonstrate scripting at work in real-world Java projects. Coverage includes

 

·        Why scripting languages offer surprising value to Java programmers

·        Scripting languages that run inside the JVM: BeanShell, JavaScript, and Python

·        Groovy in depth: installation, configuration, Java-like syntax, Java integration, security, and more

·        Groovy extensions: accessing databases, working with XML, and building simple Web applications and Swing-based UIs

·        Bean Scripting Framework: implementation, basic abstractions, and usage examples

·        Traditional and new patterns for Java-based scripting

·        JSR 223 Scripting API: language bindings, discovery mechanisms, threading, pluggable namespaces, and more

·        JSR 223 Web Scripting Framework: scripting the generation of Web content within servlet containers

 

About the Web Site

 

All code examples are available for download at this book’s companion Web site.


Customers Who Bought This Item Also Bought


Editorial Reviews

About the Author

Dejan Bosanac is a professional software developer and technology consultant. He specializes in the integration and interoperability of diverse technologies, especially those related to Java and the Web. He has spent several years developing complex software projects, ranging from highly trafficked Web sites to enterprise applications, and was a member of the JSR 223 Expert Group.

Excerpt. © Reprinted by permission. All rights reserved.

Preface

Preface

Java is an excellent object-oriented programming language. It has provided many benefits to software developers, including a good object-oriented approach, implicit memory management, and dynamic linking, among others. These language characteristics are one of the main reasons for Java's popularity and wide acceptance.

But Java is much more than a programming language; it's a whole development platform. This means that it comes with a runtime environment (JRE), which provides the virtual machine, and the standardized application programming interfaces (APIs) that help developers accomplish most of their desired tasks. The main advantages of this integrated runtime environment are its true platform independence and simplification of software development.

On the other hand, scripting languages have played an important role in the information technology infrastructure for many years. They have been used for all kinds of tasks, ranging from job automation to prototyping and implementation of complex software projects.

Therefore, we can conclude that the Java development platform can also benefit from scripting concepts and languages. Java developers can use scripting languages in areas proven to be most suitable for this technology. This synergy of the Java platform and scripting languages, as we will see, adds an extra quality to the overall software development process.

In this book, I describe the concepts behind scripting languages, summarize solutions available to Java developers, and explore use cases and design patterns for applying scripting languages in Java applications.

How This Book Is Organized

This book consists of five logical parts.

Part I

The first part of the book comprises two chapters that describe scripting languages in general:

  • Chapter 1, "Introduction to Scripting"—Here I define the basic characteristics of scripting languages and compare them to system programming languages.

  • Chapter 2, "Appropriate Applications for Scripting Languages"—In this chapter, I explain the role of traditional (native) scripting languages in the overall information technology infrastructure. I also discuss tasks for which scripting languages have been used in various systems over time.

Part II

After discussing the basic concepts and uses of scripting languages, we are ready to focus on real technologies and solutions for the Java platform. This part of the book contains the following chapters:

  • Chapter 3, "Scripting Languages Inside the JVM"—I begin this chapter by covering the basic elements of the Java platform and explaining where scripting languages fit into it. After that, I describe the main features of three popular scripting languages available for the Java Virtual Machine (JVM)—BeanShell, JavaScript, and Python—and how they can be used to interact with Java applications. At the end of this chapter, I describe other solutions available for Java developers.

  • Chapter 4, "Groovy"—Here I discuss the Groovy scripting language in detail. I cover its Java-like syntax and all the scripting concepts built into this language, and I discuss Groovy's integration with Java, as well as some security-related issues.

  • Chapter 5, "Advanced Groovy Programming"—In this chapter, I cover some of the Groovy extensions that can aid in day-to-day programming tasks. I also explain how Java programmers can access databases, create and process XML documents, and easily create simple Web applications and swing user interfaces, using the scripting-specific features in Groovy covered in Chapter 4.

  • Chapter 6, "Bean Scripting Framework"—In this chapter, I describe the general Java scripting framework. In addition to explaining how to implement general support in your project for any compliant scripting language, I also discuss some basic abstractions implemented in the Bean Scripting Framework (BSF) and show some examples of successful uses.

Part III

This part of the book focuses primarily on the use of scripting languages in real Java projects:

  • Chapter 7, "Practical Scripting in Java"—Here I cover topics related to the use of scripting for everyday programming tasks, such as unit testing, interactive debugging, and project building, among others.

  • Chapter 8, "Scripting Patterns"—In this chapter, I discuss Java application design patterns that involve scripting languages. I show how you can use scripts to implement some parts of traditional design patterns and introduce some new design patterns specific only to the scripting environment. I also discuss the pros and cons of these design patterns, as well as their purpose.

Part IV

In the final part of this book, I cover the "Scripting for the Java Platform" specification, which was created according to the Java Specification Request (JSR) 223. Specifically, I cover two APIs defined by the specification:

  • Chapter 9, "Scripting API"—Here I cover the Scripting API, the standardized general scripting framework for the Java platform. The purpose of this framework is the same as that of the Bean Scripting Framework, but the Scripting API brings many new features that the modern scripting framework needs. The Scripting API is a standard part of the Java platform with the release of Mustang (Java SE 6).

  • Chapter 10, "Web Scripting Framework"—In this chapter, I discuss the Web Scripting Framework, a framework built on top of the Scripting API and created to enable scripting languages to generate Web content inside a servlet container. I explain how native scripting languages, such as PHP, can be synergized with the Java platform to bring more flexibility in Web application development.

Part V

At the end of the book, you can find a section comprising three appendixes. The main purpose of these appendixes is to provide the technical details about installation and use of certain technologies described in the book:

  • Appendix A, "Groovy Installation"—In this appendix, I describe how to install, build, and configure the Groovy scripting language. A working installation of the Groovy interpreter is needed to run the code samples from the text.

  • Appendix B, "Groovy IDE Support"—In this appendix, I provide instructions on how to install general Groovy support for Integrated Development Environments (IDEs).

  • Appendix C, "Installing JSR 223"—Here I describe how to install the reference implementation (RI) of the JSR 223, which is needed to run examples from Chapter 10.

I hope you'll enjoy reading the book.

About the Web Site

This book is extended with a Web site at http://www.scriptinginjava.net where you can find the following:

  • Source codes of all examples shown in the book available for download

  • Book news, updates, and additions

  • News and information related to this field of software development



Product Details

  • Paperback: 552 pages
  • Publisher: Addison-Wesley Professional; 1 edition (August 19, 2007)
  • Language: English
  • ISBN-10: 0321321936
  • ISBN-13: 978-0321321930
  • Product Dimensions: 7 x 1 x 9.1 inches
  • Shipping Weight: 1.7 pounds (View shipping rates and policies)
  • Average Customer Review: 3.8 out of 5 stars  See all reviews (4 customer reviews)
  • Amazon Best Sellers Rank: #280,777 in Books (See Top 100 in Books)

More About the Author

Dejan Bosanac is a software developer, technology consultant and author. He is focused on integration and interoperability of different technologies, especially the ones related to Java and Web. Dejan spent a number of years in development of complex software projects, ranging from highly-trafficked web sites through enterprise applications.

For any further information, visit his web site nighttale.net or contact him at dejan@nighttale.net.

 

Customer Reviews

4 Reviews
5 star:
 (2)
4 star:
 (1)
3 star:    (0)
2 star:    (0)
1 star:
 (1)
 
 
 
 
 
Average Customer Review
3.8 out of 5 stars (4 customer reviews)
 
 
 
 
Share your thoughts with other customers:
Most Helpful Customer Reviews

3 of 3 people found the following review helpful:
4.0 out of 5 stars getting started with java 1.6 scripting, September 16, 2007
By 
This review is from: Scripting in Java: Languages, Frameworks, and Patterns (Paperback)
"Scripting in Java" is a great book to get started with using scripting languages that interact with Java. It is assumed the reader knows Java syntax, a reasonable assumption. The author does go into detail on dynamic vs static languages, the role of the JVM and other concepts. This is helpful as it highlights the important parts when thinking about scripting languages. When discussing any scripting language, the author includes a section on setting it up.

The description of scripting languages, benefits, syntax and libraries is all good. The author shows how to call scripting languages from Java and vice versa. I particularly like how the author pointed out concepts about each language such as how variables are handled. I also like how the author addressed concerns people, myself included, have about scripting languages. The end of the book covers advanced concepts about the scripting framework.

My only complaint is the formatting of the book. It has very large two inch margins. The text is only four inches wide. This makes the book seem heavier/thicker than it needs to be. More importantly, some of the code listings don't follow the huge margin requirement. On some pages, you see a code fragment that honors the two inch margin and another only a half inch from the edge of the book. This happens just often enough to be disorienting when reading.

Overall, the book is very good and I recommend it.
Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


2 of 3 people found the following review helpful:
1.0 out of 5 stars Too ambitious and stopped short at everything, April 3, 2008
By 
Alfonso Reyes (The Woodlands/Houston, TX - United States) - See all my reviews
(REAL NAME)   
Amazon Verified Purchase(What's this?)
This review is from: Scripting in Java: Languages, Frameworks, and Patterns (Paperback)
I bought the book impressed at the the reviews at the top. Also the title was telling a lot. Bad judgment. I got disappointed by the lack of depth on almost all the subjects, including Groovy, which consumes good part of the book. And it was not even good at Groovy. It also fails at Bean scripting. Jython, which is my favorite language, is poorly covered as well.
Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


0 of 2 people found the following review helpful:
5.0 out of 5 stars Any computer collection which is both advanced and strong in Java programming references needs SCRIPTING IN JAVA., December 4, 2007
This review is from: Scripting in Java: Languages, Frameworks, and Patterns (Paperback)
Java platform's new scripting support can help streamline development processes and solve problems, especially when paired with SCRIPTING IN JAVA, which covers many key components of Java scripting. The overview begins with discussions of the importance of scripting language and processes, introduces Java frameworks, identifies proven routines for blending scripting into Java applications, and moves to in-depth technical details on language bindings, code configuration and more. Any computer collection which is both advanced and strong in Java programming references needs SCRIPTING IN JAVA.

Diane C. Donovan
California Bookwatch
Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No

Share your thoughts with other customers: Create your own review
 
 
 
Most Recent Customer Reviews


Only search this product's reviews



Inside This Book (learn more)
Key Phrases - Statistically Improbable Phrases (SIPs): (learn more)
groovy script, scripting patterns, scripting framework, engine scope, double subtotal, standalone methods, insert into users, swing user interfaces, scripting concepts, native scripting languages, anonymous inner classes, script evaluation, servlet container, interactive console, public static void, scripting solutions, engine implementations, string script, template engines, using scripting languages, script engine, interactive shell, php script, script variable, appropriate engine
Key Phrases - Capitalized Phrases (CAPs): (learn more)
Web Scripting Framework, Bean Scripting Framework, Java Web, Method Example, Dejan Bosanac, Sun Microsystems, Practical Scripting, Some String, Apache Web, Increase Price, Java Specification Request, Java Virtual Machine, Bsh Workspace, Guido van Rossum, Native Method, New Balance, Pat Niemeyer, Take Listing
New!
Concordance | Text Stats
Browse Sample Pages:
Front Cover | Table of Contents | First Pages | Index | Back Cover | Surprise Me!
Search Inside This Book:

What Other Items Do Customers Buy After Viewing This Item?


Tags Customers Associate with This Product

 (What's this?)
Click on a tag to find related items, discussions, and people.
 
(7)

Your tags: Add your first tag
 

Customer Discussions

This product's forum
Discussion Replies Latest Post
No discussions yet

Ask questions, Share opinions, Gain insight
Start a new discussion
Topic:
First post:
Prompts for sign-in
 


Active discussions in related forums
Search Customer Discussions
Search all Amazon discussions
   
Related forums



So You'd Like to...


Create a guide


Look for Similar Items by Category


Look for Similar Items by Subject