Vous êtes sur la page 1sur 3

Design Patterns in Object-Oriented ABAP

Igor Barbaric

Contents

1 Introduction 5 open Method 20


1.1 What are Design Patterns? 5 get_sub_objects Method 21
1.2 Communication in Patterns 6 menu_request Method 21
1.3 Design Patterns in Software Design 6 menu_select Method 21
1.4 Success story: The Project and its 4.5 Class lcl_application 21
By-product 7 Definition 22
Bad Application 7 o_tree Attribute 22
Starting with Design Patterns 7 t_active_objects Attribute 22
1.5 Conventions in this Book 7 constructor Method 23
1.6 Prerequisites 8 run_application Method 23
Basics of Object-Oriented on_double_click Method 25
Software Design 8 on_expand_no_children Method 25
Experience in ABAP Programming 8 on_menu_request Method 25
Reading UML Diagrams 8 on_menu_select Method 26
1.7 Structure of the Book 9 4.6 Summary 26
Download 9
Acknowledgements 9 5 The Facade Pattern 27
5.1 Definition 27
2 The Demo Application 11 5.2 Case-Study Problem: Vendor-Specific
User-Defined Text on Purchase Order 27
3 The Singleton Pattern 15 5.3 Class lcl_mod_facade 30
3.1 Definition 15 Definition 31
3.2 Case-Study Problem: Instantiating constructor Method 31
Application Only Once 15 lif_tree_object~open Method 31
3.3 Summary 17 5.4 Class lcl_st_text_facade 31
Definition 31
4 The Adapter Pattern 19 s_thead Attribute 32
4.1 Definition 19 container Attribute 32
4.2 Case-Study Problem: Application with textedit Attribute 32
a Command Tree 19 constructor f^ethod 32
4.3 The Adapter in the Demo Application 20 on_too!bar_func_sel Method 35
4.4 Interface lifjnterface 20 save Method 35
Definition 20 free Method 36
Types 20 5.5 Summary 36
node Attribute 20

www. sap-presi.com 1

Bibliografische Informationen digitalisiert durch


http://d-nb.info/989356019
Contents

6 The Composite Pattern 37 8 The Model-View-Controller (MVC)


6.1 Definition 37 Pattern 63
6.2 Case-Study Problem: Organizing Flights 8.1 Definition 63
by Date 38 8.2 Case-Study Problem: Displaying
6.3 Class lcl_mod_composite 39 Table Data in Different Ways 64
Definition 39 8.3 Class lcl_con 66
Attributes 39 Definition 66
constructor Method 40 Attributes 66
lif_tree_object~get_sub_objects initialize Method 67
Method 44 8.4 Class lcl_mod 67
6.4 Summary 46 Definition 67
Interfaces 68
7 The Decorator Pattern 47 decjnal Attribute 68
7.1 Definition 47 dt_outtab Attribute 68
Confusion About What's Preceding tabname Attribute 68
and What's Succeeding 48 disp_struc_name Attribute 68
7.2 Case-Study Problem: Lookup Data t_main_where Attribute 68
for Internal Tables 48 t j c a t Attribute 68
Reusability 49 caption Attribute 68
7.3 Class lcl_itab_dec 50 constructor Method 69
Definition 50 init_controller Method 70
prec_decorator Attribute 50 lif_tree_object~open Method 71
dt_ref Attribute 51 lif_tree_object~menu_request Method .... 71
tt_fname_mappings Attribute 51 lif_tree_object~menu_select Method 71
constructor Method 52 refresh Method 71
refresh_data Method 52 save Method 72
get_fields Method 53 lif_tree_object~get_sub_objects
7.4 Class lcUtab_dec_vendor 53 Method 72
Definition 53 8.5 Class lcl_con_alv 72
t_lfa1 Attribute 54 Definition 72
constructor Method 54 alv Attribute 73
refresh_data Method 54 container Attribute 73
get_fields Method 57 initialize Method 73
7.5 Class lcl_itab_dec_st_text 59 on_toolbar Method 74
Definition 59 on_user_command Method 74
Attributes 60 free Method 75
constructor Method 60 8.6 Class lcl_con_alv_facade 75
get_fields Method 60 Definition 75
7.6 Other Decorators in the Application 61 on_toolbar Method 75
7.7 Implementation of the Decorator Pattern on_user_command Method 75
in the Application 61 8.7 Class lcl_con_dd 76
7.8 Summary 62 Definition 76
dd Attribute 77
container Attribute 77

©Galileo Press 2006. All rights reserved.


Contents

initialize Method 77
on_clicked Method 77
refresh_display Method 77
free Method 80
8.8 Summary 80

9 Summary 83

Index 85

www.sap-press.com 3

Vous aimerez peut-être aussi