This chapter covers some traditional and new patterns for Java-based scripting, including:
- Scripted Components - This pattern explains how to compose an application out of reusable components (written in Java) with scripts.
- Mediator (Glue Code) - This pattern explains how to create flexible many-to-one relationships among components.
- Script Object Factory - This pattern explains how to improve the runtime performance
of scripting solutions in the production environment.
- Observer (Broadcasters) - This pattern explains how to create flexible one-to-many relationships among components.
- Extension Point - This pattern explains how to extend components’ behavior with simple-to-write scripts.
- Active File - This pattern explains how to use scripting to store both data and the code that handles that data in the file.
- The example of the Script Object Factory pattern is located in the
To build this example run:
ant -f ch8-build.xml
To execute this example run:
java -cp classes:$GROOVY_HOME/embeddable/groovy-all-1.0-JSR-06.jar net.scriptinginjava.ch8.mediator.FactoryApp
- The example of the Extension point pattern is located in the
Component2contain the first and second example respectively.
- The example of the Active file pattern is located in the
- November 13, 2007
Code samples for Chapter 10 demonstrating the Web Scripting Framework are available for download. Also, as this is the last chapter of the book you can download the archive containing code samples for all chapters from here. Now that I finally sorted out all these examples, it’s time to move on with new projects and resources related to the topic, so stay tuned.
- October 26, 2007
- October 24, 2007
- October 12, 2007
Code samples for Chapter 6 demonstrating Bean Scripting Framework are available for download. Enjoy.
- October 5, 2007
- September 21, 2007
java.net has published an article titled Scripting with Balance in Design and Performance
- September 18, 2007
- September 5, 2007
- August 25, 2007
Code samples for Chapter 3 are available for download
- August 2, 2007
JavaWorld published the second excerpt from Chapter 1.
- March 6, 2008
- February 19, 2008
News and links
It’s been an interesting period for “dynamic languages on JVM” technologies. Here’s a couple of news and interesting articles:
- January 2, 2008
Dealing with large code bases
There’s an interesting discussion in community these days on issues of dealing with large code bases and how dynamic languages can help Java projects in that manner. I summarized some of thes ...
- December 12, 2007
Groovy 1.5 released
Groovy 1.5 has been released. It’s practically 1.1 release, but due to volume of changes introduced by the release it has been re-branded. Some of the most important features of the new Groov ...
- October 17, 2007
OpenJDK community has a new project, Multi-Language VM (or just mlvm). It is announced by John Rose, from Sun, on the ...
- September 28, 2007
Graeme Rocher explains new meta-programming API improvements added to Groovy 1.1....
- September 26, 2007
Groovy 1.1 beta 3
Groovy 1.1 beta 3 has been released a few days ago, bringing emplacements like Java5 enums, new shortcut replacement for ternary operator, Groovy shell and Swing console emplacements and more. Full ...
- August 24, 2007
JRuby and Jython releases
- June 29, 2007
Rhino on Rails
- June 12, 2007
JRuby 1.0 released