‎2009 Apr 06 7:15 AM
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 ?
‎2009 Apr 22 2:17 PM
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!
‎2009 Apr 06 7:25 AM
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
‎2009 Apr 06 7:30 AM
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
‎2009 Apr 06 2:24 PM
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
‎2009 Apr 22 2:17 PM
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!
‎2009 Apr 22 3:41 PM
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