<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Why do we need Persistent Classes ? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/why-do-we-need-persistent-classes/m-p/7045176#M1501308</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;I would like to know what is the advantage of Persistence Classes over Open SQL.&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let's first start with what SAP says about the [persistence service|http://help.sap.com/saphelp_nw70ehp2/helpdata/en/f5/a36828bc6911d4b2e80050dadfb92b/frameset.htm]:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;The Persistence Service lets the ABAP programmer work with relational database data in an object-oriented way.&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;So we're talking here about an [ORM|http://en.wikipedia.org/wiki/Object-relational_mapping] framework. I.e. the &lt;EM&gt;persistent storage&lt;/EM&gt; of data is realized in SAP via a [relational database|http://en.wikipedia.org/wiki/Relational_database], where the data model is not object oriented. Let's say that you have created a class &lt;EM&gt;sales order&lt;/EM&gt; and want to store and retrieve &lt;EM&gt;sales order objects&lt;/EM&gt; (i.e. specific instances of this class). If you have a relational database, you have to model a corresponding schema for representing your &lt;EM&gt;sales order&lt;/EM&gt; class and then "handcode" the translation from database tables into &lt;EM&gt;sales order objects&lt;/EM&gt; and vice versa.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now imagine a world where you have a nice ORM, that does the work for you. E.g. look at web frameworks like [grails|http://www.grails.org/] making heavy use of [convention over configuration|http://en.wikipedia.org/wiki/Convention_over_configuration], which allow you to easily generate database representations from your objects (without tons of coding/effort!). Essentially you can start off with your class definitions, define some attributes and the framework (ORM) will automatically generate the corresponding database tables for you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Contrast that with SAP (see online help on [mapping assistant for persistence classes|http://help.sap.com/saphelp_nw70ehp2/helpdata/en/d9/b84508bc9411d4b2e80050dadfb92b/frameset.htm]):&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;You may have to create new database tables, database views, or structures for the object model in the ABAP Dictionary. &lt;SPAN __default_attr="red" __jive_macro_name="color"&gt;At present the system does not perform this function automatically.&lt;/SPAN&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So in general the ORM is supposed to make the developer's life easier by providing a framework for translating objects into (relational) database tables. However, sometimes the automatic translation/generation along with the default access methods is not optimal and that's where you actually go back to code your own SQL statements for doing the database-to-object conversions and vice versa. So the SAP &lt;EM&gt;persistence classes&lt;/EM&gt; still use OpenSQL under the hood, but in some cases (e.g. mass processing), you might want to tune the used SQL statements yourself...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I apologize for the long excursion, but in the end my view on persistence classes is quite simple: Use them if they make your life more simple and your coding less complex, without causing any bigger performance hit - otherwise stick to handcoded SQL statements... (long live [KISS|http://en.wikipedia.org/wiki/KISS_principle]!) &lt;SPAN __jive_emoticon_name="wink"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers, harald&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 14 Jul 2010 12:56:00 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-07-14T12:56:00Z</dc:date>
    <item>
      <title>Why do we need Persistent Classes ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/why-do-we-need-persistent-classes/m-p/7045174#M1501306</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear OO Gurus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I just finished the chapter on "Persistent Objects" in "ABAP Objects - ABAP Programming in SAP NW by Horst Keller".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I could really appreciate its utility though. Googled a bit, read a few blogs on SCN but still the utility remains blurred. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to know what is the advantage of Persistence Classes over Open SQL. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Jul 2010 10:44:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/why-do-we-need-persistent-classes/m-p/7045174#M1501306</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2010-07-14T10:44:09Z</dc:date>
    </item>
    <item>
      <title>Re: Why do we need Persistent Classes ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/why-do-we-need-persistent-classes/m-p/7045175#M1501307</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;The main advantage is you need not to fetch the data from the database in case of persistance class Every time..&lt;/P&gt;&lt;P&gt;As the data is already fetched using SELECT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw2004s/helpdata/en/f5/a3682ebc6911d4b2e80050dadfb92b/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw2004s/helpdata/en/f5/a3682ebc6911d4b2e80050dadfb92b/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Jul 2010 11:21:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/why-do-we-need-persistent-classes/m-p/7045175#M1501307</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-07-14T11:21:17Z</dc:date>
    </item>
    <item>
      <title>Re: Why do we need Persistent Classes ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/why-do-we-need-persistent-classes/m-p/7045176#M1501308</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;I would like to know what is the advantage of Persistence Classes over Open SQL.&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let's first start with what SAP says about the [persistence service|http://help.sap.com/saphelp_nw70ehp2/helpdata/en/f5/a36828bc6911d4b2e80050dadfb92b/frameset.htm]:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;The Persistence Service lets the ABAP programmer work with relational database data in an object-oriented way.&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;So we're talking here about an [ORM|http://en.wikipedia.org/wiki/Object-relational_mapping] framework. I.e. the &lt;EM&gt;persistent storage&lt;/EM&gt; of data is realized in SAP via a [relational database|http://en.wikipedia.org/wiki/Relational_database], where the data model is not object oriented. Let's say that you have created a class &lt;EM&gt;sales order&lt;/EM&gt; and want to store and retrieve &lt;EM&gt;sales order objects&lt;/EM&gt; (i.e. specific instances of this class). If you have a relational database, you have to model a corresponding schema for representing your &lt;EM&gt;sales order&lt;/EM&gt; class and then "handcode" the translation from database tables into &lt;EM&gt;sales order objects&lt;/EM&gt; and vice versa.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now imagine a world where you have a nice ORM, that does the work for you. E.g. look at web frameworks like [grails|http://www.grails.org/] making heavy use of [convention over configuration|http://en.wikipedia.org/wiki/Convention_over_configuration], which allow you to easily generate database representations from your objects (without tons of coding/effort!). Essentially you can start off with your class definitions, define some attributes and the framework (ORM) will automatically generate the corresponding database tables for you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Contrast that with SAP (see online help on [mapping assistant for persistence classes|http://help.sap.com/saphelp_nw70ehp2/helpdata/en/d9/b84508bc9411d4b2e80050dadfb92b/frameset.htm]):&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;You may have to create new database tables, database views, or structures for the object model in the ABAP Dictionary. &lt;SPAN __default_attr="red" __jive_macro_name="color"&gt;At present the system does not perform this function automatically.&lt;/SPAN&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So in general the ORM is supposed to make the developer's life easier by providing a framework for translating objects into (relational) database tables. However, sometimes the automatic translation/generation along with the default access methods is not optimal and that's where you actually go back to code your own SQL statements for doing the database-to-object conversions and vice versa. So the SAP &lt;EM&gt;persistence classes&lt;/EM&gt; still use OpenSQL under the hood, but in some cases (e.g. mass processing), you might want to tune the used SQL statements yourself...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I apologize for the long excursion, but in the end my view on persistence classes is quite simple: Use them if they make your life more simple and your coding less complex, without causing any bigger performance hit - otherwise stick to handcoded SQL statements... (long live [KISS|http://en.wikipedia.org/wiki/KISS_principle]!) &lt;SPAN __jive_emoticon_name="wink"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers, harald&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Jul 2010 12:56:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/why-do-we-need-persistent-classes/m-p/7045176#M1501308</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-07-14T12:56:00Z</dc:date>
    </item>
    <item>
      <title>Re: Why do we need Persistent Classes ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/why-do-we-need-persistent-classes/m-p/7045177#M1501309</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One more point I want to iterate is: There are no Persistent objects in ABAP objects. From the SAP help:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Persistence Service for Persistent Objects&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Technically speaking, ABAP Objects are always transient, just like the data objects in ABAP programs. There are no persistent objects in ABAP Objects.&lt;/STRONG&gt; However, the Persistence Service within Object Services allows application developers to work with persistent objects. The Persistence Service can be thought of as a software layer between the ABAP program and the data repository (that is, the database), which allows you to save the attributes of objects with a unique identity, and then load them again when you need them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw04/helpdata/en/f5/a3682ebc6911d4b2e80050dadfb92b/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04/helpdata/en/f5/a3682ebc6911d4b2e80050dadfb92b/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, &lt;/P&gt;&lt;P&gt;Naimesh Patel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Jul 2010 14:04:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/why-do-we-need-persistent-classes/m-p/7045177#M1501309</guid>
      <dc:creator>naimesh_patel</dc:creator>
      <dc:date>2010-07-14T14:04:20Z</dc:date>
    </item>
    <item>
      <title>Re: Why do we need Persistent Classes ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/why-do-we-need-persistent-classes/m-p/7045178#M1501310</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; One more point I want to iterate is: There are no Persistent objects in ABAP objects.&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Typo ... In my OP it should read "Persistent Classes" instead of "Persistent Objects".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for pointing it out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Jul 2010 14:16:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/why-do-we-need-persistent-classes/m-p/7045178#M1501310</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2010-07-14T14:16:20Z</dc:date>
    </item>
    <item>
      <title>Re: Why do we need Persistent Classes ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/why-do-we-need-persistent-classes/m-p/7045179#M1501311</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Harald,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As usual you simply awe me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I liked your example of "class sales order and want to store and retrieve sales order objects (i.e. specific instances of this class)", gave a very clear picture about the persistent class instances &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I second your views on SQL v/s Persistent Classes ... And who doesn't like the K.I.S.S principle &lt;SPAN __jive_emoticon_name="wink"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wish i could give you 20 p*ints &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Jul 2010 14:26:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/why-do-we-need-persistent-classes/m-p/7045179#M1501311</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2010-07-14T14:26:44Z</dc:date>
    </item>
    <item>
      <title>Re: Why do we need Persistent Classes ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/why-do-we-need-persistent-classes/m-p/7045180#M1501312</link>
      <description>&lt;P&gt;I believe persistence classes do the same function as CDS views/Fiori now, it the predecessor technology in some sense. It allows you to save in database and manipulate custom data models in an object oriented way.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jul 2020 12:55:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/why-do-we-need-persistent-classes/m-p/7045180#M1501312</guid>
      <dc:creator>Astashonok</dc:creator>
      <dc:date>2020-07-02T12:55:51Z</dc:date>
    </item>
  </channel>
</rss>

