What is XXX

Source: Internet
Author: User

1. What is the framework?

A set of framework-wide sets of programs that contain a series of best practices to solve a problem in one area.

When we use a framework, we actually load a series of jar packages into the classpath path, actually getting all the additional support for the JDK in the jar.

That is , the framework is just a jar package, which is essentially an extension of the functionality of the JDK in order to solve a domain problem.

  Best practices: In fact, countless programmers have, after countless attempts, summed up specific methods of dealing with specific problems.

2. Is it a three-tier architecture?

From the macroscopic point of view, the most important one of the web development pattern is the layered development pattern , which will be divided vertically according to the function responsibility of the whole program.

A more typical partitioning method is to divide the program into: the presentation layer, the business layer, and the persistence layer, the so-called three-tier architecture.

Presentation layer: Handles functions related to interface interaction.

Business layer: Responsible for complex business logic calculations and judgments. For example: Some validation work: ① does not allow a specified string to be entered in a text box

② data format is correct and data type validation

③ the legality of user rights and so on.

Persistence layer: Responsible for persisting storage of business logic data.

The persistence layer serves the business logic layer, and the business logic layer operates on the object, and the database is the relational database.

The persistence layer masks the tables and fields and turns them into objects to pass to our business layer.

  Struts2 is the frame of the presentation layer

Spring is the framework of the business layer

Hibernate is the framework of the persistence layer

3. What's the MVC pattern?

MVC is a design pattern that makes it mandatory to separate the input, processing, and output of an application. Using MVC, the application is divided into three core parts : The model, the attempt, the controller. They each deal with their respective tasks.

Views: The interface that the user sees and interacts with.

Model: Maintain data and provide data access methods. is the processing of business processes and the designation of business rules.

The process of processing a business process is a black box for other layers, and the model receives the data requested by the view and returns the results of the processing. The model is the core of MVC.

Controller: Receives the user's input and invokes the model and view to complete the user's requirements.

Therefore, when you click a hyperlink in a Web page and send an HTML form, the controller itself does not output anything and any processing. It simply receives the request and decides which model component is called to process the returned data.

    

1) The most important point of the MVC pattern is that multiple views can share a model. Whether your users want a flash interface or a WAP interface, they can handle it with a single model. Since you have separated the data and business rules from the presentation tier, you can maximize the reuse of your code.

2) The data returned by the model is not formatted, so the same artifacts can be used by different interfaces.

3) Because the model is self-contained and detached from the controller and view, it is easy to change the data layer and business rules of your application. Such as: you want to transfer your database from MySQL to Oracle, you only need to change the model.

4. What's the servlet?

a component specification that Sun provides for extending Web server functionality.

In order for the Web server to work with the two different software systems of the Web application , it is first important for a mediator to develop a standard interface for Web applications to collaborate with the Web server. Interface .

Sun not only developed a set of standard Java interfaces (collectively known as the Java Servlet API) that Web applications work in collaboration with Web servers.

It also provides a specification for some details of Web server publishing running Web applications. Sun has collectively referred to this series of standard Java interfaces and protocols as servlet specifications.

  The most common use is to extend the functionality of the Web server.

① provides program code that can be dynamically loaded and executed by the server, providing services for requests from clients.

②servlet is written entirely in the Java language, so the server that needs to run the servlet must support the Java language.

The ③servlet is fully running on the server, so it does not depend on the browser. Regardless of whether the browser supports Java, you can request access to the server-side servlet.

5. What is JSP

Java Servlet page (Java server-side pages technology), Sun company developed a server-side dynamic page generation technology specifications. Because it is too cumbersome to produce dynamic pages using Servlets, it is not conducive to code maintenance.

Therefore, it is more convenient to use JSP when generating dynamic pages. Because the JSP component is mainly HTML and a small amount of Java code,

If it is HTML you can write it directly without having to use out, println to generate the page.

JSP execution Process:

The ①.jsp file is converted to a. java file by the JSP engine, which is a standard servlet.

② then compiles the converted. java file into a bytecode file.

③ calls the service () method.

6, what's the Ajax

Asynchronous JavaScript and XML (asynchronous JavaScript and XML).

is to solve the traditional Web application (you must click the "Submit" button, the browser will send the request to the server.)

Also, the browser will destroy the previous page before sending the request;

At this point, the user can only wait for the server to return a new page and cannot do anything else.

After the server returns a new page, the browser will be re-parsed to generate the appropriate interface. A technique created by the drawbacks of the request-wait-request

The essence of this technology is: using a special object built into the browser XMLHttpRequest asynchronously send a request to the server (that is, the browser will not destroy the previous page, the user can still continue to operate), the server returns processing results (not the entire page, Only part of the data), and then use that processing result to update some of the pages. The entire process, the page does not refresh, does not interrupt the user's operation, the user's experience is better than the traditional Web application.

  Illustration shows:

    

1) The Ajax engine (that is, the XMLHttpRequest object), first registers a listener for the object (the listener is an event handler that listens for state change events (ReadyStateChange))

2) When the user has done something to the GUI (will produce corresponding events, such as focus loss event, etc.)

3) Once the corresponding event is generated, the event handling code will be triggered

4) When executing event-handling code, the AJAX engine (XMLHttpRequest object) is invoked

5) send request : After the Ajax engine is called, it will send a request (independent of the browser) to the server to continue other operations : While the AJAX engine sends the request, the user can continue to do other things to the GUI on the browser side. Asynchronous request when the request is sent (the Ajax engine sends the request without interrupting the user's action)

6) The server's Web Component team requests processing

7) The server may call into the database or the Java class that processes the business logic

8) The server processes the result response to (returning only part of the data that can make XML or text) to the Ajax engine

9) Listener Gets response data (XML or text) through the Ajax engine

10) The listener updates the data in the GUI (partial update, not the entire page refresh)

  Most of the process is implemented by JS, the response data may be XML(and later Json and other technologies), so Ajax can be seen as a fusion of multiple technologies.

7, what's the JavaScript

  JavaScript is a scripting language developed by Netscape that executes on the browser side.

HTML is just a markup language that describes the appearance of a Web page, without the ability to compute, judge,

If all the calculations, judgments (such as determining whether the text box is empty, determine whether the password is consistent two times) are placed on the server side of the execution, the page will be very slow, it is very difficult to use, the pressure on the server is very large,

Therefore, it is required to perform some simple operations such as operation and judgment in the browser .

JavaScript is an interpreted language that can run at any time without compiling, even if there are errors in the syntax, and the parts that do not have syntax errors can run correctly.

8, what's the CSS

CSS is casecading stylesheet (cascading style sheets, also known as Style stylesheets), which provide a form of expression for a Web page (it is used for web-style design).

9. What's the JDBC?

  JDBC (Java Data Base Connectivity,java database connection) is a Java API for executing SQL statements that can provide a variety of relational databases with the c6> Unified Access.

JDBC is the interface (or specification, standard) that Sun has designed to access the SQL database, and the JDBC drivers are provided by database software vendors and third-party software vendors ,

Therefore, depending on the database system that is used for programming, the required drivers are different.

    

10. What is Hibernate

Hibernate is an open-source ORM(Object Relation Mapping, objects- relational mapping ) framework,

It has a lightweight object encapsulation of JDBC , which allows Java programmers to manipulate the database at will using object Programming thinking . Hibernate can be applied to any use of JDBC.

Hibernate has a total of 5 core interfaces: Session, sessionfactory, Transaction, query, and configuration. These 5 core interfaces will be used in any development.

Through these interfaces, not only the persistent objects are accessed, but also can be transaction control. These five core interfaces are described separately below.


· Session interface: The session interface is responsible for performing crud operations on persisted objects (the task of crud is to complete the communication with the database, including many common SQL statements) . However, it is important to note that the session object is non-thread-safe. at the same time, Hibernate's session differs from the HttpSession in JSP applications. When the term "session" is used, it is actually referring to the session in Hibernate, and later the Httpsesion object is called the user session.
  · Sessionfactory interface: The Sessionfactory interface is responsible for initializing hibernate. It acts as a proxy for the data storage source and is responsible for creating session objects. The factory model is used here. It is important to note that Sessionfactory is not lightweight, because in general, a project typically requires only one sessionfactory, and when you need to manipulate multiple databases, you can specify a sessionfactory for each database.
· Configuration interface: The configuration interface is responsible for configuring and starting Hibernate, creating Sessionfactory objects. during Hibernate startup, the instance of the configuration class first locates the map document location, reads the configuration, and then creates the Sessionfactory object.
· Transaction Interface : The Transaction interface is responsible for transaction-related operations. It is optional, and developers can also design their own underlying transaction-processing code.
· Query and Criteria interface: query and Criteria interfaces are responsible for executing various database queries. It can be expressed in either the HQL language or the SQL statement.

11, what matter sping

  Spring is an open source controlled inversion (inversion of control,IoC) and aspect-oriented (AOP) container framework, whose main purpose is to simplify enterprise development.

What is XXX

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.