abapGit / abapGit-Plugins

DEPRECATED - abapGit Plugins Framework

Repository from Github https://github.comabapGit/abapGit-PluginsRepository from Github https://github.comabapGit/abapGit-Plugins

Passing the object-type to the plugin

mrsimpson opened this issue · comments

Currently, the object-type which is supported by the plugin is derived from the classname.
For some objecttypes might contain also contain forward slashes (namespaced).
Also, it might be possible to have one plugin support multiple objecttytpes (e. g. a generic sobj-based plugin).

Proposal similar like in saplink:

  SELECT * FROM vseoextend INTO TABLE classlist
    WHERE refclsname like 'ZABAPGIT_OBJECT_%'
    AND version = '1'.

  LOOP AT classlist INTO classline.
    clsname = classline-clsname.
    TRY.
        CREATE OBJECT classobject
          TYPE
            (clsname)
          EXPORTING
            name      = 'foo'.
        objtype = classobject->get_supported_objecttypes( ).

yep, seems like a good idea, assuming this is extended to the built-in object types

could get rid of the following evil hack
https://github.com/larshp/abapGit/blob/master/zabapgit.prog.abap#L11178

and the not so evil hack
https://github.com/larshp/abapGit/blob/master/zabapgit.prog.abap#L11134
could be done in a nicer way

though need to consider the constructor input, it seems off to instantiate a class with a dummy abap object to get the supported types :o/

perhaps get_supported_objecttypes should be static? but then it would not be part of the interface. Could be defined in the abstract superclass with an "ASSERT 0 = 1" and then redefined in the subclass.

Or just keep as is and then have very simple classes that shares a superclass with the logic

As the instantiation is anyway managed, I'd think of having a
constructor which is free of any parameters and a protected abstract
method to define the scope of the instance.

------ Originalnachricht ------
Von: "Lars Hvam" notifications@github.com
An: "larshp/abapGit-Plugins" abapGit-Plugins@noreply.github.com
Cc: "Oliver Jägle" github@beimir.net
Gesendet: 16.02.2016 19:29:27
Betreff: Re: [abapGit-Plugins] Passing the object-type to the plugin
(#3)

though need to consider the constructor input, it seems off to
instantiate a class with a dummy abap object to get the supported types
:o/


Reply to this email directly or view it on GitHub.

yea, it would work

guess this can be closed, implemented in abapGit/abapGit#177