Info

You are currently browsing the 2&5… & Coo4U… weblog archives for the day April 2, 2008.

April 2008
M T W T F S S
« Mar   May »
 123456
78910111213
14151617181920
21222324252627
282930  

Archive for April 2, 2008

达人开课之ABAP tips2:MVC

MVC means ‘Model Control View’. It is a very traditional way to structure the program. Usually it is used in OO (object-oriented) programming. Well, we can also apply this good thinking of programming in the ABAP4 which is process-oriented as well.

The normal structure of ABAP4 program is like this:

1 Definition

2 Input screen definition

3 Input screen event

4 Start-of-selection

5 End-of-selection

Then how can we apply MVC thinking? It is going to be like this:

Aarrange all the input procedure in the 2 & 3 part. For example, authorization check.

Arrange all the business logic control in the 4 part. Arrange all the data access in the subroutines which will be used in the business logic control.

At last, move all the output procedure in the 5 part.

It will be much easier for the descendant to understand the program in the future using this MVC thinking.

|