Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 3353

Create one or more instance of a class

$
0
0

Hey experts,

I have a question about good abap oo coding.

I have a class (e.g. cl_adjust) which will adjust some attributes of promotions.

 

In my Programm I have do to many things, but at a certain point, due to some Information, I have to adjust a promotion.

Now I will call the class cl_adjust to do that.

 

My Question now is, should I create a new Instance for every promotion (everytime I come to the point, where I have to adjust a promotion) or should I create one Instance of the class and call a method (e.g. cl_adjust->execute( IMPORTING io_promotion = lo_promotion )?

 

I guess, the programm ist faster, if I just create one instance?

 

Thanks in advance and BR,

Sebastian


Viewing all articles
Browse latest Browse all 3353

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>