Classic code extraction in a Java Web project

Source: Internet
Author: User

Objective:

As we all know, the most in project development is nothing more than adding and deleting (CRUD) operations. Since the development of the SSH framework, the development and development process of the domestic Web project has become more and more flexible; This paper makes a simple extraction of the business layer code in the project development for the reference of the industry friends.

The code extraction schematic diagram is as follows:


This figure mainly shows the development of 2 business, account management and category management, the specific code implementation is relatively simple not attached. From the above UML diagram we only need to abstract out the Baseservice interface and implement the Baseserviceimpl class, the implementation of the other services are inherited Baseserviceimpl and the corresponding interface can be implemented;
Some friends may wonder, why do I have to implement my own corresponding Xxservice interface after inheriting the basic Baseserviceimpl?
Imagine that our different business is not necessarily only the basic CRUD operations, or the same method name, but its own business is more special, with different parameters of business methods. Based on this, we must also realize the interface of our business.

( note : For the above UML diagram understanding barriers to friends can refer to this blog earlier about UML diagram introduction)

Classic code extraction in a Java Web project

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.