‎2008 May 12 3:45 AM
hi all,
i just have some doubt about creation of CLASS.
why must we use a OBJECT REFERENCE to create a instance, is there any other method on creating instance ?
it's better tht some people tell me the mechanism of this process.
regards
‎2008 May 12 9:20 AM
To instantiate a class, you use CREATE OBJECT objref, where objref is of type REFERENCE TO class. This creates an instance of the class, and assigns the reference to objref. All access to the instance is through this object reference. It is impossible to deal with instances of classes without an object reference somewhere.
matt
‎2008 May 12 12:14 PM
Hi,
CREATE OBJECT refobject will actually instatiate the class.
in lay-man point of view its like creating a copy of the class by which we can access all the properties( here attributes or methods) if any of the class .
we cannot directly access the class . we need to have a ref object to access the class.
thanks
pratyush
‎2008 May 12 4:36 PM
Hi Chao,
Instance is the one of the main mechanism of the Objects Oriented. You must use a reference variable to create the Instance.
Certainly the use of ABAP OO brings many advantages over procedural ABAP.
"ABAP Objects is indicated for who wants to guarantee agility during the development, minimize the efforts during the modifications, enhance existing applications and create complex applications using a simple way..."
You can see samples of ABAP Objects use on [ABAP Objects Examples|https://wiki.sdn.sap.com/wiki/x/Aq].
Also there many information on [Object-oriented programming|http://en.wikipedia.org/wiki/Object-oriented]
Don't forget to close this thread and all yours previous when your question be answered ! In case of doubt read the [rules of engagement|].
Regards.
Marcelo Ramos