<?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: Difference between a CLASS and OBJECT? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-a-class-and-object/m-p/5685274#M1292115</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Class is a prototype that defines data and the behaviour common to all the objects of certain kind. Here methods provide the behaviour. We can say classes describe objects.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Classes can be declared either globally or locally. Global classes can be declared using transaction SE24. Local classes are declared in an ABAP program (reports etc).  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Object:&lt;/P&gt;&lt;P&gt;It signifies the real world. Technically we can say objects are instances of a class. We can create any number of objects from a class template. All the objects created have unique identity and each contain different set of attributes. Objects we create in a program exist only till the program exists. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Shiva&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 31 May 2009 05:46:07 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-05-31T05:46:07Z</dc:date>
    <item>
      <title>Difference between a CLASS and OBJECT?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-a-class-and-object/m-p/5685272#M1292113</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can I hv a brief answer for the question of Difference between a CLASS and OBJECT?&lt;/P&gt;&lt;P&gt;I tried to interprete my self, but, I culd not able to find out the answer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanq&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 31 May 2009 05:04:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-a-class-and-object/m-p/5685272#M1292113</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-31T05:04:00Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between a CLASS and OBJECT?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-a-class-and-object/m-p/5685273#M1292114</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A class is an object oriented concept that has methods in it, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Methods can be of Public-accessible outside, Private-Onlywith in the class and Protected&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A class can have inheritance and all the Object oriented properties in it...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;An object is an instance of the class, To access a class within the program/FM, you need to instantiate the class, Hence an Object is used to instantiate the class...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Shiva&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 31 May 2009 05:39:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-a-class-and-object/m-p/5685273#M1292114</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-31T05:39:37Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between a CLASS and OBJECT?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-a-class-and-object/m-p/5685274#M1292115</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Class is a prototype that defines data and the behaviour common to all the objects of certain kind. Here methods provide the behaviour. We can say classes describe objects.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Classes can be declared either globally or locally. Global classes can be declared using transaction SE24. Local classes are declared in an ABAP program (reports etc).  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Object:&lt;/P&gt;&lt;P&gt;It signifies the real world. Technically we can say objects are instances of a class. We can create any number of objects from a class template. All the objects created have unique identity and each contain different set of attributes. Objects we create in a program exist only till the program exists. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Shiva&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 31 May 2009 05:46:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-a-class-and-object/m-p/5685274#M1292115</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-31T05:46:07Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between a CLASS and OBJECT?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-a-class-and-object/m-p/5685275#M1292116</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you understand difference between a &lt;STRONG&gt;car&lt;/STRONG&gt; and a &lt;STRONG&gt;construction project&lt;/STRONG&gt; of this car in real world, than you understand the difference between an &lt;STRONG&gt;object&lt;/STRONG&gt; and a &lt;STRONG&gt;class&lt;/STRONG&gt; in programming model. &lt;/P&gt;&lt;P&gt;Class is simply a &lt;EM&gt;type&lt;/EM&gt; like your basic types ( &lt;EM&gt;i, f, p, d, t, n, c&lt;/EM&gt; ) which you use for typings, when you declare a &lt;EM&gt;reference variable&lt;/EM&gt; (for basic type you use &lt;EM&gt;data object&lt;/EM&gt; ). So there is no functional difference in below two statements:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data: my_data_obj type i.   

"and

data: my_ref type ref to lcl_my_class.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;You can have one or more data objects of type &lt;EM&gt;i&lt;/EM&gt; in your program and one or more objects (so called &lt;STRONG&gt;instances&lt;/STRONG&gt; ) of type &lt;EM&gt;lcl_my_class&lt;/EM&gt; . It is understandable that each data object of type &lt;EM&gt;i&lt;/EM&gt; has some common features (like range of type &lt;EM&gt;i&lt;/EM&gt; ) and has some differences, like different value which it really stores.&lt;/P&gt;&lt;P&gt;The same applies to &lt;EM&gt;lcl_my_class&lt;/EM&gt; . There are some static attributes, which are common to all objects (accessed by &lt;EM&gt;my_ref&lt;/EM&gt; ) and some typical for each of them.&lt;/P&gt;&lt;P&gt;I.e. you have many cars (objects) created from one &lt;EM&gt;construction projects&lt;/EM&gt; (class). Every car has same part (like steering wheel, 4 wheels, a trasmision gear etc) - so these are common to every car, but you still have some differences like color of the car, like windows tint, engine capacity etc. &lt;/P&gt;&lt;P&gt;The way car behaves (accelerates, stops, make turn) is similar to all these cars. This behaviour is called &lt;EM&gt;method&lt;/EM&gt; .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Classes are not tied to particular programming language, they are simply a cast from real world to something more readable to computers, so called &lt;EM&gt;abstraction&lt;/EM&gt; . You can google this topic, there are lots of sites describing the difference in detail. Example [link|http://www.felgall.com/obj1.htm]. Of course what was written here, is just a basics of real powerful object world. I recommend to study some book covering this topic like [ABAP Objects: Introduction to Programming SAP Applications|http://www.amazon.co.uk/ABAP-Objects-Introduction-Programming-Applications/dp/0201750805]&lt;/P&gt;&lt;P&gt;or simply read some [SAP documentation|http://help.sap.com/saphelp_nw70/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm] as far as you want to consider object related programming in ABAP terms.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Marcin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 31 May 2009 08:17:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-a-class-and-object/m-p/5685275#M1292116</guid>
      <dc:creator>MarcinPciak</dc:creator>
      <dc:date>2009-05-31T08:17:30Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between a CLASS and OBJECT?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-a-class-and-object/m-p/5685276#M1292117</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   &lt;STRONG&gt;OBJECT&lt;/STRONG&gt;  is an entity which can be percevied, having a particular form and it's having certain attributes.&lt;/P&gt;&lt;P&gt;      example : CAR, Computer and Watch....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   Objects are Resuable , sharable, Maintainable and modifiable.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Classes&lt;/STRONG&gt; are templates that describe how the object will look like. You can think of the class-object relation as one similar to internal table-type(structure) statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS my_first_class DEFINITION.&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;    DATA: one_variable TYPE i.&lt;/P&gt;&lt;P&gt;    METHODS i_square.&lt;/P&gt;&lt;P&gt;ENDCLASS.                    "my_first_class DEFINITION&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      CLASS my_first_class IMPLEMENTATION&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS my_first_class IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  METHOD i_square.&lt;/P&gt;&lt;P&gt;    one_variable = one_variable * one_variable.&lt;/P&gt;&lt;P&gt;    WRITE one_variable.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.                    "i_square&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDCLASS.                    "my_first_class IMPLEMENTATION&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reg,&lt;/P&gt;&lt;P&gt;Siva Prasad&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Jun 2009 06:55:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-a-class-and-object/m-p/5685276#M1292117</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-01T06:55:57Z</dc:date>
    </item>
  </channel>
</rss>

