Dynamic Code Programming

from Wikipedia, the free encyclopedia

Dynamic Code Programming (DCP) is a dynamization of object-oriented programming (OOP) or service-oriented architecture (SOA) , both types of software design can be integrated in DCP.

With the DCP, existing code is always loaded modularly from a controller. Depending on the call or parameterization, this controller decides which modules are to be loaded and possibly to be instantiated, and in case of doubt also determines the associated parameters for instantiating or calling the method or software. With DCP there is no static structure that defines how the program flow should look like; Instead, a dynamic decision is made here on the basis of a configuration and the feedback from the individual process steps which step will be carried out next. Each step is a further branch that was firmly anchored in the previous standards (OOP / SOP). With the DCP, however, the process is recorded in a configuration file or a database, for example.

Examples

Web application

There is a page A, which is stored as a file on the server. In the database there is the instruction for the controller to load and deliver this page when calling /index.html. If a user now sends a request to /index.html, the controller delivers the page.

If you change the database entry and use a user check in the first process step and a login page as a failover for the user check, a user who is not logged in would first see the defined login page and would have to log in. If the login fails or the user is not authorized to see the page, a corresponding error message is displayed and the user remains on the login page. If successful, the user sees the requested page.

In order to make pages accessible only to certain users, depending on the database design and code structure, you only need to make one database entry and do not have to change anything in the actual program code.

Form generation

When using DCP for form generation, there is an underlying data record structure and possibly additional parameters that influence how the form looks later. In addition to the data record structure, there are direct or language-dependent translations that are used to define the names for the input fields and any additional texts. In addition, a type assignment of the data type to the form field type is used to decide which type of form field is used here.

In the case of the definition of the data record structure in the database, one would simply use the target data table as a basis. In this way you can adjust the table at any time and the form would then change automatically and request the new data with it.