Table of Contents

Introduction

The Open Application Standard Platform (OASP) provides a solution to building applications which combine best-in-class frameworks and libraries as well as industry proven practices and code conventions. It massively speeds up development, reduces risks and helps you to deliver better results.

Overview Onion Design

This guide shows the overall proposed architecture in terms of separated layers making use the Onion architecture pattern. Each layers represents a logical group of components and functionality. In this guide you will learn the basics of the proposed architecture based in layers in order to develop software making use of the best practices.

Layer specification

It is important to understand the distinction between layers and tiers. Layers describe the logical groupings of the functionality and components in an application; whereas tiers describe the physical distribution of the functionality and components on separate servers, computers, networks, or remote locations. Although both layers and tiers use the same set of names (presentation, business, services, and data), remember that only tiers imply a physical separation. It is quite common to locate more than one layer on the same physical machine (the same tier). You can think of the term tier as referring to physical distribution patterns such as two-tier, three-tier, and n-tier.

— Layered Application Guidelines
MSDN Microsoft

The proposed architecture makes use of cooperating components called layers. Each layer contains a set of components capable to develop a specific functionality.

The next figure represents the different layers:

technical architecture
Figure 1. High level architecture representation

The layers are separated in phisical tiers making use of interfaces. This pattern makes possible to be flexible in different kind of projects maximizing performance and deployment strategies (synchronous/asynchronous access, security, component deployment in different environments, microservices…​). Another important point is to provide automated unit testing or test-driven development (TDD) facilities.

Application layer

The Application Layer encapsulates the different .Net projects and its resource dependencies and manages the user interaction depending on the project’s nature.

technical architecture
Figure 2. Net application stack

The given application template integrates Swagger contract automatic generation. This provides the possibility to external applications (angular, mobile apps, external services…​) to consume the data from a well defined exposed contract.

Business layer

The business layer implements the core functionality of the application and encapsulates the component’s logic. This layer provides the interface between the data transformation and the application expositure. This allow the data to be optimized and ready for different data consumers.

Service layer

The service layer orchestrates the data obtained between the Domain Layer and the Business Layer. Also transforms the data to be used more efficently between layers.

So, if a service needs the help of another service or repository, the implemented Dependency Injection is the solution to accomplish the task.

In order to be as flexible as the implementation of Repository Pattern in the Data Layer , each service implementation inherits from EntityService class:

    public class Service<TContext> : IService where TContext: DbContext
Once more <T> is the mapped class which reference the entity from the database context. This abstraction allows to write services implementation with different database contexts

Domain layer

The data layer provides access to data directly exposed from other systems. The main source use to be a data base system. The provided template makes use of Entity Framwork solution from Microsoft in order to achieve this functionality.

To make a good use of this technology, Repository Pattern has been implemented with the help of Unit Of Work pattern. Also, the use of generic types are makes this solution to be the most flexible.

Regarding to data base source, each entity is mapped as a class. Repository pattern allows to use this mapped clasess to acces the data base via Entity framework:

 public class UnitOfWork<TContext> : IUnitOfWork<TContext> where TContext : DbContext
Where <T> is the mapped class which reference the entity from the database.

The repository and unit of work patterns are create an abstraction layer between the data access layer and the business logic layer of an application.

Cross-Cutting concerns

Cross-cutting provides the implementation functionality that spans layers. Each functionality is implemented through components able to work stand alone. This approach provides better reusability and mantainability.

A common component set of cross cutting components include different types of functionality regarding to athentication, authorization, security, caching, configuration, logging, and communication.

Communication between Layers: Interfaces

The main target of the use of interfaces is to loose coupling between layers and minimize dependencies.

Public interfaces allow to hide implementation details of the components within the layers making use of dependency inversion.

In order to make this possible, we make use of Dependency Injection Pattern (implementation of dependency inversion) given by default in .Net Core.

The provided Data Layer contains the abstract clases to inherite from. All new repository and service classes must inherit from them, also the must implement their own interfaces.

technical architecture
Figure 3. Architecture representation in deep

Templates

State of the art

The provided bundle contains two .Net templates (Classic .Net Framework 4.5+ and .Net Core Framework).

Both templates share the same architecture. the current version contains the next functionalities implemented:

technical architecture
Figure 4. Current available functionality

Software stack

Table 1. Technology Stack of OASP
Topic Detail Implementation

runtime

language & VM

Microsoft .Net 4.6 oder .Net Core Version

persistence

OR-mapper

Entity Framework Core / Entity Framework 6 - Code TBD

service

REST services

Web API

service - integration to external systems - optional

SOAP services

WCF

logging

framework

Serilog

validation

framework

NewtonSoft Json, DataAnnotations

component management

dependency injection

Unity

security

Authentication & Authorization

JWT .Net Security - Token based, local Authentication Provider

unit tests

framework

xUnit

Target platforms

Thanks to the new .Net Core platform from Microsoft, the developed software can be published Windows, Linux, OS X and Android platforms.

The compete RID (Runtime Identifier) catalog is this:

  • Windows

    • Portable

      • win-x86

      • win-x64

    • Windows 7 / Windows Server 2008 R2

      • win7-x64

      • win7-x86

    • Windows 8 / Windows Server 2012

      • win8-x64

      • win8-x86

      • win8-arm

    • Windows 8.1 / Windows Server 2012 R2

      • win81-x64

      • win81-x86

      • win81-arm

    • Windows 10 / Windows Server 2016

      • win10-x64

      • win10-x86

      • win10-arm

      • win10-arm64

  • Linux

    • Portable

      • linux-x64

    • CentOS

      • centos-x64

      • centos.7-x64

    • Debian

      • debian-x64

      • debian.8-x64

    • Fedora

      • fedora-x64

      • fedora.24-x64

      • fedora.25-x64 (.NET Core 2.0 or later versions)

      • fedora.26-x64 (.NET Core 2.0 or later versions)

    • Gentoo (.NET Core 2.0 or later versions)

      • gentoo-x64

    • openSUSE

      • opensuse-x64

      • opensuse.42.1-x64

    • Oracle Linux

      • ol-x64

      • ol.7-x64

      • ol.7.0-x64

      • ol.7.1-x64

      • ol.7.2-x64

    • Red Hat Enterprise Linux

      • rhel-x64

      • rhel.6-x64 (.NET Core 2.0 or later versions)

      • rhel.7-x64

      • rhel.7.1-x64

      • rhel.7.2-x64

      • rhel.7.3-x64 (.NET Core 2.0 or later versions)

      • rhel.7.4-x64 (.NET Core 2.0 or later versions)

    • Tizen (.NET Core 2.0 or later versions)

      • tizen

    • Ubuntu

      • ubuntu-x64

      • ubuntu.14.04-x64

      • ubuntu.14.10-x64

      • ubuntu.15.04-x64

      • ubuntu.15.10-x64

      • ubuntu.16.04-x64

      • ubuntu.16.10-x64

    • Ubuntu derivatives

      • linuxmint.17-x64

      • linuxmint.17.1-x64

      • linuxmint.17.2-x64

      • linuxmint.17.3-x64

      • linuxmint.18-x64

      • linuxmint.18.1-x64 (.NET Core 2.0 or later versions)

  • OS X

    • osx-x64 (.NET Core 2.0 or later versions)

    • osx.10.10-x64

    • osx.10.11-x64

    • osx.10.12-x64 (.NET Core 1.1 or later versions)

  • Android

    • android

    • android.21