Tips for writing a plugin

Here are some tips for writing a plugin:

  • Before you start writing a plugin, check if you really need one to solve your problem. If your problem does not require meddling with the application's life cycle, it's better to write a library.
  • While writing/updating a plugin, simultaneously build an example Play application that uses the plugin. This will allow you to check the functionality of it thoroughly with only the additional overheads of publishing the plugin locally for every change made.
  • If the plugin exposes some services, try to provide a helper object. This makes it easier to maintain the API's consistency and also simplifies the developer experience.

    For example, most of the plugins provided by Play (such as akka

Get Mastering Play Framework for Scala now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.