Skip to main content

Katharsis

  • Chapter
  • First Online:
Book cover Creating Maintainable APIs
  • 1172 Accesses

Abstract

This chapter illuminates the ideas of previous chapters with a real framework and a sample application, to provide a much clearer vision of what the JSON API can do.

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 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 49.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

Notes

  1. 1.

    This is related to the conundrum teach vs. learn. Instead of teaching clients how to interact with a system, through extensive documentation, we simply let them learn themselves what is doable via hypermedia links.

  2. 2.

    Katharsis requires at least Java 7.

  3. 3.

    See the sidebar “How to Maintain an API Documentation with Diagrams?” later in this chapter for more information about how this and the other UML diagrams in this book were produced.

  4. 4.

    I’ve used the PlantUML open-source tool (plantuml.com) capable of producing all sorts of UML diagrams (Figure 16-3 is an example of a sequence diagram).

  5. 5.

    Important refactoring happened on top of this (especially to eschew duplication of code), together with additions not found in the examples shipped with Katharsis. Moreover, the service uses newer versions of libraries than the Katharsis example code base.

  6. 6.

    You must have Maven (mvn) and Java 8 JDK installed on your machine. You can also import the project into your favorite IDE, and build and run it from there. IDEs are usually bundled with Maven support.

  7. 7.

    You can use any other tool to make HTTP requests, but curl is my favorite. Don’t try to hit the given URL from a browser, as it would probably download the response document instead of presenting it inside a window. This is due to the fact that browsers still don’t recognize the JSON API media type.

  8. 8.

    If you want to clean the database used by the Community Game service, then execute mongo community_game --eval "db.dropDatabase();".

  9. 9.

    These are part of the so-called Bean Validation API ( http://beanvalidation.org ).

  10. 10.

    Don’t try to replace your programming language with UML, and start creating overly complicated “accurate” models (unless you want to publish a scientific paper or impress your boss). They rarely achieve the desired effect, and present a maintenance nightmare. Once upon a time, there was even a vision to only work through models, and leave the rest to a fully integrated computer-aided software engineering (CASE) tool.

  11. 11.

    Notice the --globoff option in the curl command.

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2016 Ervin Varga

About this chapter

Cite this chapter

Varga, E. (2016). Katharsis. In: Creating Maintainable APIs. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-2196-9_17

Download citation

Publish with us

Policies and ethics