File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes What is the advantage of Persistence layer Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "What is the advantage of Persistence layer" Watch "What is the advantage of Persistence layer" New topic

What is the advantage of Persistence layer


Joined: May 17, 2004
Posts: 16
Hi All,
We can use Torque as Persistence layer to seperate Business logic and DB. What all are the features of using these type of persistence layer above the database?

Thanks in advance.

Jeremy Wilson
Ranch Hand

Joined: Feb 18, 2003
Posts: 166
Separation of code has been the big advantage for me. All SQL code and configuration is in one location and the application logic uses a common data model. It also allows you to move to different back end implementations without changing application logic. Our application uses hibernate as a persistance layer in small installations and EJB CMP and Session beans for large deployments. The application business logic and views never change, it is common in both deployment scenarios. With out this abstraction we could never do this.

Jeremy Wilson
Jayesh Lalwani
Ranch Hand

Joined: Nov 05, 2004
Posts: 502
1) Flexibility
If you need to change databases, or if you want to change how you access database(EJB/DAO) then you just change your persistence layer
2) Reusability
I in big enterprise-wide solutions, you might have multiple applications going to the same central database. Having a seperate persistence layer allows you to reuse you database code
3) Division of labor
You can have programmers that have database expertise work on your database layer, and programmers who have domain knowledge can code your business layer. If you muddle them all up, then either you need a programmer who has domain knowledge AND expertise in database.
I agree. Here's the link:
subject: What is the advantage of Persistence layer
It's not a secret anymore!