Difference between revisions of "DRAFT SDMX-CORE"

From FMR Knowledge Base
Jump to navigation Jump to search
(Java Packages)
(Java Packages)
Line 64: Line 64:
 
  '''service''' (or rest) - web service entry points
 
  '''service''' (or rest) - web service entry points
 
  '''util''' - utility classes, typically containing public static methods
 
  '''util''' - utility classes, typically containing public static methods
 +
 +
The general logical flow of a system is the following
 +
 +
service --> manager --> engine
 +
                    --> dao
 +
 +
The service (web service entry point) is a thin layer which collects the request arguments, with miniumal manipulation, and passes them to the respective Service Interface. The implementation of this Service Interface will create an apporpriate model object (or objects) which contain a consolidated collection of arguements, some validation of arguments can be performed at this point, and then pass these to the manager Interface.  The manager will ensure the arguments are valid and the user has permission to perform the action.  The manager then provides the workflow required to fulfil the task, by makking calls to engines, daos.
 +
 +
= High Level Design =
 +
 +
==[https://en.wikipedia.org/wiki/Inversion_of_control Inversion of Control] (IoC)==
 +
 +
IoC is achieved by assigning all implementation classes to Interfaces.  Each

Revision as of 05:37, 24 July 2023

Architectire

Modules

The sdmx-io modules are as follows

Interface Modules

These modules contains Java Interfaces only, no Java classes. The sdmx-io framework uses Interfaces over implementation classes in order to achieve loose coupling.

fusion-api  - contains generic Interfaces that are unrelated to SDMX. Each package in this project is broken down by function, i.e audit, cache, date, email, exception
fusion-api-dao - contains Interface definitions for database persistence, not coupled to database platform, but all based on storeage and retrieval of Java Objects
fusion-api-sdmx - contains Interfaces for SDMX Information model (SdmxBeans and related), high level Interfaces for SDMX related functions which cross mulitple modules
fusion-api-service - contains Interfaces definitions for web services to use - allowing projects the implement web service entry points to not require web service depdenancies

Implementation Modules

These modules contain Java classes which are core to SDMX, they implement Interfaces in the higher api modules

fusion-sdmx-im - contains the implementation code for the SDMX Information Model (SdmxBeans and related structures such as Codelists, Concepts, etc)
fusion-core-data - contains code to read/write data and generic data related features such as determining series/obs, validation, temporary data stores
fusion-core-sdmx - contains core code for structural metadata, including temporary store, cross reference resolution, contains some data and reference metadata features 
fusion-core-structure - contains core code for processing structural metadata 
fusion-core-xlsx - contains code to read and write structures and data in Excel 

Format Modules

These modules contains Java classes for reading and writing SDMX Structureal Metadata, Reference Metadata, and Data

fusion-sdmx-csv - reading and writing SDMX-CSV format
fusion-sdmx-edi - reading and writing SDMX-EDI format
fusion-sdmx-json - reading and writing SDMX-JSON format
fusion-sdmx-ml reading and writing SDMX-XML

Feature Modules

These modules provide feature specific code

fusion-core-dao - contains generic DAO implementations for storing and querying for objects, not coupled to a specific object store, but we use hibernate, mongodb is also an option
fusion-audit - audit events and centralised error handling
fusion-sdmx-kafka - connecting to and sending/recieving messages to Apache Kafka
fusion-sdmx-publication - SDMX Publication Tables: SdmxBean implementations, and buisness logic to materilise table based on definition
fusion-sdmx-reporttemplate - Reporting Templates: SdmxBean implementations, and buisness logic to genearte excel workbook from template definition, reading data from workbooks
fusion-sdmx-rest - SDMX web services, and additional web service implementations from APIs defined in fusion-api-service
fusion-sdmx-search - Lucene search engine for structures
fusion-sdmx-security - authentication against LDAP/AD/Fusion Security - contains user definition (SecurityDetailsImpl)
fusion-xl - exposes web services required by the FusionXL Excel Pluin

Utility Modules

Utility classes, typically public static classes, the utils projects may organise code by function rather then using the generic packaging structure (api, engine, manager, model, ...)

fusion-utils - generic utility classes, not specific to SDMX
fusion-utils-hibernate - implementation code to use Hibernate as a means to connect to the DAO
fusion-utils-http - calling HTTP web services
fusion-utils-json - JSON related utility classes
fusion-utils-mail - email utiliity classes
fusion-utils-mongodb  - implementation code to use MongoDB a means to store Objects
fusion-utils-sdmx - SDMX Specific utilty classes
fusion-utils-spring - spring related utility classes
fusion-utils-xlsx - reading/writing Excel workbooks related utility classes

Java Packages

Each module is partitioned into Java packages, with the exception of the utility modules, which typically seperate code by its function.

The generic packages are as follows.

api - contains interfaces relevent to the module 
constant - contains Java enums and java classes that contain public static constants
engine - classes that 'do the work', many are stateless singletons, there are also stateful for example DataReader/WriterEngine 
factory - singleton classes that are responisble for generating an engine, typically called by a manager class, factories enable new features to be plugged into the framework
filter  - REST web service filters (defined in web.xml) - filters are called before the web service
manager - the main entry point for all high level functions, the manager's job is to veryify the request (i.e. a security check) and manage the process of fulfiliing the request by delegating the work to an engine or a DAO, a manager should be a fairly thin layer
model - data transfer objects 
service (or rest) - web service entry points
util - utility classes, typically containing public static methods

The general logical flow of a system is the following

service --> manager --> engine
                    --> dao

The service (web service entry point) is a thin layer which collects the request arguments, with miniumal manipulation, and passes them to the respective Service Interface. The implementation of this Service Interface will create an apporpriate model object (or objects) which contain a consolidated collection of arguements, some validation of arguments can be performed at this point, and then pass these to the manager Interface. The manager will ensure the arguments are valid and the user has permission to perform the action. The manager then provides the workflow required to fulfil the task, by makking calls to engines, daos.

High Level Design

Inversion of Control (IoC)

IoC is achieved by assigning all implementation classes to Interfaces. Each