<?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: Narrow Casting Vs Widening Casting in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/narrow-casting-vs-widening-casting/m-p/891792#M53507</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kalyan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In fact, the names imply everything. Let me illustrate a bit. This illustration will deal with one aspect which I think will be enough at least to understand the concept simply. Think of two instances (objects) of two classes one of which is inherited from the other, that is; one is a general class and the other is a specialized class of it. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;u&amp;gt;e.g.&amp;lt;/u&amp;gt; &lt;/P&gt;&lt;P&gt;Class 1 --&amp;gt; land_vehicle&lt;/P&gt;&lt;P&gt;Class 2 --&amp;gt; truck&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The class &amp;lt;b&amp;gt;land_vehicle&amp;lt;/b&amp;gt; has following attributes:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  max_speed
  number_of_wheels
  number_plate
  ...&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The class &amp;lt;b&amp;gt;truck&amp;lt;/b&amp;gt; has following attributes:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  max_speed [inherited]
  number_of_wheels [inherited]
  number_plate [inherited]
  &amp;lt;i&amp;gt;load_capacity&amp;lt;/i&amp;gt; [special to truck class]&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, assume you have instantiated these classes as&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;"land_vehicle_obj"&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;"truck_obj"&amp;lt;/b&amp;gt; respectively from these classes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Between these two objects, you can assign one to the other and at this point casting occurs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i. If you assign &amp;lt;i&amp;gt;truck_obj&amp;lt;/i&amp;gt; to &amp;lt;i&amp;gt;land_vehicle_obj&amp;lt;/i&amp;gt; you lose the special attribute &amp;lt;i&amp;gt;load_capacity&amp;lt;/i&amp;gt; since you go from the specialized on to the general one. Thus, this is a &amp;lt;b&amp;gt;narrowing cast&amp;lt;/b&amp;gt;.&lt;/P&gt;&lt;P&gt;i. If you assign &amp;lt;i&amp;gt;land_vehicle_obj&amp;lt;/i&amp;gt; and &amp;lt;i&amp;gt;truck_obj&amp;lt;/i&amp;gt; you do not lose any attribute, nevertheless you add a new one. Thus this is a &amp;lt;b&amp;gt;widening cast&amp;lt;/b&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--Serdar &amp;lt;a href="https://www.sdn.sap.com:443http://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.sdn.businesscard.sdnbusinesscard?u=qbk%2bsag%2bjiw%3d"&amp;gt;[ BC ]&amp;lt;/a&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 18 Mar 2005 11:10:01 GMT</pubDate>
    <dc:creator>ssimsekler</dc:creator>
    <dc:date>2005-03-18T11:10:01Z</dc:date>
    <item>
      <title>Narrow Casting Vs Widening Casting</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/narrow-casting-vs-widening-casting/m-p/891790#M53505</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anybody please explain me the difference with an example between &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;Narrow Casting&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt; and &amp;lt;i&amp;gt;&amp;lt;b&amp;gt;Widening&amp;lt;/b&amp;gt;&amp;lt;/i&amp;gt; &amp;lt;i&amp;gt;&amp;lt;b&amp;gt;Casting&amp;lt;/b&amp;gt;&amp;lt;/i&amp;gt; in ABAP Objects.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kalyan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Mar 2005 09:36:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/narrow-casting-vs-widening-casting/m-p/891790#M53505</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-03-18T09:36:02Z</dc:date>
    </item>
    <item>
      <title>Re: Narrow Casting Vs Widening Casting</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/narrow-casting-vs-widening-casting/m-p/891791#M53506</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Aswani,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a look at this url&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_47x200/helpdata/en/c3/021959f06111d4b2eb0050dadfb92b/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_47x200/helpdata/en/c3/021959f06111d4b2eb0050dadfb92b/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Lakshman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Mar 2005 10:28:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/narrow-casting-vs-widening-casting/m-p/891791#M53506</guid>
      <dc:creator>Lakshmant1</dc:creator>
      <dc:date>2005-03-18T10:28:50Z</dc:date>
    </item>
    <item>
      <title>Re: Narrow Casting Vs Widening Casting</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/narrow-casting-vs-widening-casting/m-p/891792#M53507</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kalyan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In fact, the names imply everything. Let me illustrate a bit. This illustration will deal with one aspect which I think will be enough at least to understand the concept simply. Think of two instances (objects) of two classes one of which is inherited from the other, that is; one is a general class and the other is a specialized class of it. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;u&amp;gt;e.g.&amp;lt;/u&amp;gt; &lt;/P&gt;&lt;P&gt;Class 1 --&amp;gt; land_vehicle&lt;/P&gt;&lt;P&gt;Class 2 --&amp;gt; truck&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The class &amp;lt;b&amp;gt;land_vehicle&amp;lt;/b&amp;gt; has following attributes:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  max_speed
  number_of_wheels
  number_plate
  ...&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The class &amp;lt;b&amp;gt;truck&amp;lt;/b&amp;gt; has following attributes:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  max_speed [inherited]
  number_of_wheels [inherited]
  number_plate [inherited]
  &amp;lt;i&amp;gt;load_capacity&amp;lt;/i&amp;gt; [special to truck class]&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, assume you have instantiated these classes as&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;"land_vehicle_obj"&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;"truck_obj"&amp;lt;/b&amp;gt; respectively from these classes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Between these two objects, you can assign one to the other and at this point casting occurs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i. If you assign &amp;lt;i&amp;gt;truck_obj&amp;lt;/i&amp;gt; to &amp;lt;i&amp;gt;land_vehicle_obj&amp;lt;/i&amp;gt; you lose the special attribute &amp;lt;i&amp;gt;load_capacity&amp;lt;/i&amp;gt; since you go from the specialized on to the general one. Thus, this is a &amp;lt;b&amp;gt;narrowing cast&amp;lt;/b&amp;gt;.&lt;/P&gt;&lt;P&gt;i. If you assign &amp;lt;i&amp;gt;land_vehicle_obj&amp;lt;/i&amp;gt; and &amp;lt;i&amp;gt;truck_obj&amp;lt;/i&amp;gt; you do not lose any attribute, nevertheless you add a new one. Thus this is a &amp;lt;b&amp;gt;widening cast&amp;lt;/b&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--Serdar &amp;lt;a href="https://www.sdn.sap.com:443http://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.sdn.businesscard.sdnbusinesscard?u=qbk%2bsag%2bjiw%3d"&amp;gt;[ BC ]&amp;lt;/a&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Mar 2005 11:10:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/narrow-casting-vs-widening-casting/m-p/891792#M53507</guid>
      <dc:creator>ssimsekler</dc:creator>
      <dc:date>2005-03-18T11:10:01Z</dc:date>
    </item>
  </channel>
</rss>

