DaDaBIK logo

Use cases: PHP code generator

Use DaDaBIK as a PHP code generator

What is a code generator?

It's basically a program that builds other programs, generating code according to specific parameters defined by the user.

Let’s say you have a database table of customer information, and you need a web application which allows your employees to access and/or modify a customer’s information using an online, web-based interface. The app also needs to include an easy, one-click way for you to export the new customer information to a PDF, following a specific template you design.

It’s certainly possible to create such an application from scratch, writing code to power each aspect of the system using PHP, Python, or another programming language. But it’s time consuming. The alternative to custom coding is to use a code generator that, since it has been designed to cover that specific use case (web forms, PDF generation), can generate the code for you according to some settings you specify. So a PHP code generator is a program that generates PHP code. Another popular term used to refer to same concept is PHP code maker.

Can you always use a code generator? It depends on the application you have to build but for typical data-based Web applications having forms as input interface and tabular grids / charts as output there is a very good chance you can automatically generate most of the code.

Is DaDaBIK a code generator?

Yes and no. You can use it for the same purpose of a PHP code generator:

  • create a program even if you are not a programmer
  • create a program faster (saving time and money) if you are a programmer

but the process is a bit different.

With a classic PHP code generator, you set some parameters and then click a button to build the final application. The output is code (such as a set of .php files) which forms the base of your application. You can run the code as is or, if you have the programming skills, you can modify the code manually. This same process is also how a PHP form generator works.

DaDaBIK, by contrast, is a “model-based low-code platform.” After installing DaDaBIK, your Web application is ready—it's empty, but the skeleton of the application is already present. From there, you can add tables, forms, and reports and this updates the web application in real time—there is no code generation process.

Every DaDaBIK app uses the same core code, but your app is highly customizable, mostly via a simple "point and click" interface. The end result is web applications built on the same base code, but which are unique and fit a wide variety of use cases.

Which is Better, a Classic Code Generator or a Model-Based Low-Code Platform?

You might think that generating the final code is better because you can edit it directly and therefore have total control. It is true that you have total control, but think twice: Is editing generated code a good idea?

What will you do when a new version of your code generator is released and you have to update the code you generated? Sometimes you don’t even have the option to remain on a legacy version, especially if there’s a security concern with the older code.

In this case, you’ll probably need to re-generate the code, and then waste time re-applying the custom modifications you made. The code for the new version is often different from the code in the old version, which means you need to spend time learning how the new code works.

Similar problems arise when a change in your data structure (e.g. new table fields) requires you to re-generate the code, forcing you to implement all your code modifications.

DaDaBIK’s model-based low-code platform eliminates many of these headaches.

With DaDaBIK, you still have complete control. You can always add your own custom code.

For example, you can add a custom button to a form that executes a specific Javascript code. The difference is that your custom code resides in separate files—so updating to a new version of DaDaBIK is seamless.

Want to know what users say about DaDaBIK? Check the reviews

Questions about using DaDaBIK as a code generator or about DaDaBIK in general? Contact us, and we’ll be in touch.