Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Persistence Service

Former Member
0 Likes
960

Hi,

I am unable to understand the concept of Persistence Service. I was able to find only one place in Help.sap.com that has some details about this. Can anyone please explain me in simple terms why would one use Persistence service ?

I would be able to do the same operation using Open SQL statements. Why would I need to create bunch of classes to perform the Update/ Read / Delete operations ?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
906

Hi There,

I agree with Gandolf - or are there any significant difference or advantages of using a persistent object instead of a SQL statement (besides encapsulation etc)? As far as I understand it's not possible to store any object persistently but only those which are mapped 1:1 to a pre-defined dictionary table. Or am I wrong?

Thanks for your oppinions!

5 REPLIES 5
Read only

Former Member
0 Likes
906

Hi:

Have a look

[Service|http://help.sap.com/saphelp_nw04/Helpdata/EN/fd/022008bc9311d4b2e80050dadfb92b/content.htm]

[Link2|http://saphelp.border-states.com/EN/fd/022008bc9311d4b2e80050dadfb92b/frameset.htm]

Regards

Shashi

Read only

0 Likes
906

Hi,

I already have this link for Help.sap.com. I am not able to understand it. Could you please explain it urself in simple terms

Read only

naimesh_patel
Active Contributor
0 Likes
906

One of the advantage would be: Different Layer to work with. If you think of your application composed with the Layers, you may see: View, Controller, Model, Business Object, Persistent Object Layer.

Generally, we only deal with the Transient data but by using the Persistent Layer we can directly work on the persistent object.

Check this: [Concepts Used in Persistence |http://help.sap.com/saphelp_nw04/Helpdata/EN/f5/a3682ebc6911d4b2e80050dadfb92b/frameset.htm]

"To work with persistent data, the system has to load it into transient data objects belonging to the ABAP program while that program is being executed. Then, after processing has been completed, it stores the data in a persistent form again. During this time, the content of the data exists twice: once in the ABAP program (transiently), and once in the appropriate storage medium (persistently). "

Regards,

Naimesh Patel

Read only

Former Member
0 Likes
907

Hi There,

I agree with Gandolf - or are there any significant difference or advantages of using a persistent object instead of a SQL statement (besides encapsulation etc)? As far as I understand it's not possible to store any object persistently but only those which are mapped 1:1 to a pre-defined dictionary table. Or am I wrong?

Thanks for your oppinions!

Read only

matt
Active Contributor
0 Likes
906

The persistence service is designed for object oriented access to the database layer. You could select directly, but then you would be removing a level of abstraction. I only use the persistence service if I'm developing a bespoke application. If I'm accessing SAP tables, I'll probably not use it.

So - there's no direct benefit - except good OO design! In my applications, I have db layer, business objects layer, model layer, UI layer.

For other objects - well, you can make them persistent in a number of ways - serialization to files/db clusters etc. But you wouldn't use the persistence layer, necessarily.

matt