Interview with smart development framework jeecg author Zhang daihao

Source: Internet
Author: User

Jeecg (J2EE code generation) is an intelligent development framework based on code generators. It uses code generation + manual merge semi-intelligent development mode to help you solve 50% of repetitive work in Java projects, this allows you to focus more on business logic.

Google Code: http://code.google.com/p/jeecg/
Jeecg Forum: http://bbs.minsoft.cn/
Online Demo: http://www.saphao.com: 8080/
Demo Video: http://pan.baidu.com/share/link? Consumer id = 162605 & UK = 2668473880

In order to give you a better understanding of jeecg, We have interviewed jeecg author Zhang daihao.

You are welcome to recommend more open-source projects to us to support the development of open-source projects in China. If you and your team wish to demonstrate their entrepreneurial ideas and interesting things, or some friends are creating such value, please contact us, mail to blog@csdn.com.

Let's introduce myself first!

My name is Zhang daihao, And My English name is Scott. He belongs to the north float family. He has been engaged in finance and Java Development for Japan since his graduation in. He worked in Tokyo for a while. He is currently engaged in ABAP development and Java Development in a heavy industry company.



My blog: csdn blog and iteye blog

My mailbox: zhangdaiscott@163.com

What is jeecg? What functions are available?

Jeecg is called J2EE code generation, which is the J2EE code generator. This is a code generator-based J2EE smart development framework. The Web architecture is based on the zero-configuration idea and uses the SSH2 + easyui technical architecture. The latest jeecg version is 2.1.0.

Jeecg purpose:Improve development efficiency and code quality, and build a rapid development platform.

Jeecg can effectively solve information silos and generate unified code, standards, and design ideas. on this platform, you can quickly develop efficient and high-quality code and shorten the development cycle, reduce project costs.

Jeecg details: http://www.iteye.com/news/26937

The main functions of jeecg are as follows (* represents the innovation of jeecg):

  • (*) Well-encapsulated basic modules: User Permissions + Data Dictionary + common encapsulation (scheduled tasks, SMS interfaces, email sending, Excel export, etc );
  • (*) Code Generator: The development efficiency is very high. The single-table data model and one-to-many (parent-child table) data model are automatically generated for addition, deletion, modification, and query. This function is directly used;
  • (*) Query condition generator: the query function is automatically generated, and SQL append query conditions are dynamically spelled in the background. Multiple matching modes (full match/fuzzy query/include query/unmatched query) are supported );
  • (*) Form checker on the page: The easyui verification mechanism is used, and the Form validation generator is automatically generated (required input, digit verification, amount verification, and time control );
  • (*) Integrated easy report: highcharts image report and data export are very convenient, and PDF, Excel, Word, and other reports can be generated extremely conveniently.
  • Common encapsulation (Data Dictionary/Email sending/scheduled task/SMS interface/freemarker tool class)
  • Compatible with IE 6, IE 8 +, Google, and other browsers
  • Supports mainstream databases such as SQL Server, Oracle, and MySQL

What is the original intention of developing this framework? Isn't this an SSH2 framework?

Java Development started in. When I first joined the work, I also liked to pursue new technologies. I felt that I could improve my abilities. Later I liked to study the underlying architecture and studied many technical architectures, I also tried to rewrite struts1 and spring. However, as I have been working for a long time, I gradually find that the research technology and the research architecture are of little significance. The new Java technologies are constantly updated. For projects, it is critical to improve development efficiency and code quality. So in the project, I began to pay attention to the extraction of common, design specifications, and encapsulation tools.

A very clever opportunity, my friend asked me, there are a lot of code generators now. Do you think you can encapsulate one in the framework? I tried to write it. Web UI has never been used before. easyui is said to be good, so I tried to use it. During the writing process, I found that it is highly versatile, I started to use the template language to generate pages. Later, jeecg was gradually developed.

Jeecg is actually the SSH2 + easyui framework that everyone is familiar with, but it is encapsulated, the Code Generator, automatic form verification generation, query condition generator, graphical report encapsulation, and common encapsulation functions are added. Currently, the encapsulated functions can basically meet the needs of general projects.

Currently, the workflow is being integrated ......

How is jeecg designed? Technology used?

First, let's introduce several predecessors:
Reference

  1. Ten years ago, the development of such code generation tools was very popular, but it soon went out. Because the software is not furniture. The software is not a one-time production cost, but a change and maintenance cost.
  2. In that year, I used python to spit out the Python code to the memory and then execute the Python code. After a while, I found that the Code could not be maintained and I had to write it again.
  3. Generating a large amount of code is not necessarily a good thing. In many cases, the team is constrained by the limitations of such tools.

Summary:Relying solely on the code generator is not feasible, and maintenance is a big problem. Therefore, I have introduced the semi-intelligent development mode of code generation + manual merge by drawing on the experience of my predecessors., That is:

  • Basic functions (add, delete, modify, and query of common data models) are generated and used by the code generator. The generated code can be modified at will;
  • Complex business logic is implemented independently by developers, so that the development team is not bound by the code generator, and can flexibly implement complex businesses and respond to business changes in a timely manner.

In addition, jeecg adopts the mainstream SSH2 + easyui technology, and the generated code is neat and tidy, easy to understand. The generated code directory structure is clear and the maintenance cost is low.

Design Philosophy:

  • Jeecg adopts mainstream architecture technologies and is superior to the configuration based on conventions. It adopts naming conventions to achieve zero configuration and automatically scans the entire project action and service to the sring container;
  • The jeecg framework has low dependence on code generators and can be used completely out of the Code Generator (this design avoids the development team from being bound by code tools ).

Technology Adoption:

  • Architecture Technology: struts2 + spring3 + hibernate4 + easyui1.3 + spring JDBC + jquery
  • Development Environment: myeclipse6.5 + jdk1.6 + tomcat6.0

What do you think of this (automatically generated code) development model? Advantages and disadvantages for developers?


As the Web UI framework (easyui/jquery UI/extjs/dwz) Gradually matures, the system interface is gradually unified, and the code generator can also generate a unified and standardized interface! Code Generation + manual merge semi-intelligent development will be a new trend. The generated code can save 50% of the workload and quickly improve development efficiency !!!

Objectively speaking, the jeecg development model has both advantages and disadvantages.:

Benefit:

  • This frees developers from mechanically repetitive and boring work, focuses more on business logic implementation, and improves the development experience.
  • It improves development efficiency, achieves rapid development, and shortens the project cycle.
  • Users who are new to Java can also quickly build a system based on this framework (as long as a table is created and code is generated through the table)
  • Generate unified code, standardize, and design ideas for easy maintenance
  • The open-source architecture combination is highly decoupled and can be completely separated from the jeecg Code Generator for flexible and independent development. (If mature and intelligent products are used, project development cannot be separated from intelligent development tools and the dependency is too large, high change and maintenance costs)

Disadvantages:

  • For new developers, there are many disadvantages. When new developers develop their coding capabilities, Automatic Code Generation weakens the skills of developers.

Which codes can be automatically generated using jeecg? What is the principle?

The jeecg code generator can generate unified background code (such as action, service, Dao, entity, and page) for front-end pages, page form checksum, and standard ).

The jeecg code generator generates code through a table to implement the Code. That is, read the table structure and field attributes, and generate corresponding entities, background code, front-end pages, and form verification.

Principles and methods for generating jeecg code:

  • Generate code based on the table, and generate functional code for the table relation model with rules;
  • The generated code does not have a configuration file and follows the naming conventions. based on the idea that the constraints are greater than the configuration zero;
  • The generated action, service, entity, JSP pages and other naming rules are consistent (using the camper method), and the code structure is clear and easy to maintain;
  • For complex business logic, you need to encode and implement it yourself. In this way, the complex business is constantly changing, and intelligent mature products are difficult to adapt to business changes and maintenance difficulties.

Currently, the jeecg code generator supports the following data models:

  • Single Table Data Model
  • One-to-multiple table (parent-child table) Data Model
  • Single Table data (auto-join) Model

Did you develop jeecg independently or have a team?

Currently, jeecg is one of me, and many of my friends want to join us. We should gradually set up a team in the future.

What is the Open Source protocol used in this project? What are the restrictions on the basic development framework of commercial projects?

Jeecg adopts the apache2.0 protocol and has no restrictions on commercial use.

If you are interested in jeecg, how can you communicate, feedback, and contribute?

Jeecg is currently released using Google Code, address: http://code.google.com/p/jeecg/

SVN address: SVN: // www.oksvn.com/jeecg-jbpm

Jeecg has already opened a technical forum. If you have good suggestions for jeecg or find bugs, you can post on the forum.

Forum address: http://www.jeecg.org/

In addition, you can also exchange and feedback through QQ groups (106259349 and 289782002.

Future development plan?

The future development of jeecg is mainly in two directions:

  • One is tool-based and universal implementation of the jeecg code generator;
  • One is to continue encapsulating the current framework and build a rapid development platform;

Direction 1: [Tool-based design solution for jeecg code generator]

Objectives:

  • The jeecg code generator is extracted from the framework to implement the flexible combination of struts2, spring MVC, hibernate, mybatis, easyui, dwz, extjs, and other technologies, import the jeecg jar support and template to generate the corresponding code;
  • The jeecg module supports custom templates. Similar to the QQ space template, you can customize templates of different styles according to the jeecg rules.

Method of use: import the jeecg-generate.jar to the project, load the jeecg template, and you can generate code through the tool class.

The expected functions of the jeecg module are described as follows:

A, Jeecg-generate.jar Function:

1. Support for different databases
2. Read the table structure [field attribute]
3. generate code based on the template;

Design principle:

  1. Jeecg-generate.jar, extracted from the framework, so that compatibility is friendly
  2. Jeecg-generate.jar achieves decoupling design, realize flexible combination of struts2, spring MVC, hibernate, mybatis, easyui, dwz, extjs, etc.

B, Jeecg FTL Template

Multiple templates are provided, and different templates are provided for different architecture technologies, such:

  • Struts2 + spring + hibernate + easyui;
  • Struts2 + spring + mybatis + easyui;
  • Spring MVC + hibernate + freemarker + dwz
  • Spring MVC + hibernate + freemarker + extjs

Features: templates can be customized by users. You only need to follow the jeecg rules to create templates of different styles.

CTable Relationship Model

1. Single Table Data Model
2. Self-connection data model
3. One-to-many (parent-child table) Data Model
4. One table in the one-to-multiple data model is self-join.
5. Multi-to-multi-data model
6. One table in the many-to-many data model is self-join.

D. generate code

Generated Content: front-end page + form verification (mandatory, number, amount, Time Control) + background code + background verification Acton \ servicei \ serviceimpl \ Page \ entity \ Dao \ JSP

Direction 2: [jeecg intelligent development platform]
 
Five points to be improved in the future:
 
1. Further improvement of the jeecg Generator
2. workflow Encapsulation
3. Smart report Encapsulation
4. query filter Encapsulation
5. Smart encapsulation of peripheral interfaces

Design Scheme:
 

  • [Generator] Code Generator (one-click code generation), which can be used flexibly in combination with struts2, spring MVC, hibernate, and mybatis.
  • [Generator] page generated by the code generator. You can drag and drop the page field control and re-layout it.
  • [Workflow] business flows are implemented using workflows.
  • Features: ensures flexible and variable business processes, clear logic design, and easy log monitoring (business process changes allow business personnel to draw a process, which is both flexible and easy to monitor)
  • [Workflow] implements the workflow painting function at the page layer, removing development from workflow work and supporting custom processes.
  • [Workflow] supports user-defined forms
  • [Report] intelligent report tool encapsulation. Note: developers do not need to participate in the Development. Sales staff can directly configure and use it (only write SQL)
  • [Query condition generator] Further encapsulate query and filter rules. Page query function: append a query field to the page. No code is required in the background, and the query conditions are automatically completed. append: greater than or equal to other matching methods. Further encapsulate the page query control, implement a control for each matching method so that users can directly enter the content without worrying about the matching method (that is, encapsulate matching rules to enhance the user experience)
  • [Peripheral interface] the WebService interface is used for configuration. solution: it is implemented using a unique interface, and the incoming and outgoing packets are implemented using the message method. The packet Parsing is automatically converted, and the format of incoming and outgoing packets is configurable; interface validation customization. (Description: an interface function is implemented through configuration to achieve the goal of no encoding)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.