Overview
YMP is a very simple and easy-to-use lightweight JAVA application development framework. The design principles mainly focus on simplifying work tasks and standardizing the development process. Improving development efficiency and making development work as easy as building blocks is our unremitting goal!
Main technical features
Adopts componentized and modular packaging methods, can be assembled on demand, and is flexible and scalable;
Use microkernel to implement Autoscan, AOP, IoC, Event, etc., covering most of the core functions in the SSH framework;
Unified configuration architecture, experience different file resource configuration and management Mode;
Integrate multiple log systems (log4j, jcl, slf4j), log files can be stored separately;
Lightweight persistence Layer encapsulation, providing support for RDBMS (MySQL, SQLServer, Oracle, etc.) and NoSQL (MongoDB, Redis, etc.); Points;
Unique independent service development experience;
Powerful verification framework, completely based on Java annotations, easy to use and expand;
Flexible cache service, supports EhCache, Redis and multi-level cache (MultiLevel) technology;
Simple MVC architecture to configure, powerful and easy Maintenance and expansion, supports RESTful style, supports JSP, HTML, Binary, Freemarker, Velocity and other view technologies;
Modules and functions
Framework Core (Core ) Mainly responsible for the initialization of the framework, the loading of modules and their life cycle management. The functions include:
Class Object Manager: Provides automatic scanning of package classes and Bean Features such as life cycle management, dependency injection and method interception; Event service: triggers and monitors event actions through event registration and broadcasting, and supports both synchronous and asynchronous mode execution of event queues;Through a simple directory structure, the unified management of various file resources such as configuration can be realized during the project development and maintenance process, providing a flexible, simple and effective way for modular development and deployment. solution:
- Module: It is the basic form of encapsulation of all functional features of the YMP framework and is responsible for the life cycle management of the module;
- International Resource Manager: Provides unified resource file loading, destruction and content reading, and supports customization Event monitoring for resource loading and language changes;
- In addition, a set of custom data structures and various tool classes required in the framework are provided;
- Configuration system (Configuration)
- Standardize modular development process and unified resource file management;
- Have the advantages of effective resource reuse and flexible system integration construction, deployment, data backup and migration;
- Simple configuration file retrieval, loading and management mode;
- Resource sharing between modules, modules can share resource files such as configuration, classes and jar packages of the project they belong to;
- Supports XML and Properties configuration by default File parsing, you can customize the file format through the IConfigurationProvider interface, support caching, and avoid repeated loading;
- Configuration objects support annotation declaration, and the configuration content can be automatically loaded and filled into class objects without coding;
- The construction and distribution of integrated modules, the start and stop of services*, and the clear resource file classification structure can be quickly located;
Log (Log)
Based on the open source log framework Log4J 2 implementation, it provides unified management of logger objects. Any logger can be called at any location to output logs, realizing the separation of system and business logs, and targeting the apache-commons-logging log framework and The slf4j log system provides support;
Persistence
JDBC
A simple set of data access for relational database (RDBMS) The solution mainly focuses on the efficiency, ease of use and transparency of data access. It has the following functional characteristics:
- Based on the JDBC framework API for lightweight encapsulation, the structure is simple and easy to develop, debug and maintain. ;
- Optimize batch data update, standardized result set, pre-compiled SQL statement processing;
- Support single entity ORM operation, no need to write SQL statements;
- Provide scaffolding tools, fast Generate data entity classes and support chain calls;
- Supports customizing SQL statements through memory annotations or loading SQL from configuration files and automatically executing it;
- Supports automatic assembly of result sets and value objects , supports custom assembly rules;
- Supports multiple data sources, supports C3P0, DBCP, JNDI connection pool configuration by default, supports data source expansion;
- Supports multiple databases (such as: Oracle, MySQL , SQLServer, etc.);
- Supports object-oriented database query encapsulation, which helps reduce or reduce program compilation errors;
- Supports database transaction nesting;
- Supports database Stored procedure*;
MongoDB
Based on the characteristics of MongoDB's data access operations, it is simply encapsulated based on the design idea of the JDBC module and uses the session mechanism. Supports multi-data source configuration and entity operations, object-based query, MapReduce, GridFS, aggregation and function expression integration, etc. It still needs further improvement and improvement, and the documentation is being compiled, so stay tuned...
Redis
is based on the Jedis driver package, uses a session mechanism, and supports multiple data sources and connection pool configurations. It still needs further improvement and improvement. The documentation is being compiled, so stay tuned...
Plugin(Plugin)
Use an independent ClassLoader class loader to manage private JAR packages, classes, resource files, etc. The design goal is to carry out the requirements in the interface development mode More fine-grained splitting to achieve an ideal encapsulation form of reusable code;
Each plug-in is a closed world, and the only way to communicate between the plug-in and the outside world is through business interface calls and management The containers of these plug-ins are called plug-in factories, which are responsible for plug-in analysis, loading and initialization, as well as plug-in life cycle management. The plug-in module supports the creation of multiple plug-in factory instances. The factory objects are completely independent and have no dependencies;
Service(Serv)
A set of communication service framework based on NIO, providing client and server encapsulation of TCP and UDP protocols, flexible message monitoring and messaging Content encoding/decoding and simple configuration make secondary development more convenient;
also provides service support such as disconnection reconnection and link maintenance (heartbeat) by default. You only need to understand the business to easily complete the development work. .
Validation
Server-side parameter validity verification tool uses annotation declaration to configure verification rules, which is simpler, more intuitive, and more friendly, and supports method parameters and class member attribute verification, supports internationalized I18N resource binding of verification results, supports custom validators, and supports multiple verification modes;
Cache
Using EhCache as the default JVM in-process cache service, it implements a lightweight cache framework for multi-level caching (MultiLevel) by integrating external Redis services, and is deeply integrated with the YMP framework (supports caching for class methods, and can cache based on method parameter values) ), flexible configuration, easy to use and expand;
WebMVC framework
The WebMVC module is another very important module in the YMP framework in addition to the JDBC module. Integrating many features of the YMP framework, it still maintains a consistent simple style in the design and use of functional structures. It also inherits the genes of the mainstream MVC framework. For developers who understand and are familiar with SSH and other framework technologies, it is extremely easy to get started. Easy and no learning cost.
Its main functional features are as follows:
- Standard MVC implementation, clear structure, simple configuration based entirely on annotations;
- Supports agreement mode, no need to write controller code , directly matches and executes the view;
- Supports multiple view technologies (JSP, Freemarker, Velocity, Text, HTML, JSON, Binary, Forward, Redirect, HttpStatus, etc.);
- Supports RESTful mode and URL style;
- Supports automatic binding of request parameters and controller method parameters;
- Supports parameter validity verification;
- Supports interception of controller methods;
- Support annotation configuration controller request routing mapping;
- Support automatic scanning of controller classes and registration;
- Support custom processing of events and exceptions;
- Support I18N resource internationalization;
- Supports controller methods and view caching;
- Supports controller parameter escaping;
- Supports plug-in extensions;
Based on the open source log framework Log4J 2 implementation, it provides unified management of logger objects. Any logger can be called at any location to output logs, realizing the separation of system and business logs, and targeting the apache-commons-logging log framework and The slf4j log system provides support;
A simple set of data access for relational database (RDBMS) The solution mainly focuses on the efficiency, ease of use and transparency of data access. It has the following functional characteristics:
- Based on the JDBC framework API for lightweight encapsulation, the structure is simple and easy to develop, debug and maintain. ;
- Optimize batch data update, standardized result set, pre-compiled SQL statement processing;
- Support single entity ORM operation, no need to write SQL statements;
- Provide scaffolding tools, fast Generate data entity classes and support chain calls;
- Supports customizing SQL statements through memory annotations or loading SQL from configuration files and automatically executing it;
- Supports automatic assembly of result sets and value objects , supports custom assembly rules;
- Supports multiple data sources, supports C3P0, DBCP, JNDI connection pool configuration by default, supports data source expansion;
- Supports multiple databases (such as: Oracle, MySQL , SQLServer, etc.);
- Supports object-oriented database query encapsulation, which helps reduce or reduce program compilation errors;
- Supports database transaction nesting;
- Supports database Stored procedure*;
Based on the characteristics of MongoDB's data access operations, it is simply encapsulated based on the design idea of the JDBC module and uses the session mechanism. Supports multi-data source configuration and entity operations, object-based query, MapReduce, GridFS, aggregation and function expression integration, etc. It still needs further improvement and improvement, and the documentation is being compiled, so stay tuned...
is based on the Jedis driver package, uses a session mechanism, and supports multiple data sources and connection pool configurations. It still needs further improvement and improvement. The documentation is being compiled, so stay tuned...
Use an independent ClassLoader class loader to manage private JAR packages, classes, resource files, etc. The design goal is to carry out the requirements in the interface development mode More fine-grained splitting to achieve an ideal encapsulation form of reusable code;
Each plug-in is a closed world, and the only way to communicate between the plug-in and the outside world is through business interface calls and management The containers of these plug-ins are called plug-in factories, which are responsible for plug-in analysis, loading and initialization, as well as plug-in life cycle management. The plug-in module supports the creation of multiple plug-in factory instances. The factory objects are completely independent and have no dependencies;
A set of communication service framework based on NIO, providing client and server encapsulation of TCP and UDP protocols, flexible message monitoring and messaging Content encoding/decoding and simple configuration make secondary development more convenient;
also provides service support such as disconnection reconnection and link maintenance (heartbeat) by default. You only need to understand the business to easily complete the development work. .
Server-side parameter validity verification tool uses annotation declaration to configure verification rules, which is simpler, more intuitive, and more friendly, and supports method parameters and class member attribute verification, supports internationalized I18N resource binding of verification results, supports custom validators, and supports multiple verification modes;
Using EhCache as the default JVM in-process cache service, it implements a lightweight cache framework for multi-level caching (MultiLevel) by integrating external Redis services, and is deeply integrated with the YMP framework (supports caching for class methods, and can cache based on method parameter values) ), flexible configuration, easy to use and expand;
The WebMVC module is another very important module in the YMP framework in addition to the JDBC module. Integrating many features of the YMP framework, it still maintains a consistent simple style in the design and use of functional structures. It also inherits the genes of the mainstream MVC framework. For developers who understand and are familiar with SSH and other framework technologies, it is extremely easy to get started. Easy and no learning cost.
Its main functional features are as follows:
- Standard MVC implementation, clear structure, simple configuration based entirely on annotations;
- Supports agreement mode, no need to write controller code , directly matches and executes the view;
- Supports multiple view technologies (JSP, Freemarker, Velocity, Text, HTML, JSON, Binary, Forward, Redirect, HttpStatus, etc.);
- Supports RESTful mode and URL style;
- Supports automatic binding of request parameters and controller method parameters;
- Supports parameter validity verification;
- Supports interception of controller methods;
- Support annotation configuration controller request routing mapping;
- Support automatic scanning of controller classes and registration;
- Support custom processing of events and exceptions;
- Support I18N resource internationalization;
- Supports controller methods and view caching;
- Supports controller parameter escaping;
- Supports plug-in extensions;
One More Thing
YMP not only provides a convenient and rapid development experience for Web and other Java projects, but will also continue to provide more rich practical project experience.
Interested friends can join the official QQ group 480374360 to communicate and learn together and help YMP grow!
To learn more about the YMP framework, please visit the official website: http://www.ymate.net/