The Virtues of Laziness
If necessity is the mother of all invention, then laziness is a doting aunt, especially where developers are concerned.Our desire to do as little work as possible has spawned, paradoxically, impressive feats of ingenuity.
We replaced our spaghetti-code subroutines with re-usable, elegant objects (OOP) figuring why do many times what can be done once; we abandoned our hard-coded data-layer drudgery in favor of drag-and-drop ORMs (ala Linq To Sql and Entity Framework); we even fled from manual GUI code (perish the thought!) and found refuge in the warm welcoming arms of template-driven web pages (Dynamic Data); we leverage Http Modules and fancy new Design Patterns whenever humanly possible (do I hear Inversion of Control?).
All-in-all, our laziness has paid off. Our code is more modular, maintainable and we get to use the battle cry DRY (don’t repeat yourself) when nobody’s looking.
The next evolutionary step, one might think, is code generation. Why write code at all when someone (or something) can do it for you?
Code Generation
For our purposes code generation refers to:any tool that generates a fully-functional web application based on a set of database objects.The generator creates web pages based on database tables and uses foreign key relationships between tables to create links between the web pages.
Iron Speed is one such code generator for ASP .NET.
The generation process involves 5 steps:
- Select a design theme (menu above or at the side, color scheme)
- Select the page types you require - record display, table display, reports, emails, workflows, etc. – and select the relevant database tables or views
- Select a few configuration settings (code language, Sql or stored procedures, etc)
- Let Iron Speed generate the web pages, data and business layer code in under a minute or two.
Each page involves 5 files:
- an html layout file
- settings stored as xml
These are used to generate the other files:
- an aspx file
- a code behind file (page.cs for C#)
- a code file with classes for each Iron Speed control on the page (page.Controls.cs)
- Customize! (Rarely will Iron Speed guess correctly which fields you want to display.)
- Using the Iron Speed designer – this makes changes to the html and xml files. When you re-build the site, the code files will also change.
- Change page behavior by overriding methods in the code files in the designated sections. These changes will not be overwritten when you next build the site.
Pros and Cons
The advantages are obvious:- Quick development time
- Rich GUI applications: paging, export to Excel etc., menu’s, reports
- Object-oriented code design
- Data layer can be configured to use either straight SQL or Stored Procedures
- Online forums for troubleshooting
- Simple if limited authentication-authorization infrastructure for forms or Active Directory-based security.
- Expensive – licenses are in the thousands of dollars
- Restrictive licensing policy – licenses are connected to specific users so forget about transferring a license from one team member to another even if the former has moved to Timbuktu.
Iron Speed Gotchas
- Customizations made via the Designer are lost when even minor changes are made. This can be a serious setback for application maintenance of customization-heavy pages. A minor tweak becomes a start-from-scratch task.
- IronSpeed version upgrades often break code and require recoding.
- Stored procedures are overwritten, not altered, and thus will lose their permissions properties each build. The procedures are based on dynamic queries and thus you’ll need to grant permissions to the actual tables in addition to the procedures.
- GUI design is limited. Forget about moving your menus from below the logo to above – you’ll have to wade through pages of “theme” code – partly in XSL – which is littered with misleading obsolete code files. You may resort to very complex customizations and workarounds that defeat the purpose of code generation. Good luck!
”Why, o why,” your users will whine, '”can’t you just move the button to the other side?” - Simultaneous development is a major headache. The designer makes seemingly random changes that make code merges a nightmare if not practically impossible. The end result: features that “disappear” after a merge.
- Users with minimal privileges may have empty table columns where buttons and values have been hidden. “Why can’t you just hide the damn table column?” is another familiar user complaint.
Conclusions
For small applications that follow the database table structure closely and require little updating, Iron Speed is a pleasure.However, when it comes to a monster application delivered to demanding users and implemented by a multi-member Agile development team over multiple phases – think twice. The time you save on your first iteration will be devoured by your second, third and so on.
You may want to roll your own site or even tinker with Dynamic Data, which, being a template infrastructure as opposed to code generator, will offer the flexibility and predictability you seek, at the cost of fewer bells and whistles out the box.
Bottom line: laziness has a dark side too.
2 comments:
Will all due respect to Danielson, I have to disagree as our company (team of 10 developers) have developed many enterprise applications over the last six years. Let's face the reality that developers hate to maintain the applications as they only want to design and create new ones.
Without Iron Speed maintenance would be a nightmare. Can you imagine that the end users requesting that all occurrences of Customer be renamed to Prospect and you have a day to fix it? With Iron Speed, agile development has become a reality.
I would like to say the following:
* Customizations made via the Designer are lost - This is not true and I can share with anyone the right way to use the product. If you try to use the screwdriver as a hammer, of course it won't do the job.
* IronSpeed version upgrades often break code and require recoding - Once again, if you use the tool in right context, it is surely not true.
* Stored procedures are overwritten, not altered, and thus will lose their permissions properties each build. - As you only need to give the execute permissions without underlying tables, I am sure that some permission planning may be the cause of this.
* GUI design is limited. Forget about moving your menus from below the logo to above – you’ll have to wade through pages of “theme” code – partly in XSL – which is littered with misleading obsolete code files. - With the Master Page concept, I surely can see lack of product knowledge. What is being asked is purely drag and drop.
* Simultaneous development is a major headache. The designer makes seemingly random changes that make code merges a nightmare if not practically impossible. The end result: features that “disappear” after a merge. - Since Iron Speed integrates with Team Foundation Server (TFS), we are developing Enterprise level applications with teams from our company as well as our customers. Of course, you need TFS but that is required for enterprise level applications.
* Users with minimal privileges may have empty table columns where buttons and values have been hidden. “Why can’t you just hide the damn table column?” - Let's get to the bottom, Iron Speed can only do much. If you need to extend it, you need to learn it. I haven't found any tool which allows the development team to focus on business requirements and flow rather than arguing about the time it may take when the end users are changing their mind.
In our experience, Iron Speed has proved out to be the ultimate when it comes to delivering Enterprise Applications in record time. One can always do a survey to see how many developers had success with transferring their development knowledge in a team effort so that others can maintain their code when they are on vacation. Let's look for prosperity and not security. Lack of product knowledge should not be viewed as lack of product features.
No tool is perfect, but as the needs of an IT department/group increase, tools such as Iron Speed Designer can provide a means to generate applications that can be delivered faster and look great.
Does the user care if you 'hand coded' the data layer? Do they care what your 'methodology' was? Users in most cases want an application that provides the needed features in a timely manner and I believe Iron Speed Designer can meet many of those needs.
Iron Speed Designer doesn't 'prevent' you from doing standard ASP.NET. The product complements Visual Studio, so where it doesn't meet your needs, you can still switch to VB.NET or C# code in Visual Studio.
Post a Comment