Baking vs Frying Templates
Baking vs Frying at a High Level
The argument of baking and frying is determining where and when to apply presentation to your information.
The baking vs frying argument has been around for some time now. When I was first introduced to content management I was taught that the baking approach was the best although I have come to the conclusion that the best approach to templating is dependant on your requirements. In this article I will describe some of the pros, cons and selection criteria of baking vs frying templates.
Baking
Overview
The baking approach is common in systems that consists of static non-dynamic data. The baking approach generally consists of a presentation template, data files, a merge process (baking) and output files. The merge process pulls the data and presentation together to generate output files that are a combination of both information and formatting. The output files are generally ready to be consumed by users as is. The baking process usually takes place before a user consumes data in an external system.
Pros
- Less processing needed to consume a page
- Performance
- Simplified delivery of information
- Control of display on the CMS (Content Management System) or merge side. This approach does not require a redeployment of a web application such as an EAR (Enterprise Archive) or WAR (Web Archive).
- Low impact on users
Cons
- Baking aka merging large volumes of information is time consuming
- Merging may be complicated
- Baking may cause some presentation logic to be embeded into the merging system
- More effort required by content contributor
- Requires a robust publishing system
Frying
Overview
The frying approach is common in systems that consists of dynamic non-static data. The frying approach generally consists of a presentation template, data files, and a merge process (frying). The merge process pulls the data and presentation together and stores the output in memory or cache at the time of the request. The frying process usually takes place when a user requests a the information.
Pros
- Provides control of display on the consumption/delivery side
- Simple publish of presentation/layout. "Publish Once"
- Control of display is on the consumption side.
- Generally better for personalization. (This approach is often used in Portal technology)
Cons
- Presentation templates can be very complex and contain proprietary markup.
- Impacts performance..
- My require a deployment of ear/war to make changes to the presentation. (This is only true if the layouts being used are part of the web application.
- More effort is required by a template designer
Selection Criteria
This section of the article will hopefully help you choose between a frying or baking system. This criteria is dependant on many factors but here are a few to get you started thinking about which approach is best for you.
Answer yes or no to the following questions?
- Does your system provide a robust publishing mechanism?
- Does your system require personalization?
- Does your system require large amounts of dynamic information?
- Does your system contain large amounts of static information?
- Will the presentation of your system change frequently?
- Is performance a high priority requirement for your system?
If you answered yes to number 1, 4, and 6 I would reccomend selecting a baking templating approach. If you answered yes to 2 ,3 , and 5 I would reccomend selecting a frying templating approach. The selection criteria is only a simple set of questions that at a high level may point you in the right direction.
On several projects I have found myself somewhere in between the lines of baking vs frying. There is no rule that limits you to only selecting one. The best solution for you may be a blend of the two approaches. For example imagine part of your system is an archive of static information and baking is the best approach but the other part of your system is a highly personalized dynamic application. In this case I would reccomend blending. At the end of the day you must carefully analyze the requirements for your system and prioritize them. Take the highest priority requirements and see if they fall within a baking or frying approach.
Conclusion
Hopefully this article was informational and helped you better understand the difference between a baking and frying approach. This is a subject that will be visted and revisted when dealing with presenting information. Always remember that systems evolve and so do the people consuming it. There are often waves of popularity between the two approaches based on the hot technolgy that is out there. In my opinion it is important to remain objective and develop a solid approach that works and keeps your users and customers happy.






