Monday, July 22, 2013

persistent objects in hibernate

Persistency: The place where data can be saved permanently is called persistent store.
EX: Files, Database software
Insert, update, delete and select operations on persistent stores to manipulate data are called
persistence operations. These operations are also called a CURD or CRUD or SCUD operations.
CURD:
C--Create (insert)
U--Update
R--Read (Select)
D--Delete
CRUD:
C---Create (insert)
R---Read (Select)
U---Update
D---Delete
SCUD:
S---Select
C---Create
U---Update
D---Delete
Logic written in software application to interact with persistent store and perform persistent
operations is called persistence logic.
EX: JDBC Code, Hibernate Code, I/O Stream Code and e.t.c.,
Presentation Logic: The logic that generates user interface for end user is called presentation
logic. End user uses this user interface to supply inputs to application and to view results given
by application. (OR)
To view formatted results given by application. The main logic of application that generates
results based on given inputs is called business logic.
Sample Application: Read sno, sname and marks from end user (Persistence logic) calculate
total and average.
tot=m1+m2+m3
avg=tot/3 business logic
Generate rank for the student based his marks avg*(business logic)
Display student details
including tot, avg rank for end user…(Presentation logic).
End user: The operator of application is end user.
Note: If there is no separate business logic then persistent logic itself acts business logic of
application.
Java app----I/O Streams---------------------- Files
Java App-------JBDC, o-r mapping----------- Database Software.
Java App--------JDBC+OQL+ORDBMS----- ODB Software (Versant, Poet)
Files are good as persistent stores only in small scale applications like desktop games, mobile
games e.t.c., but there are not good as persistent stores in large scale projects. Database softwares
are good as persistent stores in medium, large scale organizations. EX: Banking websites e.t.c.,
Limitations of Files:
1. No security
2. No query language support
3. Update and delete operations are complex.
4. Manipulating data with multiple conditions is complex.
5. Merging and comparison.
To overcome this problem we use Database software as persistent stores.
Object Database Software: The Database software which can store software object as Database
table column value is called Object Database Software.

No comments:

Post a Comment