Posted on Jun 14th 2011
Recently, I had an interesting discussion with a
MyEclipse for Spring (ME4S) customer regarding the integration of code generation tools into the software development process. The IT Director highlighted for me how ME4S fits into their development workflow, sharing several diagrams that he uses to illustrate the software development lifecycle (SDLC). The diagrams were very elaborate and encompassed everything from requirements gathering to application maintenance. ME4S was listed as a sanctioned tool in several sections, the most notable sections being design (prototyping) and implementation.
One of the things that I found particularly interesting was how the decision to hand-code versus generate was illustrated. The concept is very simple, and I’ve discussed it over and over again in various places (webinars, screencasts, blog posts), but until I saw the diagram, I never really considered it something that needed to be illustrated. But now that I’ve seen it, I see the value. I’ve recreated the diagram (with permission of course), and I modified it slightly to make it more general.
This first diagram illustrates a completely hand-coding approach to producing software code artifacts. The basic idea is that at some point during application development you will identify a set of source code artifacts that are required to satisfy the requirements. Depending on the size of the project or the methodology being used, the set of source code artifacts could come from designers during the design phase or from developers. In either case, the required set of source code artifacts are identified, coded and delivered.
This second diagram illustrates the process when code generation tools like ME4S are available. Just like the first diagram, a required set of source code artifacts are identified. The difference is that you have various options for producing them. The first option is to use code generation tools to fully produce the required artifact. After all, why would you hand-code something if it can be completely generated? The second option is to use code generation tools, too; however, it acknowledges that in some cases the artifact can’t be fully generated. The code generation tools will get you close, but the developer will need tailor the generated artifact. For example, the developer may remove unnecessary code, add missing code or just copy-and-paste a few code fragments. Finally, if the source code artifact can’t be completely or partially generated, then the third option is to just hand-code it.
To achieve the benefits of code generation in the manner illustrated, a developer needs to be very familiar with all of the artifacts that can be generated. ME4S 9.0 is the present version, and it can generate software components for Spring MVC, Spring Web Flow, Spring Security, REST, JAX-WS, Adobe Flex, Google Web Toolkit (GWT), iPhone w/ iWebKit, JPA, DAO and JSF 2.0/Primefaces. The thing that differentiates a ME4S expert from a beginner is that the expert knows how to squeeze everything they can out of code generation. Code generation is always their first option, and they will only revert to hand-coding when code generation options don’t exist.
I hope this post is helpful to current and future ME4S users. I realize that some ME4S users don’t view the code generation functions of ME4S in this manner. The primary ME4S use case for many developers is to use the code generation functions to quickly a generate a fully implemented, ready-to-run application. Just remember that generating fully-implemented, ready-to-run applications is a testament to the completeness and quality of the ME4S code generation functions, but it’s not the only use case. :-)