This page contains the design for the 1.0 version of this application. The design may be subject to change.
The beta-version will be the result of extensive testing and necessary feature extensions.
Static structure of AnyMeal
Collaboration for importing Mealmaster recipes
When a Mealmaster recipe is imported, it is converted to XML and then to an SQL script (the latter step is done using an XSL script). Both steps are performed by a
ChainedCompiler object. The resulting SQL script (for inserting the recipe into the database) is passed to the
Database object for execution.
The program memorizes a list of available ingredients, which can be edited by the user. This list is used for searching relevant recipes (see Requirements).
A recipe list is a MDI-window displaying a list of recipes and a selection. It has the following buttons:
All search-commands are converted to SQL and passed on to the database to fully exploit the power of MySQL.
The entity relation diagram explains gives a clue of how the database is (or rather will be) organized:
Entity relation diagram for database tables
The fields author, date, preparation time, total time and the conversion tables for converting units are not implemented (yet).
While AnyMeal stores is data using old-style SQL databases, it also makes extensive use of XML, XSL and XPath to access and convert the data.
While the data flow may be a bit complicated at first sight, the corresponding application is easy to implement, because most of the required functionality already is provided by the libraries used in this project:
Dataflow showing conversion steps for recipes
The design is using the XSU-approach (XML-SQL-Utility). This approach already was used by the Oracle-developers. The results of all SQL-queries are converted to XML. The preparation of the raw data can be done by compact XSL-scripts, which leads to a software-architecture, which is very lean and very flexible, because the database-structure is not reflected in the program's static code. You can find more about these ideas in the following german book:
"Datenbanken und XML. Konzepte, Anwendungen, Systeme" 2002 (Xpert.press) von Wassilios Kazakos, Andreas Schmidt, Peter Tomczyk. http://www.datenbanken-und-xml.de/
F.e. for displaying the recipes are converted first to docbook and then to HTML using an XSL-script and finally displayed with a web-browser-plugin.
It is possible to invoke each compilation-step from the command-line. The following command would convert the first recipe in the database to HTML and display it with lynx:
( echo "<?xml version='1.0'?><query><selection><single>1</single></selection></query>" | \ anymeal -q | anymeal --xsu -d kochbuch -u mysqlUser -p mysqlPassword | anymeal -r | anymeal -b | anymeal -t ) 2> /dev/null | lynx -stdin
The database contains version information. Beginning from version 1.0 there will be a concept how the database gets upgraded, if a new version of the software requires this.
All documentation has to reside in the kde-directory.
QDockWindow instead of
Error: rice% -> ingredient "rice and water" gets counted several times!
User-manual and context-help.
Preserve intendation of recipes. Maybe use fixed-with font and LinearLayout for lines beginning with ':' in Mealmaster file.
Problem with yytext_ptr: Automake doesn't pass options to flex under Mandrake.
Fix sorting of ingredient-amounts in recipe-editor.
Improve user-friendlieness of keyboard-control.
Add throw-clauses wherever possible
Filter input of search-dialog and wizards thoroughly (f.e. no '\'' in database-name, filtering of amount-input).
language-attribute to recipe and make units and all other text in docbook-script language dependent. Add a sample-recipe for each language.
ID of recipe changes after editing. The dialogs and the selection have to be updated!
Make input-data of search-dialog and name of last database visited persistent.
Introduce forward-/backward-button for navigating through huge amounts of recipes.