Srinivas Reddy’s Weblog

My Tech Rants

Generated Coding vs Generic Coding

leave a comment »

As we transition from a PC centric to ubiquitous computing world we need to look deeper into our programming models and software design aspects. Client/Server programming model has encouraged creation of application containers (be it j2ee servers, windows server, object-relational persistence frameworks,…) which handle in a generic manner key application functionality. Be it Security/transactions/object lifecyle/logging/….   With the grouping interest in Aspect oriented programming (which enables generically handling crosscutting concerns) we can only expect the importance of generic coding to increase.  What does this mean for a average developer?  If you ever wondered what the declarative syntax in the many xml files was doing,  it provides the information for the generic runtime to handle your specific application instance.  To put in the right jargon, its inversion of control or dependency injection. While this makes the work of application developer much easier (they can focus on the domain problem), it makes the work of generic framework that much more critical. In a sense this is inline with the increasing levels of abstraction being provided by operating systems/databases/application servers/…   The managed runtimes which are being provided by the virtual machines (be it .NET or Java) make development of such generic runtimes/frameworks easier. This also explains the current wave of generic frameworks in the market (JavaServerFaces, Spring, different AJAX frameworks,…). In fact some vendors are extending this generic frameworks with domain specific objects (can be business objects or consumer related) to make building of composite applications (web2.0 if you like) easy.

So if generic coding is so great does that mean all that developers need to do is create as much of generic coding as possible and applications themselves are fully modelled?  If everything was running on the server and the client was just a dumb rendering engine or is a thick client this would be fine. In the real world we actually want to use the computing power of the client and offer some richness and smartness to work offline on the client.  This in turn means that considering the resource constraints on the client we will need to sacrifice our generic coding for a very  optimised generated runtime for applications. The devices are mostly domain specific (games/inventory management/email/…) and need custom generated runtime making the best use of avaialble hardware.  Developers familiar with development for mobile/embedded devices will understand this pain better ;o)  While in general using generated coding will perform better then generic coding, the total cost of ownership(TCO) issues may blur the difference. There is a trend in the current mobile developers (be it J2ME/.NET CF/…) to move towards a managed environment. While the devil is in the detail, for most embedded systems custom genaration is the only option.  Some of you may be wondering how this issue is related to the code generators which come with the IDE’s.  Well the issue is should the code generator generate some generic coding (the developers only add bells & whistles – domain logic if you like) or does it generate only  a bare bones skeleton with the developer having to code all aspects (security/…).  In general the modern IDE’s come with code generators (be it for web/desktop/mobile/… development), offcourse if you are a code freak and write all your code in text editor it be interesting to know that most application developers do very little acutal coding ;o)



Written by srinivasreddy

July 26, 2006 at 9:53 am

Posted in Technology

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: