Skip to main content

Part of the book series: Advances in Intelligent Systems and Computing ((AISC,volume 276))

  • 1884 Accesses

Abstract

Groovy is a dynamic language that allows the easy modification of its own behaviour. A simple mechanism to introduce changes in the core language is by using Abstract Syntax Tree(AST) transformations. In this paper we describe two new features added to Groovy: the introduction of Reification, and the enhancement of Groovy Closures. In the first extension we make it possible for the user to know the types of a generic class during runtime. In the second one, Groovy closures were improved with the addition of two methods: one to provide closures return type and another to give the closure’s source code.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 169.00
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 219.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Similar content being viewed by others

References

  1. DZone GContracts 1.0, http://groovy.dzone.com/announcements/gcontracts-10-released

  2. First Lambda Expression, http://diarmuidmoloney.wordpress.com/2011/12/10/my-first-java-8-lambda-expression/

  3. GContracts A Programming by Contract Extension for Groovy!, https://github.com/andresteingress/gcontracts/wiki

  4. GPars Groovy Parallel Systems, http://gpars.codehaus.org/

  5. Groovy, http://groovy.codehaus.org/

  6. Java 8 - Closures, Lambda Expressions Demystified, http://frankhinkel.blogspot.pt/2012/11/java-8-closures-lambda-expressions.html

  7. Axelsen, E.W., Krogdahl, S.: Groovy package templates: supporting reuse and runtime adaption of class hierarchies. ACM SIGPLAN Notices 44(12), 15–26 (2009)

    Article  Google Scholar 

  8. Burmako, E.: Scala macros: Let our powers combine. In: Proceedings of the 4th Annual Scala Workshop (2013)

    Google Scholar 

  9. Cazzola, W., Vacchi, E.: Fine-grained annotations for pointcuts with a finer granularity. In: Shin, S.Y., Maldonado, J.C. (eds.) SAC, pp. 1706–1711. ACM (2013)

    Google Scholar 

  10. Cazzola, W., Vacchi, E.: @java: annotations in freedom. In: Shin, S.Y., Maldonado, J.C. (eds.) SAC, pp. 1688–1693. ACM (2013)

    Google Scholar 

  11. Cortinhas, C., Barros, F.: Extending the groovy language using ast transformations to monitor variables and methods. In: Rocha, Á., Correia, A.M., Wilson, T., Stroetmann, K.A. (eds.) Advances in Information Systems and Technologies. AISC, vol. 206, pp. 745–752. Springer, Heidelberg (2013)

    Chapter  Google Scholar 

  12. Dinkelaker, T., Mezini, M.: Dynamically linked domain-specific extensions for advice languages. In: Proceedings of the 2008 AOSD Workshop on Domain-Specific Aspect Languages, 3 p. ACM (2008)

    Google Scholar 

  13. Heinlein, C.: Most-flexipl: modular, statically typed, flexibly extensible programming language. In: Proceedings of the ACM International Symposium on New Ideas, New Paradigms, and Reflections on Programming and Software, pp. 159–178. ACM (2012)

    Google Scholar 

  14. König, D., Paul, P.K., Laforge, G., Jon, J.S.: Groovy in Action, 2nd edn. Manning (2011)

    Google Scholar 

  15. Naftalin, M., Wadler, P.: Java generics and collections. O’Reilly (2009)

    Google Scholar 

  16. Wada, H., Suzuki, J.: Modeling turnpike frontend system: A model-driven development framework leveraging uml metamodeling and attribute-oriented programming. In: Briand, L.C., Williams, C. (eds.) MoDELS 2005. LNCS, vol. 3713, pp. 584–600. Springer, Heidelberg (2005)

    Chapter  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Carlos Cortinhas .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2014 Springer International Publishing Switzerland

About this paper

Cite this paper

Cortinhas, C., Barros, F. (2014). Extending Groovy’s Reification and Closures. In: Rocha, Á., Correia, A., Tan, F., Stroetmann, K. (eds) New Perspectives in Information Systems and Technologies, Volume 2. Advances in Intelligent Systems and Computing, vol 276. Springer, Cham. https://doi.org/10.1007/978-3-319-05948-8_1

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-05948-8_1

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-05947-1

  • Online ISBN: 978-3-319-05948-8

  • eBook Packages: EngineeringEngineering (R0)

Publish with us

Policies and ethics