Main | License | Installation | FAQ | Screenshots | Contact | Links | Sf.net | Freshmeat.net | KDE-Apps.org
Requirements | Design | Modules | Class Hierarchy | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

Design

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.

The C++ program

Static Structure

classes.png

Static structure of AnyMeal

Collaboration

import.png

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 Mealmaster parser is implemented using flex to achieve high-speed. flex is a state-of-the-art finite-state-machine lexer.

Graphical User Interface

Menu

Search Dialog

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).

Recipe List

A recipe list is a MDI-window displaying a list of recipes and a selection. It has the following buttons:

Database

Entity Relation Diagram

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:

er.png

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).

Data Flow

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.png

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.

Todo:
All documentation has to reside in the kde-directory.

Use QDockWindow instead of QMainWindow or QWindow

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.

Improve graphics

ID of recipe changes after editing. The dialogs and the selection have to be updated!

Fulltext search

Make input-data of search-dialog and name of last database visited persistent.

Introduce forward-/backward-button for navigating through huge amounts of recipes.



anymeal 0.30 - recipe management software - Make the most of your food! - © Jan Wedekind Wed Sep 26 01:40:00 2007 - GNU Free Documentation License