Changes between Version 1 and Version 2 of DeveloperGuidelines/EdenMobile/Structure

03/30/17 08:16:40 (7 years ago)
Dominic König



  • DeveloperGuidelines/EdenMobile/Structure

    v1 v2  
    44== Overview ==
     6The following diagram illustrates the general structure of the EdenMobile app.
     10=== User Interface ===
     12The user interface layer implements AngularJS directives (i.e. HTML extensions) to render the user interface, represent data and facilitate user interactions.
     14EdenMobile directives can be found in the www/directives folder.
     16=== App States and Controllers ===
     18Being a single-page application (SPA), EdenMobile implements "states" (instead of pages) to render different views, i.e. the single front-page is loaded only once, and has parts of its contents replaced as the user interacts with it.
     20Each state has its own "view template" that defines the inner HTML of the front-page for that state, and a controller that supplies data and processing methods for the UI widgets. The view template is rendered and the state controller executed when the state is entered.
     22The routing of user actions to the different app states is provided by the AngularJS UI router. The UI router works with so-called "state references", and can either be called directly, or via HTML links using fragment identifiers to encode the state reference. State references can contain parameters which are then passed to the state, so that it is possible to implement a REST-like routing schema.
     24The states for the EdenMobile app, including their respective view templates and state controllers, are configured in www/config/routing.js.
     26State controllers live in the www/controllers folder, and view templates in www/views. The role of controllers and views is equivalent to controllers/views in the Sahana Eden web application.
     28=== Framework Layer ===
     30The framework layer provides services for state controllers and UI directives - i.e. generic/common functionality and introspection methods, as well as interfaces to access data and configuration settings.
     32This layer is largely what the "S3" package is for the Sahana Eden web application (except for the front-end widgets, which are implemented as directives instead).
     34=== Back-end Abstraction Layer ===
     36The back-end abstraction layer provides abstract interfaces to external components - which are mainly the mobile database, the device's file system and the Sahana Eden server.
     38This layer has a role similar to "PyDAL" in the Sahana Eden web application (except that it also covers other external resources).