Singleton

O_SINGLETON  Static Attribute Private  Type Ref To Z_CL_MYCLASSNAME
 
method factory. " static public
    if o_singleton is initial.
      o_singleton = new #( ).
    endif.
    ro_ret = o_singleton.
 
endmethod.
 
RO_RET  Returning Parameter  Type Ref To  Z_CL_MYCLASSNAME
 
*  lv_myvariabe = z_cl_myclassname=>factory( )->some_method(

wiki.scn.sap.com/Singleton

Schreibe einen Kommentar



All fields are required. Your email address will not be published.