Architecture of a mobile business app that uses DEM
Developers of DEM business apps face several challenges. App requirements can change over time. New business opportunities and challenges may appear. Ongoing customer feedback during development can significantly affect the requirements of the app.
DEM for Android and iOS provides architecture that helps do just that. It is designed to help developers create apps which are supposed to accomplish the following:
Address the common app development scenarios.
Separate the concerns for presentation, presentation logic, and model through support for Model-View-ViewModel (MVVM).
Use an architectural infrastructure to produce a consistent and high-quality app.
The logical architecture of a typical mobile business app that uses DEM is shown in the following diagram.
Blue color represents assets from DEM and silver color represents assets for overriding existing or creating new ones and green color represents client assets.
This architecture facilitates the production of flexible, maintainable, and testable apps and it is used by the Bank Simple reference implementation. It includes components that help to accelerate the development of your banking app by providing support for MVVM, loosely coupled communication, and the core services required in DEM apps, allowing you to focus on developing the user experiences for customer banking apps.
Applications based on the DEM are composite applications that potentially consist of many loosely coupled types and services. They need to interact to contribute content and receive notifications based on user actions. Because they are loosely coupled, they need a way to interact and communicate with one another to deliver the required business functionality. To tie together these various pieces, applications based on the DEM use a dependency injection container.
Key Concepts
This section provides a brief overview of the main concepts behind DEM and defines some of the terminology that you will see used throughout the documentation and code.
Application. Application represents the host into which modules are loaded. It implements common application services and infrastructure, but most of the application's functionality and content is implemented within the modules. DEM provides infrastructure for building mobile applications such as base application class, core application services, helper and utility classes, base UI controls and components.
Modules. Modules are packages of functionality that represent specific business-related functionality (for example, payments) and encapsulate all the views, services, and data models required to implement that functionality. Modules can also be used to encapsulate common application infrastructure or services (for example, logging and exception management services) that can be reused across multiple applications.
Views. Views are UI controls that encapsulate the UI for a feature or functional area of the application. Views are used in conjunction with the MVVM pattern, which is used to provide a clean separation of concerns between the UI and the application's presentation logic and data. Views are used to encapsulate the UI and define user interaction behavior, thereby allowing the view to be updated or replaced independently of the underlying application functionality. Views use data binding and commands to interact with view model classes.
View models. View models are classes that encapsulate the application's presentation logic and state. They are part of the MVVM pattern. View models encapsulate much of the application's functionality. View models define properties, commands, and events, to which controls in the view can data-bind.
Widgets. A mini app that always displays a few pieces of information in the host view and interacts with the user. Widgets are hosted in Dashboard view and the main difference from the other view elements is that it can be rearranged by the user.
Visual Components. Represent composite UI elements that can be reused across multiple views. Components are composed from standard UI controls.
Commands. Commands are used to connect views and view-models. They encapsulate application functionality in a way that allows them to be invoked by the user. They can be defined as command objects or as command methods in the view model.
Regions. Regions are logical placeholders defined within the application's UI (in the views) in which widgets are displayed.
Navigation. Navigation is defined as the process by which the application coordinates changes to its UI as a result of the user's interaction with the application or internal application state changes.
EventAggregator. Components in a composite application often need to communicate with other components and services in the application in a loosely coupled way. DEM uses Xamarin.Forms MessagingCenter, which implements a pub-sub event mechanism, thereby allowing components to publish events and other components to subscribe to those events without either of them requiring a reference to the other one. The EventAggregator is often used to allow components defined in different components to communicate with each other.
Dependency injection container. The Dependency Injection (DI) pattern is used throughout DEM to allow the dependencies between components to be managed. Dependency injection allows component dependencies to be fulfilled at run time, and it supports extensibility and testability. DEM is designed to work with AutoFac, or with any other dependency injection containers via the ContenerProvider.
Services. Services are components that encapsulate non-UI related functionality, such as logging, exception management, and data access. Services can be defined by the application or within a module. Services are often registered with the dependency injection container so that they can be located or constructed as required and used by other components that depend on them.
Resources. Resources are various types of static content that can be used by the application to initialize various framework components and services like translations.
Modular Application Development
A modular application is an application that is divided into a set of loosely coupled functional units (named modules) that can be integrated into a larger application. A client module encapsulates a portion of the application's overall functionality and typically represents a set of related concerns. It can include a collection of related components, such as application features, including user interface and business logic, or pieces of application infrastructure, such as application-level services for logging or authenticating users. Modules are independent of one another but can communicate with each other in a loosely coupled fashion.
Blue color represents assets from DEM and green color represents assets for client application. DEM Framework currently has these modules that are connected to the Digital Edge REST API:
Foundation. This module covers all shared banking infrastructure services such as authorization, authentication and shared business-related functionality like messaging, notification etc. from end point such as correspondence, dialog, device etc.
Payments. This module encapsulates all banking logic from the payment end point
Account Data. This module encapsulate access to balance and histories of customer account arrangements from account data endpoint.
Products. This module encapsulates specific features for selling banking products Loans, Savings etc.
These modules communicate with each other and with back-end systems such as REST services. Application services integrate various components within each of the different modules and handle the communication with the user. The user sees an integrated view that looks like a single application.
DEM core functionality is a shared code base and things that need to be platform specific are implemented in the multi-traget libraries with respective folders (Droid & iOS) for the target platform.
- AssecoSEE.DEM.Devices
- Droid
- iOS
This means that all code for iOS and Android exists inside one project AssecoSEE.DEM.Devices. More info about multi-trageting
Developer can use parameterization to change features and uses-cases (bug fixing and small changes) from the modules for faster delivery and enormous cost reduction. But in some cases, you will want to customize the DEM to incorporate new features with extensibility points or override existing ones to support customer requirements.
DEM includes components to help accelerate the development of a mobile app that uses the MVVM pattern. It helps to accelerate development by providing core services commonly required by a mobile app, allowing you to focus on developing the user experiences for your app. Alternatively, you could choose to develop the core services yourself. For more info see getting started