Book Image

Apache OFBiz Development: The Beginner's Tutorial

By : Jonathon Wong, Rupert Howell
Book Image

Apache OFBiz Development: The Beginner's Tutorial

By: Jonathon Wong, Rupert Howell

Overview of this book

<p>Apache OFBiz (Open For Business) is versatile open-source enterprise automation software that powers many small and medium sized businesses around the world. It incorporates a number of mature applications such as ERP, e-Commerce, MRP and CRM.<br /><br />Built around an MVC framework with common logic, data model and process components, Ofbiz allows existing and bespoke applications to be added through a component-based architecture. Ofbiz includes a mature suite of enterprise applications that integrate and automate a company's many business needs.<br />&nbsp;<br />This easy-to-read book will quickly enable newcomers to get hands-on with OFBiz. It provides an overview of the main modules and employs illustrated examples that show readers how to build exemplary business applications rapidly. Covering the main aspects of the Model-View-Controller framework, the reader will gain a working knowledge of Widgets, Entities, and The Service Engine. The authors also describe how to tweak OFBiz, and offer valuable performance and development tips. By navigating through the flow of OFBiz and providing insight into the thousands of examples that already exist in the core code they have made this book a must-have for anyone looking to get started with OFBiz.</p>
Table of Contents (20 chapters)
Apache OFBiz Development
Credits
About the Authors
About the Reviewers
Preface
Simple Method User's Guide

Using the Entity Engine Cache


OFBiz has a really neat feature that, if used correctly, can drastically increase the application's performance by dramatically cutting down the number of queries sent to the database. It does this by using what is known as the Entity Engine Cache. The principle of a cache is to act as an easily accessible store of data. This store is first checked and if the required data is there then it is retrieved immediately. If the required data is not present in the cache then it is obtained, in the case of the Entity Engine Cache, via a database lookup. The data is then placed into the cache. The next time the same information is required, the cache is again checked and the data is returned immediately from the cache.

Since the cache is held in memory, the lookup is now performed much faster.

Using the cache is easy. Where we would normally use the GenericDelegator object's findByPrimaryKey() method to return one record, we use findByPrimaryKeyCache(). The Cache appendage...