class, inheritance and events...

Development (ABAP Development WorkBench, ABAP/4 programming)

Moderators: Snowy, thx4allthefish, YuriT, Gothmog

Post Reply
SAP_NEWKID

class, inheritance and events...

Post by SAP_NEWKID » Tue Jan 11, 2005 6:51 pm

Hi,

What is class? What is inheritance and events?

From BAPI's I know that a Business Object will have a Method, Event and Interface. But how these are different from ABAP Objects?

What is the application aspect of Class, Methods and Events? While I know how business object works and how methods and events work.

But I am failing to understand the application aspect of it. I have gone through SAP IDES System to see some demos but the examples there are very rudimentary as they are dealing with come counters etc but not with business data as such.

Can any of you give a business reason and requirement that dictates that programmers use classes.

Thanks in advance

SAP_NEWKID

VLozano
Posts: 5142
Joined: Mon Sep 13, 2004 8:17 am
Location: Idiocity
Contact:

Post by VLozano » Wed Jan 12, 2005 4:23 am

Reuse-ability. :shock:

All your questions are not Business Objects related. Are Object Oriented Programming questions. The use of these things make the life better, the code more clear and reusable.

But, as any OO Program, if the design of the classes is wrong, the program will be a pain in the .$$ to modify / upgrade.

Why to use classes? You don't need to use them if you are not comfortable with them. But I will recommend you to learn more about OO Programming, and use classes anytime. With time, you will save lot of work using objects.
Tuly Idiots
Because we know we are part of the problem

abap_doctor
Posts: 6955
Joined: Thu Mar 25, 2004 11:29 am
Location: Airstrip One

Post by abap_doctor » Wed Jan 12, 2005 5:04 am

I hate to agree with anything VLozano says :wink: , but this time I tend to agree.

You don't need to use OO in ABAP, and I haven't in 13 years of it... But I understand that these things exist and I may have to support some in the future. (I haven't had to as yet!)

It's similar to my avoiding ALV for a time, as it was new and looked a bit complex, but now it's my first choice! Which, come to think about it, does actually contain some OO programming!!! :oops:

8)
The Doc
Tuly Idiot Magna Grand Docot Image

VLozano
Posts: 5142
Joined: Mon Sep 13, 2004 8:17 am
Location: Idiocity
Contact:

Post by VLozano » Wed Jan 12, 2005 6:33 am

abap_doctor wrote:I hate to agree with anything VLozano says :wink: , but this time I tend to agree.
Ouch... then I must be wrong...

In any case, OO could be the future of ABAP, and if you don't use your free worktime (never in home :P) for learn it, you will regret it.

And doc, did you checked cl_gui_alv_grid? The normal ALV is nothing compared with ;)
Tuly Idiots
Because we know we are part of the problem

abap_doctor
Posts: 6955
Joined: Thu Mar 25, 2004 11:29 am
Location: Airstrip One

Post by abap_doctor » Wed Jan 12, 2005 7:24 am

VLozano wrote:In any case, OO could be the future of ABAP, and if you don't use your free worktime (never in home ) for learn it, you will regret it.

They said that about Java :shock: But I'm an old dog, new tricks are for the young whippets :wink:

And doc, did you checked cl_gui_alv_grid? The normal ALV is nothing compared with ;)

That's what I use... I don't use the "other" ALV method (that's for newbies, freshers and wimps!) 8)
The Doc
Tuly Idiot Magna Grand Docot Image

Incho
Posts: 1537
Joined: Mon Oct 21, 2002 3:32 am
Location: Belgium
Contact:

Re: class, inheritance and events...

Post by Incho » Wed Jan 12, 2005 9:10 am

SAP_NEWKID wrote:Can any of you give a business reason and requirement that dictates that programmers use classes.
Object Oriented programming is a proved approach, has a lot of advantages in general and also specifically for ABAP Object.

From the other hand there are some situation, where you can still use the old way, but all the new tool based on ABAP Objects. There you have no choice, because they are implemented via ABAP Objects.
Eg.: BSP MVC controller class, Shared Objects, Exception handling with classes, Persistent classes, WebDynpro for ABAP etc.

Peter

VLozano
Posts: 5142
Joined: Mon Sep 13, 2004 8:17 am
Location: Idiocity
Contact:

Post by VLozano » Wed Jan 12, 2005 10:11 am

Use a search engine to find

"Eight Reasons Why Every ABAP Developer Should Give ABAP Objects a Second Look.pdf"

You will find it interesting.
Tuly Idiots
Because we know we are part of the problem

Post Reply