Code encapsulation Format for the Servlet+jdbc+javabean development system

Source: Internet
Author: User

I gave this architecture to replace the SSH architecture for project development

Some common classes are put in the common

There are some processing of the data in DAO

Entity is actually JavaBean

The service is put in some abstract class, simply speaking, abstract class is some interface, so-called interface is only " method name, plus a semicolon ".

1  PackageCom.ll.www.mis.service;2 3 Importjava.io.IOException;4 Importjava.util.List;5 6 Importjavax.servlet.ServletException;7 Importjavax.servlet.http.HttpServletRequest;8 ImportJavax.servlet.http.HttpServletResponse;9 Ten  Public InterfaceIOrderService { One      A     Public voidSelectAll (HttpServletRequest request, httpservletresponse response)throwsservletexception, IOException; -       -     Public voidSelectbypar (HttpServletRequest request, httpservletresponse response)throwsservletexception, IOException; the     -     Public voidSave (HttpServletRequest request, httpservletresponse response)throwsservletexception, IOException; -     -     Public voidUpdate (HttpServletRequest request, httpservletresponse response)throwsservletexception, IOException; +     -     Public voidDelete (HttpServletRequest request, httpservletresponse response)throwsservletexception, IOException; +  A}
View Code

Service.imp Implement these interfaces

The servlet is similar to the action of struts in SSH.

It feels good to encapsulate the code in this architecture.


Code encapsulation Format for the Servlet+jdbc+javabean development system

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.