Chapter 5. Introduction to Writing Modules

In this chapter, we will cover:

  • Creating and using your own module
  • Building a flexible registration module
  • Understanding events
  • Managing module dependencies
  • Using the same model for different applications
  • Understanding bytecode enhancement
  • Adding private module repositories
  • Preprocessing content by integrating stylus
  • Integrating Dojo by adding command line options

Introduction

Modularity should be one of the main goals, when designing your application. This has several advantages from a developer's point of view: reusability and structured components are among them.

A module in Play is basically just an application which can be included in your current application. This application-in-application architecture means that there are only very few differences between your application and the included module. You implicitly know the basics of modules as an average Play developer.

In order to get to know more modules, you should not hesitate to take a closer look at the steadily increasing amount of modules available at the Play framework modules page at http://www.playframework.org/modules.

When beginning to understand modules, you should not start with modules implementing its persistence layer, as they are often the more complex ones.

In order to clear up some confusion, you should be aware of the definition of two terms throughout the whole chapter, as these two words with an almost identical meaning are used most of the time. The first is word is module and the second is plugin. Module means the little application which serves your main application, where as plugin represents a piece of Java code, which connects to the mechanism of plugins inside Play.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.85.221