I’m working on migrating a project which is very JSP-centric to using Velocity. In many places the JSP pages were simply parsing strings to display various things. This makes the JSP very ugly and difficult to maintain obviously.
I have modified the Controller for this class to do this work for me (i.e. creating a List of POJOs), then iterating over the pieces using velocity. I have a feeling that it’s going to come with heavy resistance.
I realize that creating the Object comes with overhead, but it makes our pages much easier to debug, write and use. Besides the fact it separates the UI from the core logic of what is occurring in the background. Not to mention our appservers are BORED. The database is wincing in pain. We are to see a tenfold increase in users (which could be why it was initially developed to parse the strings in the JSP & skip the object creation) — this smells to me of premature optimization.
What are further arguments to support my claim that we should eat the cost associated with the object creation?
1 Answer