result = do_something_on( input ).
types: begin of more_results,
first_result type string,
second_result type string,
end of more_results.
(...)
methods do_something ... returning result type more_results.
(...)
result = do_something( ... )
class cl_application implementation.
method main.
id = get_id_from_somewhere( ).
data_model = new cl_read( )->read( id ).
new cl_front_end( )->show( data_model = data_model
controller = me ).
endmethod.
method get_id_from_somewhere.
" get the id from user input or from elsewhere
endmethod.
endclass.
types: begin of header_data,
id type string,
text type string,
date type d,
org_level type string,
end of header_data.
types:
begin of item,
id type string,
item_id type string,
text type string,
quantity type f,
end of item,
items type standard table of item
with empty key.
types: begin of data_model,
header_data type header_data,
items type items,
end of data_model.
class cl_front_end implementation.
method show.
me->data_model = data_model.
me->controller = controller.
start_view( ).
endmethod.
method start_view.
" present the data on screen
endmethod.
endclass.
method main.
id = get_id_from_somewhere( ).
data_model = new cl_read( )->read( id ).
new cl_front_end( )->show( data_model = ref #( data_model )
controller = me ).
endmethod.
class cl_front_end definition.
public section.
methods show
importing data_model type ref to data_model
controller type ref to cl_application.
private section.
data data_model type ref to data_model.
data controller type ref to cl_application.
methods start_view.
endclass.
class cl_front_end implementation.
method show.
me->data_model = data_model.
me->controller = controller.
start_view( ).
endmethod.
method start_view.
cl_demo_output=>display( data_model->*-header_data ).
endmethod.
endclass.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
4 | |
3 | |
3 | |
2 | |
2 | |
2 | |
1 | |
1 | |
1 | |
1 |