Book Image

Learning Modular Java Programming

By : Tejaswini Mandar Jog
Book Image

Learning Modular Java Programming

By: Tejaswini Mandar Jog

Overview of this book

Modular programming means dividing an application into small parts and then developing it. It is an approach taken by developers to build applications and helps them add efficiency in their development process, thus making it more effective. The book starts with the fundamentals of Modular Programming. Then we move on to the actual implementation, where we teach developers how to divide an application into different modules or layers (such as presentation, execution, security, lifecycle, services, and so on) for better management. Once readers are well-versed in these modules and their development, the book shows how to create bindings in order to join these different modules and form a complete application. Next, the readers will learn how to manage these modules through dependency injection. Later, we move on to testing; readers will learn how to test the different modules of an application. The book ends by teaching readers how to maintain different versions of their application and how to modify it. By the end of the book, readers will have a good understanding of modular programming and will be able to use it to build applications with Java.
Table of Contents (15 chapters)

Persistence


Data storage is a very common and basic requirement of enterprise applications. Data storage ensures that the data collected from the user will be saved over time. The mechanism of saving data for the duration so as to make it available later is called persistency.

In Java, normally the persistency is of an object. Java can save an object state using the following ways:

  • Object serialization

  • Storing data in XML format

  • Saving the data in a relational database

Using object serialization

The process by which an object is saved across the network is serialization. In Java, an object is saved in the file. So we can even say, saving an object to the file is serialization.

Disadvantages of using object serialization

The disadvantages of object serialization are as follows:

  • Serialization adds resource overhead

  • Serialization is slow

Storing data in XML

In the past few years, XML has emerged as a favorite choice to handle data in a file using markups. The good thing is, the developer can use their...