Enhancement Framework For Classes

http://download.csdn.net/detail/fengyan5022/9382736

Introduction:
 This Enhancement framework provides flexibility to scale up the existing classes to achieve the expected business functionality. It gives us the advantage of enhancing the global parameters and interface of a class.
Enhancement Features:
1. Adding new methods
2. Adding new parameters
3. Enhancing the existing business functionality
Enhancing Existing Functionality:
1. Pre-exit method
2. Post-exit method
3. Overwrite-exit method
Pre-exit method:
 Pre-exit methods are enhancement points invoked at runtime. This method is executed or triggered before the original method. In general, it is majorly used for validation check before the execution of the logic in the original method. In some cases we may also use this method to get the data to be passed on to the original method.
Post-exit method:
 Post-exit methods are enhancement points invoked at runtime. This method is executed or triggered after the original method. This method can be used to implement the custom logic based on the parameters passed from the original method.
Overwrite-exit method:
 Overwrite-exit methods are enhancement methods identified for replacement at runtime for the original method. In short an overwrite exit method is an enhancement section and the pre-post exit methods are enhancement points.
Step wise approach to implement enhancement:
 In our scenario, let us consider enhancing a copy of standard class “CL_BSP_FLIGHT_DEMO”.

 

1. Create a copy of the class “CL_BSP_FLIGHT_DEMO”- “ZCL_BSP_FLIGHT_DEMO1”.

First we shall understand the usage of pre-exit method.
2. Let us create a simple report program ZTEST_EXIT, which would call the method “CAPITALIZE_STRING”.


 


 

發佈了176 篇原創文章 · 獲贊 13 · 訪問量 22萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章