DiF Model - Digitalis Framework Model Module

The Model Layer Module contains DIF's utilities for easier integration with it's prefered ORM tool, Hibernate.

This module relies on the ORM Generator plugin for the Reverse Engeneering process that generates all the model code.
This code already contains calls to the DiF Model so we should never have to interact directly to this Model as long as we wish to use the previous plugin.

Utilities available

Next we describe the set of utilities that compose the DiF Model

HibernateUtil utility

This class provides the integration with Hibernate.
See this for more info on what this utility provides and how to use it.

Automated transaction cleanup

One of the most common problems using Hibernate transactions is missing transactions cleanups. By definition an Hibernate Session is used in the scope of the current thread, and MUST be committed or rolled back before it's end.
Often a developer has a fork in it's code that does not instruct the transaction to commit the data. On some occasions a less informed developers does not know that even simple querys are a transaction for Hibernate, and thus must be started and ended.
But the worst case scenario if mission exception control that captures errors and issues rollback statements. A simple and unfortunally all that common NullPointerException can provoke a missing commit/rollback action and leave hanging an Hibernate transaction with several database locks that can block an entire system!

To prevent this DIFModel adds clean up code to the DIF Dispatcher inner code by injection, than assures that every dif controller cycle is monitores in case of sucess or error and the proper clean up is ensured for all DIFModel managed database models. Any exception issues the corresponding rollback and when no problems are reported all transactions are committed.

This feature is NOT CONFIGURABLE, due to it's mandatory nature.

Simplified Data Sources

A simplified API that standardizes the way we handle any type of data source. It specifies how to make the classic CRUD operation on any supported data source.

This concept is supported by the ORM reverse engineering process for generating all the model representation for any SQL database.

Besides SQL Data Models, we can implement other data sources like normal List? collections, and allow any DiF DataSource compliant process to query and manipulate data in this form. Many more data formats will be support over time.

On of the main advantages this feature has is the tight integration with some UI Components that fully automate CRUD interface creations from the UI page to the model operations.

See more on this on the DiF User Guide.

Back to DiF main page