2013 Aug 26 9:39 AM
Hi guys,
I would like to do an overwrite method on a standard class but i want it to be executed only with very specifics conditions (for example for a specific process type) .
So i was thinking on checking the conditions in a pre-method exit and depending on this, i would like to decide wether the overwrite must be executed or instead the standard method.
Unfortunatelly i can't figure it out...
Anyone has done something similar ?
How did you achieve this ?
Thanks for your feedback.
Cheers,
Helder
Hi guys,
I would like to do an overwrite method on a standard class but i want it to be executed only with very specifics conditions (for example for a specific process type) .
So i was thinking on checking the conditions in a pre-method exit and depending on this, i would like to decide wether the overwrite must be executed or instead the standard method.
Unfortunatelly i can't figure it out...
Anyone has done something similar ?
How did you achieve this ?
Thanks for your feedback.
Cheers,
Helder
2013 Oct 23 9:21 AM
Hi Helder,
The only option I see here is create a inherence of the standard class and in this inherence redefine the method which will be dependant of the process type, inside the method do a case for each process type and if you want to call the standard just invoke the super.
Well, that will be in the perfect world, things to considere:
-Do you have access to the code which instanciate the standard class? if not, to follow this, you will need to change it and replace it by you Z class.
- Is the standard class marked as final? if yes, as you already know, you will need to modify it in order to unmark the final checkbox.
- The method which you want to overwrite is public or protected? because if is private this won't work.
- Inside the overwrited method do you have access to which process type are you working?
Maybe the best way is create an explicit enhancement point on the method which do you want to overwrite do logic at the begining (copying the standard logic as well) and avoid the outside of the enhancement spot with a return.
Those two options can be a frist aproach but probably I'm missing something, I don't know the specific technical details in your requeriments (classes, methods involved) so will be good if you come back to me with more detail so I can try to help you more
Cheers!
Luis
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |