Interview of Struts,spring,hibernate three frames

Source: Internet
Author: User
Tags to domain

interview of Struts,spring,hibernate three frames


1.Hibernate working principle and why use? Principle: 1. Read and parse the configuration file 2. Read and parse the mapping information, create Sessionfactory 3. Open Session 4. Create transaction transation 5. Persist Operation 6. COMMIT TRANSACTION 7. Close Session 8. Why to turn off Sesstionfactory: 1. The code for JDBC access to the database is encapsulated, which greatly simplifies the tedious repetitive code of the data access layer. 2. Hibernate is a JDBC-based, mainstream persistence framework that is an excellent ORM implementation. He greatly simplifies the coding work of the DAO Layer 3. Hibernate uses the Java reflection mechanism rather than the bytecode enhancer to achieve transparency. 4. Hibernate performs very well because it is a lightweight framework. The flexibility of the mapping is excellent.   It supports a variety of relational databases, from one-to-one to many-to-many complex relationships.

2.  How does Hibernate delay loading?

1. Hibernate2 Deferred load implementation: a) collection of entity object B) (Collection)

2. Hibernate3 provides deferred loading of properties when hibernate queries the data, the data does not exist in memory, and when the program actually operates on the data, the object exists in memory, and the delay is loaded, saving the server's memory overhead.   This improves the performance of the server.

3. How do you implement relationships between classes in Hibernate? such as: one-to-many, many-to-many relationships)

The relationship between classes and classes is mainly manifested in the relationship between tables and tables, and they operate on objects, and in our program we map all the tables and classes together, through the Many-to-one, One-to-many, many-to-many in the configuration file.

4.struts1 Process:

1. The client browser makes an HTTP request. 2, according to the Web. XML configuration, the request was Actionservlet received. 3, according to the Struts-config.xml configuration, actionservlet the parameters in the request to Actionform, and then actionservlet send the request to the action for processing. 4, whether to verify, need to verify the call Actionform's Validate method, the validation fails to jump to input, success continues. 5. Action obtains data from Actionform and invokes the business method in JavaBean to process the data. 6. Action returns the Actionforward object and jumps to the corresponding JSP page or action. 7. Returns the HTTP response to the client browser.

MVC design pattern: modal: "Model" is also called business logic, is the code of the true completion of the task, quite with Javabeanview: view, is actually the display interface, equivalent to Jspcontroller: Controller, he controls the model and view of the interactive process, Equivalent to Servletstruts1 is based on the MVC design pattern hibernate is an ORM object-relational mapping

What is 5.struts?

Struts1 is an open-source Web application framework based on JSP and servlet, using the MVC design pattern struts2 is a framework based on webwork technology, a very well-equipped framework developed by Sun and WebWork. Struts2 and Struts1 have nothing to do with a whole new framework

What is 6.spring?

Spring is a hodgepodge of many third-party frameworks, the core of which is the IOC(inversion of control, also known as a dependency note

and AOP(plane-oriented programming)

What is 7.hibernate?

Hibernate is a tool for data persistence based on ORM Object Relational Mapping (the mechanism of accomplishing object data to relational data mapping) .

What is 8.JSF?

JavaServer face is a component-based Web development framework, similar to the Sturts framework

9. What are the indexes and constraints within the database?

Index is to improve the speed of data retrieval, the index is built on the data table, based on one or more fields to establish the constraints are to maintain the integrity of the data, constraints have non-null constraints, PRIMARY KEY constraints, foreign key constraints and so on.

What is 10.spring?

This problem can often be cut through why we use Spring : AOP allows developers to create non-behavioral concerns, called crosscutting concerns, and insert them into application code. With AOP, public services (such as logs, persistence, transactions, and so on) can be decomposed into facets and applied to domain objects without increasing the complexity of the object model of the domain object. IOC allows you to create an application environment where objects can be constructed, and then pass their collaboration objects to those objects. As the word inversion shows, the IOC is like the reverse JNDI. Not using a bunch of abstract factories, service locators, single elements (singleton), and direct constructs (straight construction), each object is constructed with its collaboration objects. Therefore, the collaboration object (collaborator) is managed by the container. Spring even an AOP framework, is also an IOC container. The best part of Spring is that it helps you replace objects. With Spring, you simply add dependencies (collaboration objects) with the JavaBean property and configuration file.  You can then easily replace collaboration objects with similar interfaces when you need them.

A brief description of the implementation process of STRUTS2 in its own words.

The Struts 2 framework itself can be broadly divided into 3 parts: The core controller filterdispatcher, the Business controller action, and the enterprise business logic components implemented by the user. The core controller Filterdispatcher is the foundation of the Struts 2 framework and contains the control flow and processing mechanisms within the framework. Business controller action and business logic components are required to be implemented by the user.  While developing the action and business logic components, the user also needs to write the relevant configuration files for use by the core controller filterdispatcher.

the work flow of struts 2 is simpler than struts 1 and basically the same as the webwork framework, so struts 2 is the upgraded version of WebWork. The basic brief flow is as follows: 1. The client browser makes an HTTP request. 2, according to the Web. XML configuration, the request was Filterdispatcher received. 3, according to the Struts.xml configuration, find the action class and method that need to be called, and through the IOC way, the value is injected to Aciton. 4. Action invokes the business logic component to process the business logic, which includes form validation. 5, the action is completed, according to the configuration in the Struts.xml to find the corresponding result of the return, and jump to the corresponding page. 6. Returns the HTTP response to the client browser.

Interview of Struts,spring,hibernate three frames

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.