This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I'm developing a webapp which has a web structure similar to a portal (well, it actually is a portal!). Like in every other portal on the web, there will be a great number of pages which all have the same structure, i.e. an header, a navigation bar, left and right menu's, a footer and so on. The content of every singular module is generated dinamically and imported in every JSP, so no problem at this. What is making me worrying is the general structure of the page, which must be identical for every page on the portal. I'd like to use or write a template engine (or something like that) to handle the structure of the page (dimensions of header, width of menu's, position of some elements and so on). This is not an hard job actually, I can think of more than one solutions to this, but I'd like to do it in the "proper" way. I.e. is there a well known, maybe "standard" engine out there to handle these kind of things, or maybe a design pattern you can apply to design it in the right way ? I would not like to discover that what I implement is not good for some reason (maybe not scalable, not flexible or whatever). Just to make things more clear, I'll provide a stupid example. I got a page named header.jsp in which is written (wohoo, big surprise!) the content of the header for every page. The header is included in every page with :
The header has a width which is obviously equal for each page, but every page has to adjust the width of the table of the main content to fit the header. If I decide to change the header width, I must change each jsp to fit the new width. I could extrapolate a set of variables that organize the structure of the jsp and then set those variables values for each jsp, but then I have to handle these variables in some way, and it seems to me I would go with a private implementation that could result sooner or later in a bad design which would require a total reorganization of the whole portal. I'm basically looking for design patterns for portals templates manipulation.
I know what I'm near to write will sound like a blasfemy, but ... I use CSS only for graphic management of the components, dimensions and position of modules are organized via HTML tables ... And if I could ask, what do you mean with tag files ? Could you provide me an example ? Maybe I know those with another name, but whatever. Thank you for your help. By the way, I'm browsing the web for this problem and I found something about the Composite View pattern, do you think this could be a reasonable solution ? (I'm still reading on it, don't know if it's related to this problem or not)