What is spring spring used to solve the problem?

Source: Internet
Author: User

what can struts and hibernate do?struts,

Control-layer Solutions in MVC

Can make request data automatic encapsulation, type conversion, file upload, data check ... such as

Hibernate,

Solutions for durable Tiers:

Can do,

Save the object to the database

The object is taken from the database

* The traditional development model

Project development based on MVC model;

The structure of Project framework based on MVC;

Entity/dao/service/action

1. Entity class

Class user{

}

2. Dao

Class userdao{

.. Access db

}

3. Service

Class userservice{

Userdao Userdao = new Userdao ();

}

4. Action

Class useraction{

UserService userservice = new UserService ();

..

Get data or results

}

User access:

/user.action----> Tomcat (Server Create action, Service, DAO

Thinking:

1. Object creation can I write to death?

2. Object creation Details

Number of objects

Action multiple "maintain member variables" action is a multi-instance

Service One "does not need to maintain public variables"

DAO one "does not need to maintain public variables"

Creation time

Action Access time created

Service startup time created

DAO starts when you create

3. Object dependencies

Action Dependent Service

Service Dependent DAO

=======================================================

Summarize:

Spring is the solution to the above problem!

In simple terms, it is the process of creating objects and the dependencies of objects!


Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

What is spring spring used to solve the problem?

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.