If you are like me, you probably come from an RPG background. You know green-screen subfile programming inside-out, how to organize and process any business data, and how to build complex business applications by calling programs from menus. But moving to the web can be daunting for anyone. There’s a whole new programming paradigm to learn, not to mention different languages: HTML, CSS, JavaScript, and PHP. You can compare the combination of HTML, CSS, and JavaScript to display file DDS on steroids. They provide the UI for your end users; to compare PHP to RPG, think of it as "RPG for the Web." PHP is a great language for us RPG programmers to learn because it can be written using constructs familiar to RPG programmers. For example, in RPG, we have subroutines and subprocedures. In PHP, we have functions. However, there’s still a significant learning curve to creating web applications with PHP. That’s one reason BCD created WebSmart PHP--to reduce that learning curve and get you productive building robust, commercial-quality web applications quickly.
Here’s a summary of some of the key skills you need to learn to build web applications:
- ‘Stateless’ versus ‘stateful’ or ‘modal’ programming. Web apps are stateless, meaning the server code never knows what ‘state’ the client is in--it can’t sit there and wait for a response.
- Mixing UI code with business logic. Web apps often intertwine browser output with the business logic. In interactive RPG, we are used to separating these two between Display file DDS and the RPG code.
- New ways of describing our UI and validating user input. Display file DDS is relatively simple--everything fits in neat rows and columns, and validations for numerics, etc., are either built in to the OS or easily added with simple keywords. Web apps typically use more complex presentation and validation methods, which makes for much more user-friendly apps. The tradeoff is usually that you, as a developer, have a lot more to learn and write to create a robust web app.
- New database programming techniques. Record Level Access or RLA (using RPG opcodes such as READE, CHAIN, etc.) is highly efficient and fast-performing but is going the way of the dodo bird, being quickly eclipsed by SQL. SQL is a universal language for describing and accessing/updating databases. It’s powerful and flexible, but SQL uses a totally different coding approach to RLA.
WebSmart PHP minimizes the learning curve for all these skills through the use of Intelligent Templates, wizards, and tight integration with IBM i and with databases including DB2. WebSmart PHP users share the same experience as Melinda Fowler from Ouachita Baptist University who said, "The templates not only allow me to write an input screen in an hour or less, but it greatly helped me through the learning curve in moving to the PHP language." WebSmart PHP is not just a development environment. It’s a complete application development stack.
Play the video to see how WebSmart PHP reduces the PHP learning curve
Build Applications Quickly With Intelligent Templates
WebSmart PHP helps you build complete applications without you having to learn all these new technologies in depth because it generates all the code for you--HTML, CSS, JavaScript, and PHP. Intelligent Templates provide this capability. When you start WebSmart PHP, you choose a template to work with. The template determines the look and feel of your program (color scheme, fonts, locations of logos, etc.) and the functionality of the program. For example, if you want to create a program that’s analogous to a ‘Work With’ subfile program, you can choose the ‘Page At A Time Maintenance’ template, in several different flavors. The built-in intelligence in this template means that WebSmart PHP knows what questions to ask you--which fields you want to place on the ‘subfile’ list, and in what order, for example. It also lets you link multiple files together, either using RLA or SQL database access--your choice. After you’ve answered all the questions, you get a complete, working program that you can run immediately. All this, with no programming required at all.
Productivity Tools For Building On Your Application
Once you’ve built your initial program, the WebSmart PHP development environment provides you with a myriad of features for helping you modify it or add new functionality, all designed to minimize what you need to know. For example, there are HTML wizards for creating typical web elements such as forms, layouts, and tables. The HTML is separated from the PHP in the IDE to make it easier to edit as well as to make it more similar to how RPG programmers are used to coding. There are database wizards for helping you construct SQL statements. There’s even a built-in SQL query tool so you can immediately see if your SQL statement will retrieve the data you expect. Or, you can use the tool to get a quick look at the contents of your files. There’s also wizards that make it easy for you to integrate with RPG so you can leverage your existing investment. For example, one wizard creates the PHP code for calling RPG programs or modules, providing you with prompts for the parameters and their data types. Another wizard writes all the code for you to loop through a subset of records in a file.
Tight Integration With Several Databases
WebSmart PHP provides complete integration with several modern databases, including DB2, MySQL, and Oracle. When you are working in the development tool you can see a list of all the files you are working with, plus their fields. If you want to place a field on your UI, simply drag and drop it onto the design area--either in HTML view or in Visual Editing (WYSIWIG) view. If you need to write PHP code, having access to fields information makes it easy for you to write accurate code, for example, by minimizing spelling errors for fields. WebSmart PHP also includes a database Central Repository. This feature lets you define presentation and business rules at the database level. All programs you build with the Intelligent Templates will take advantage of these rules. For example, suppose you have a state field in a file. You can attach a state selection dropdown box to it once and have it included at the appropriate place every time you build a program using that field. Another example is with date fields. You can attach a calendar popup to any date field in the Central Repository and have it included every time you need that date. Writing that code by hand would involve piecing together many moving parts, including server-side code, HTML, CSS, and JavaScript, but with WebSmart PHP you can do this with no coding on your part.
Tight Integration with IBM i
In addition to the tight integration with your DB2 files, WebSmart PHP integrates with other parts of your IBM i. It includes all the i5 PHP functions for working with iSeries objects like data areas, userspaces, spool files and data queues. You can also easily save your PHP programs in the appropriate web server directory using the built-in FTP client. If you choose to host your PHP programs on your IBM i this means the PHP file including the HTML is automatically FTP'd to the correct IFS directory. Web servers are another new area for most RPG programmers, and WebSmart PHP helps you with that learning curve by including a preconfigured APACHE instance with the install so you can start creating and launching your programs right away.
Build Anything You Like With WebSmart PHP
WebSmart PHP will not only make you more productive, it will help you learn the skills you need to be a proficient web developer. As you work with the wizards and read the code, you’ll start to become familiar with what it takes to write anything you need. WebSmart PHP not only provides you with the tools to jumpstart your development but also everything you need to build absolutely any kind of PHP application you want, from a full-blown ERP or CRM system to a web-services consumer or provider, to a Web 2.0, AJAX-driven B2B site.
BCD has over 20 years experience producing application development tools, starting with green-screen and, most recently, with WebSmart PHP. We also provide the best support in the industry. You can also learn more about WebSmart PHP and you can download a free trial of the full version of WebSmart PHP and see for yourself how you can reduce the learning curve and start building web applications today.
Duncan Kenzie is president and CTO of BCD Technical Services.