cancel
Showing results for 
Search instead for 
Did you mean: 

Less dumb follow-up question about super/sub classes in WDJ?

Former Member
0 Kudos

This is a follow-up question to the question which Maksim answered in this thread:

Question:

Is there any kind of weird C++-like statement that you can put at the top of a WDJ module to force the module to interpret any reference to superclass A as a reference to some specific subclass B of A ???

Accepted Solutions (1)

Accepted Solutions (1)

former_member182372
Active Contributor
0 Kudos

Hi David,

It`s me again :-). The only way which comes to my mind for your scenario is creating custom class loader. And LOE is defenetly not like "weird C++-like statement".

Best regards, Maksim Rashchynski.

former_member181923
Active Participant
0 Kudos

Maksim -

Thanks very much for that bit of information - I will put it to good use in a blog I'm about to post concerning SAP workflow delegation, SAP BAdI implementation, and handling of super/sub classes in WDJ.

Thanks again

djh

former_member181923
Active Participant
0 Kudos

PS - what's "LOE" ????

former_member182372
Active Contributor
0 Kudos

loe - level of efforts

former_member181923
Active Participant
0 Kudos

I thought that's what you meant by LOE but wasn't sure.

So what you're saying is that it's easier to create a WDJ custom class loader than it is to code a C++ directive-type statement ???

djh

Former Member
0 Kudos

David,

1. Java has no preprocessor, so C++ tricks are not available. Also I would not recommend such tricks even in C++ if you don't want to turn your colleagues working with same code into personal enemies.

2. The phrase "easier to create a WDJ custom class loader " makes me smile. First, it's not that simple to interfere WDJ class loading scheme. Plus custom class loaders is not trivial Java topic per se.

3. The problem "replace all A-s with B-s" is typically solved using one or another GoF creation patterns, like <a href="http://en.wikipedia.org/wiki/Abstract_factory_pattern">Abstract Factory</a> or <a href="http://en.wikipedia.org/wiki/Factory_method_pattern">Factory Method</a>. You may use them with custom class loader, if you really want to

By the way, all UI controls in WD are created using Abstract Factory (role played by view). So you may use this as good example.

Valery Silaev

SaM Solutions

http://www.sam-solutions.net

former_member181923
Active Participant
0 Kudos

Hi Valery -

Thanks for taking the time to write that thoughtful and very informative reply.

That "Factory Method" that you mention - is that more or less related to the "Factory Method" that comes up in the ABAP debugger as you step through the SAP BAdI invocation/selection code ... ?

Also, when I was doing my series of blogs on the WDA component WDY_UI_TEST_ELEMENTS, I noticed that after the developer's custom code set attributes of UI's appropriately, the UI was passed off to a canned "FactoryMethod" for actual creation ... I assume that is the same kind of thing you're talking about here ...

Thanks very much again ...

djh

Answers (0)