Canigó (framework)
| Company type | Software framework |
|---|---|
| Industry | Software development, Information technology |
| Founder | Generalitat de Catalunya |
| Headquarters | Catalonia, Spain |
Area served | Generalitat de Catalunya |
| Products | Java EE framework for web application development |
Canigó is a Java EE framework created by the Generalitat de Catalunya.
Purpose and structure
Canigó functions as a unified technological platform designed to facilitate the development and deployment of web applications within the Generalitat de Catalunya’s organizational systems and departments.
Its primary features encompass:
- A consistent Java EE application structure.
- Provision of workspace, documentation, support, and maintenance for its components.
- Reduction of Java EE complexity through a standardized reference framework.
- Compliance with open source community standards.
- An open, modular architecture that supports economical software integration and interchange.
- Connectivity with Generalitat’s corporate services.
Following the Model–View–Controller (MVC) architectural pattern, Canigó separates application logic into three distinct layers—presentation, business logic, and data persistence/integration—enabling specialized teams to focus on specific development areas.
The modular design includes four transversal modules:
- Layers
- Presentation
- Business Logic
- Data Persistence/Integration
- Modules
- Core Framework
- Security
- Support
- Operation
Developers have the flexibility to incorporate only the modules they require, which are defined via interfaces to ensure implementation isolation. Canigó integrates APIs such as JPA along with open source tools like Spring and Swagger, enhancing them with reusable components.
A fundamental design principle is the separation between frontend and backend through RESTful APIs, allowing different development teams to operate independently.
Core framework architecture components
At its foundation, Canigó utilizes Spring, an open source Java framework started by Rod Johnson in 2002 (with its latest release 5.0.9 in 2018), which simplifies configuration of web applications, modular system assembly, service integration, security management, database connectivity, and transaction control. Spring facilitates unit testing by decoupling objects from their contexts and supports multiple data access technologies including JDBC, Hibernate, JPA, JDO, and iBatis.
Key elements forming Canigó’s foundation include:
- Swagger: An open source solution that aids in designing, constructing, documenting, and consuming RESTful Web APIs with automated documentation and code generation capabilities.
- Spring Framework: Serves as a centralized container for objects and services configurable through XML or annotations. Its dependency injection minimizes configuration code and encourages programming to interfaces for flexible service implementations. It also handles transaction management using Aspect Oriented Programming (AOP).
- JPA: Offers a persistence framework utilizing POJOs to map relational databases; it also supports MongoDB.
- AOP: Allows interception of events without modifying the original source code.
Framework core
This module represents the central part of the framework and includes essential functionalities such as:
- Multi-Environment Configuration: Utilizing Spring3’s PropertyPlaceholder mechanism to support environment-specific properties without requiring additional beans or configurations.
- Multi-Language Support (i18n): Enables applications to support multiple languages during development.
- Trace Service: Built upon Log4j, it controls trace levels, output destinations, formatting options, and contextual information.
- Exception Service: Supplies default exception classes (BaseException, CoreException, among others) along with an interception system designed to minimize excessive use of "try-catch" blocks.
Security module
Oversees user authentication and authorization processes to regulate application access.
- Security Module: Built on Spring Security 4.x, it manages authentication and authorization of users.
- Security Backends: Connects with systems like GICAR, SACE, LDAP, databases, and in-memory storage solutions.
Presentation (UI) module
Starting with Canigó 3.2.0, JSF was phased out. The responsibility for presentation shifted to dedicated front-end teams utilizing Angular or React frameworks.
Integration module
Facilitates efficient interaction with Generalitat de Catalunya services:
- PICA: A Java API enabling synchronous and asynchronous communication with the 'Plataforma d'Integració i Col·laboració Administrativa'.
- GECAT: Provides capabilities for managing invoices through SAP services.
- PSIS: Offers digital signature and certificate functionalities via Catcert.
- SARCAT: Supplies methods to interact with S@rcat services using WebServices and FTP/SFTP.
- Documentum: Supports operations such as document filing, retrieval, folder handling, and metadata management.
- NT: Acts as a connector that streamlines telematic notifications within Generalitat de Catalunya.
- Antivirus: Integrates the file scanning system from CTTI.
- SAP: Delivers a simplified interface to access the Generalitat’s SAP backend systems.
- Webservices: Lacks a native module; recommended tools include Spring WS, Jaxb, and OXM for exporting, publishing, and consuming web services.
- Queues: No built-in queue management; suggests using Spring JMS along with provided guidelines for message processing.
Persistence module
This component handles data storage and retrieval between applications and database management systems.
- JPA: The Java Persistence API standardizes ORM implementations. Canigó 3 employs Hibernate as its default JPA provider. Spring Data JPA facilitates creating Spring applications with repositories based on JPA.
- MongoDB: Offers seamless integration with the MongoDB document-oriented database through Spring Data MongoDB.
Support module
Provides supplementary framework functionalities including:
- File Transfers: Enables servers to accept file uploads via HTML forms.
- Mail notification: Allows sending emails in plain text or HTML formats to multiple recipients, supporting attachments as well.
- Task Planner: Uses Spring combined with Quartz to schedule deferred task execution.
- OLE: Handles MS Excel and Word OLE documents for creation, reading, and editing by leveraging the POI library.
- Merging: Performs document merging in WordML format by substituting tagged variables with dictionary entries.
- SFTP: Supports secure file transfers between servers using JSCH and Commons-VFS libraries.
Operations module
Equips applications to produce execution data for monitoring and analysis purposes:
- Instrumentation: Generates metrics such as query counts and error statistics derived from application runtime.
- Monitoring: Provides a user interface for accessing instrumentation metrics.
- Logging: Controls log appenders including their activation, deactivation, level adjustments, and enables real-time log visualization through WebSockets.