reference_introduction_architecture - NibiruOS/mobile GitHub Wiki

Architecture

High-level diagram

Technology stack

The components are based on JSR330 dependency injection (Implemented on all platforms using Dagger 2), but implementations are based on many technologies, such as:

Portable development

Nibiru Mobile provides a high degree of portability among differents platforms. It is not focused on developing 100% portable apps. Instead, it aims to make easy cross-platform development reusing most of the components.

Since Java is the base language (see next section), a common API is provided for Android, GWT and iOS platforms. This way, you can develop both, HTML5 applications (using GWT), native Android apps and native iOS apps (using MultiOS Engine).

Java platform

Java was chosen because it is currently the most widespread platform within the enterprise applications, in addition to being easily portable to different environments and having many frameworks and libraries.

Most portable development platforms, such as Apache Cordova (aka PhoneGap) or Appcelerator are based on JavaScript.

We believe that this language is not suitable for enterprise development, since it lacks of many features such as packaging, strong typing, etc. Adding GWT over PhoneGap can solve these issues.

However, Nibiru Mobile goes one step further, providing a common API not just for accessing hardware, but for many common components.

IoC pattern

In order to decouple each component from the container and other components, the dependencies of each component are injected (IoC pattern).

JSR330, a Java standard for dependency injection, is used for configuring components in a framework-agnostic way.

At each platform, a unique framework (Dagger 2) is used in order to implement this pattern.

MVP pattern

The model used for the presentation layer is the MVP pattern, under its passive view variant. This allows the presenters to be decoupled from each other by an event bus and also to be decoupled from view implementation. Google also makes a good description of this pattern.

Also, the concept of abstracting the view was taken a step further, creating abstractions for common components. Thus, the user can choose creating a generic view or creating a view using the particular advantages of a specific technology.