How Code Generation Makes Development Easy Over Traditional WSDL Mode

Thursday, February 14, 2008

Yesterday Samisa's blog revealed new approach that WSF/PHP is going to take in the next major release.

WSF/PHP is going to introduce pre code generation for both Web Service clients and services for PHP developers. I think this may little strange to PHP people who used to expect things happening in run time. But sometime it s better to tests different paths to test and pick the ideal method.

I see several advantages in static code generation over current run-time support for the WSDL mode.
1. The usability is high,
Currently we should write classes manually in order build the data tree of the payload, For that you need to have at least some idea of WSDL and XML Schema. But we cannot expect an average user identify these types and write PHP Classes by hand. So it is better we have systems generating classes.

2. Low error-prone
If you have set of classes pre-defined to use in your system it will be no doubt less error-prone than using classes written by yourself. Because current way you may do errors both in writing classes and invoking services, so generated code will eliminate the errors in writing classes.

3. Rapid Development
It would give you some part of code written for you

4. Sample Demos
Easy to generate sample demos for a particular WSDL, so users will be able to follow them in their application

5. Performance,
If we can bypass the wsdl mode with the newer code generation approach that would enhance the performance, So surely in the first step the generated code would be mostly run using the current wsdl mode, so there will be no performance improvement.

6. Easiness in testing
Mostly this open the path to automate testing.

No comments: