-
Notifications
You must be signed in to change notification settings - Fork 15
Motivation
Yong Zhu edited this page Mar 12, 2018
·
2 revisions
- There is a problem with the architecture and the invention of the wheel is repeated. Other persistence layers usually try to provide a basket solution, but the development of modules does not make the code reusable. For example, tools such as Hibernate, MyBatis, jFinal, NutzDao, BeetlSql, and JdbcTemplate all face the problem of how to deal with cross-database development. Their approach is either to develop a set of dialect tools from start to finish, or simply to not support database dialects. There is no result of borrowing other tools, nor does it consider sharing their results with other tools.
- Being too paranoid about a technology and trying to solve all problems with a hammer. For example, Hibernate and JPA object design is excessive, bloated and complex. MyBatis's XML configuration is cumbersome, trying to solve all the problems with the configuration, did not provide CRUD method (with plug-ins to provide ActiveRecord and other functions, but it is not as good as designed from the beginning to be native support). JdbcTemplate and DbUtils focus on the underlying SQL, inconvenient to maintain. jFinal and Nutz are bundled sales and do not separate the persistence layer.
- Does not support dynamic configuration. From database tables to Java objects, called ORM, this needs to be configured. However, these common persistence tools do not support dynamic configuration, which is a disadvantage for applications that require dynamic generation or modification of configurations. For example, JPA annotations or XML-configured entity beans make it difficult to change foreign key relationships and database table mappings during run-time.
- Modular design. jSqlBox divides Jdbc tools, transactions, database dialects and other functions into sub-modules, which are implemented by different sub-projects. Each sub-project can be separated from jSqlBox and even used by other ORM tools to avoid reinventing the wheel. At the same time, various submodules of jSqlBox have borrowed other mature projects during development. For example, the dialect module (jDialects) extracts Hibernate's 70 dialects. Transaction modules (jTranscations) are compatible with Spring transactions while providing simplified version declarative transactions. The Jdbc tool (jDbPro) is based on Apache Commons DbUtils (hereinafter referred to as DbUtils), and the introduction of chain styles and templates was inspired by jFinal and BeetlSql, respectively.
- Compatible with DbUtils, projects based on DbUtils can be seamlessly upgraded to jSqlBox and enjoy the advanced features provided by jSqlBox such as cross-database development, paging, templates, JPA annotation support, database script generation, and ActiveRecord style.
- Supports many SQL writing ways. Thanks to the modular architecture design, jSqlBox from the bottom of the JDBC to the latest type of NoSQL-style query, is currently the most sustained support for SQL writing persistence tools.
- The learning curve is smooth and maintainable. The jSqlBox kernel only has ~30 classes. It is mainly responsible for integrating each sub-module and object map. Dialect, database access and other functions are allocated to the sub-module to achieve. Modular design brings the benefits of modular learning, as long as you understand the function of each module, you can quickly grasp the use of jSqlBox. In the most extreme case, DbUtils users can learn jSqlBox without learning.
- A number of technical innovations, such as Inline style, dynamic configuration, Java multi-line text support, ActiveRecord and SqlMapper joined, NoSQL automatic cross-layer query, and tree structure query.
- Sessionless design, which can be used anywhere DataSource or Connection is present. It can be used as a stand-alone persistence layer or as a plug-in for other persistence tools. It is a real lightweight tool.
- It's maybe the only persistent layer tool that supports a variety of database script generation (DDL) functions in addition to Hibernate.
The birth time is short, the users are few, and the bugs in the architecture and code are not completely exposed and eliminated. It's not mature enough.