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)

Transaction management


There are many times when in an application we need to fire multiple queries of add, update, remove, or all of them as a batch. In a batch of statements where multiple queries get fired against a database as a unit, all the queries should be successful or none of them. This is called transaction management. Transaction management is helpful in maintaining data consistency. In transaction management, it is not necessary that the queries should be fired against different tables in a database.

The following are the properties of a transaction:

  • Atomicity: When firing multiple queries, either all of them should be committed or none of them. This property makes sure that whatever operations are performed on the database and whenever any error occurs, no operations will be performed on the database.

  • Consistency: Before and after completing the transaction, the state of all the tables will be consistent. If any error occurs, the state of every table may vary. This leads to...