Tuesday, 22 September 2015

Acumatica Architecture

Today I want to share some information about Acumatica Architecture from web interface to database.

We will go through:
  • Frameset structure
  • Page structure
  • Main communication protocol between browser and server
  • Business logic architecture
  • Acumatica ORM architecture.

Frameset Structure
Acumatica is based on ASP.NET technology, so the main thing under main page is Frameset
Frameset consists of different menus and the page.
Green part is customizable using sitemap, localization, access rights and some settings.
Orange part is customizable using Customization Manager, access rights, localization, and many different settings.. Also you can develop new pages using Acumatica Framework.

Welcome tho this article, if you want to see more!

Page Structure
This part is your main target if you want to customize something or develop new functionality. Each page represents one *.aspx file on server side. Here you can place controls, add user interface logic with JavaScript, define plenty amount of settings and properties.

Basic Acumatica Page consists of:
  • Page Title with menu
  • Data source with actions
  • Containers:
    • Forms
    • Grids
    • Tabs
  • Status Bar
Client-Server Communications
When you use browser, UI sends and receives information from server part. Acumatica has its own data communication protocol what is based on Callbacks.
Here we have some points:

  • All UI controls (forms, grids, fields) are mapped to server controls (PXFormView, PXGrid, PXSelector)
  • For all pages system will do several requests. First request for getting HTML, second for sending data.
  • Browser caches page structure in browser cache, so it will not get full HTML and JavaScripts on every requests. 
  • Scripts are cached in the frameset, so they are the same for all pages.
  • During callbacks system sends just XML with data, states and other information.
  • There is not any events here except Get and Post commands.
  • System will not trigger callbacks every-time, just if it is designed by developer (CommitChanges=true)
  • All synchronization can be done only from client, there is no way to refresh UI form server side.
Business Logic Level Architecture
On server side all pages are connected to Business Logic Container (BLC, Graph) through the datasource. All container controls (forms, grids, tabs) are linked to Data Views by datamember property.
BLC contains all business logic code and the relations between tables.
Dataviews maintains changes, selects data from the database and triggers business logic.
Container controls triggers business logic through Insert/Update/Delete/Select methods.

Business Logic Events Architecture
Here you can find the flow how UI triggers server event sequences.
All Acumatica ERP business logic are based on these events. You can subscribe to events from BLC or from Attributes.

Data Access Level Architecture
Data members are connected to database through Data Access Classes (DAC) by name. DACs are specified within BQL statements.
Fields from DACs represents fields from database. Attributes adds some logic how to fetch and save data to database.

No comments: