Meego Wiki
Views

AgileBrowser/Deps

From MeeGo wiki
< AgileBrowser
Revision as of 18:30, 19 May 2011 by Villeez (Talk | contribs)
Jump to: navigation, search

Contents

General

First of all, when using deps format you must use .txt file name extension when opening local file into AgileBrowser.

Deps format can be used to define a model that contains element structure (containment hierarchy), relationships between elements (dependencies), properties for elements (attributes, using key value pairs), properties for relationships (dependency attributes) and properties for the model (model attributes). Element is described using slash ('/') based paths. The path defines the containment hierarchy of the element, e.g. /Family A/Member X. Reference to an element is always done using full path.

Deps format is line based and is intended to be grep friendly. Generally, the order of the lines is not meaningful, although one exception exists, if using dependency attributes (define_dependency_attribute in the grammar). The format includes also a principle of keeping data size minimal (avoiding redundancy). Practically this means that if the model file assigns an attribute or dependency related to an element, there is no need to explicitly define the element.

Mostly model file contains only dependencies and attributes (example 1). However, there is also support for dependency attributes, meta attributes and model attributes. Dependency attributes are used to describe detailed information of particular dependencies (e.g. weight, nature, date of origin, etc.) and that is why those lines need to be immediately after the line that defines the dependency. Meta attributes and model attributes can be inserted into any location. Meta attribute can be used to set attributes for attributes (e.g. data source of attribute). Model attributes are stored using key-value pairs, like all other attributes.

Example 1 : Typical usage

/Applications/FooApp:/System/barlib:uses
@/Applications/FooApp:type:QMLApp
@/System/barlib:license:LGPL

This example defines QML application named FooApp that belongs to Applications group (type for Applications not specified above). There is also one dependency from FooApp to barlib that is marked to have LGPL license.

Example 2: Advanced usage

@@@@model_creation_date:2011-01-17
@@@license:origin:http://someurl.com
@@@license:script:license_extractor.py
@@@license:date_of_snapshot:2011-01-01
/Applications/FooApp:/System/barlib:uses
@@used_members:foo()
@/System/barlib:license:lgpl
/System/unusedlibrary
/Applications/FooApp:/System/bazlib
/Applications/barlib:/System/bazlib:static_usage:io.h


The example describes (in this order) - one model attribute - couple of meta attributes for license - dependency with dependency type uses and one dependency attribute for it, used_members - element attribute - element unusedlibrary under System (this type of element declaration is needed if there is no attributes and dependencies related to it but the element still needs to be declared as part of model. - dependency without type - dependency with information about the dependency type and details, io.h (this details is automatically assigned as dependency attribute named dep_detail)

Helpful conventions

When defining lists as attribute values, it is useful to systematically use an agreed delimiter to help processing lists value by value. AgileBrowser has special support for using semicolon separated attribute values as lists, which is useful if attribute value propagation features are performed (e.g. deriving used licenses to parent elements in the hierarchy).

AgileBrowser has also special support for type attribute. Type is always visually represented when drawing nodes.

EBNF grammar (not syntax checked)

 model = {define_statement}
 define_statement = element_path "\n"
                |  "@" attribute_name ":" value "\n"
                |  define_dependency "\n" {define_dependency_attribute}
                |  "@@@" attribute_name + ":" meta_attribute_name + ":" value"\n"
                |  "@@@@" model_attribute_name ":" value "\n"
 define_dependency_attribute = "@@" dependency_attribute_name ":" value "\n"
 define_element = element_path
 element_path = "/" identifier element_path
 define_dependency = user_element ":" used_element [ ":" dependency_type [ ":" details  ] ]
 user_element = element_path
 used_element = element_path
 dependency_type = identifier
 dependency_attribute_name = identifier
 details = text
 value = text
 text = { all characters − '\n' }
 identifier consists of strings that must start with a letter - including underscore (_) - 
    followed by any number of letters and digits.
Personal tools