Seven to beginners: Terminology of Java enterprise-level applications
After learning about the related J2EE products, you need to go deep into the J2EE specifications to find out which of the following specifications
The following describes the most common specifications.
It is necessary to share some common sense before continuing.
The birth of Java
James Gosling, father of Java, graduated from CMU in his early years
After a period of development work, I accidentally encountered a project.
This project requires him to develop with C ++, but the cute JG is a genius.
There must be some inherent defects, well, or commonalities, such as laziness, impatience, and arrogance.
Since JG is a genius, it must have these commonalities. JG is so lazy that it cannot learn C ++ well.
Not only did he not learn well, but the team that developed Java didn't do well in C ++.
They were so anxious that some of them even threatened to quit the project that needed to be developed using CPP.
They are arrogant, so they decided to develop a new language to replace the damn CPP
What's more, they named the Language C ++ at the beginning -- // yes, I'm not wrong.
What is C ++ plus, subtraction, or subtraction? It means adding some good things and subtracting some bad things.
Sometimes, you may find that there is only one line between genius and dummies.
Fortunately, this lovely name has not been inherited. These days They named their product oak // oak
But when they registered the name, they found that the name was already registered.
So a female employee at Sun is very careful. This is what our company MM told me.
Under the proposal, the cute language is called Java, that is, the name of the coffee they were drinking.
So we can see that the sign of Java is a cup of hot coffee.
After learning about Java, let's talk about JavaBean // Huawei interview questions
What is JavaBean? Coffee beans
Ja, a more scientific explanation is:
Definition of reusable software components written in Java
Is it very good, isn't it? Put JavaBean into a cup // container. Do you still remember the concept of a container? Web Container and EJB container
You can brew the coffee // and compile it into coffee for the guests to taste/run.
Perfect service
Next, go to the topic and talk about containers.
I have introduced the container before. I think it is necessary to add more.
In a sense, a container is actually a runable Java-written application.
Like the. exe file generated after C ++/C Compilation
The difference is that the compiled Java file needs to be started and executed using the command line or script.
Since containers are written in Java, containers can all be cross-platform
However, it seems that most containers provide different versions for different operating systems.
However, it is certain that the porting components between the same containers do not need to be re-compiled.
Servlet Web Container Components
Specifically, servlet is the Java component running on Web containers.
Unlike normal JavaBean, Servlet defines a series of methods // such as Init () and destroy ()
For container calling, the main purpose of calling is to manage
After a request is intercepted by a Web container, the container analyzes the request address.
Then, use the ing table // web. XML in the configuration file.
Call the corresponding servlet component for processing and return the result to the client.
JSP // Java Server Page
Web Container Components
After the emergence of servlet, people found that there was almost no way to write pages in a very intuitive way.
After all, pages are written in HTML.
However, it is too difficult for us to use a stream program to teach computers how to write HTML code line by line.
In this case, JSP came into being. jsp embedded Java code into HTML code
Then it is saved as a. jsp file, and then compiled by the computer to generate a servlet for storage. // pay attention to this process.
Therefore, JSP and Servlet are actually one thing for Web containers, although they follow different standards.
This greatly simplifies the code and increases the readability of the Code, reducing production and maintenance costs.
It is worth mentioning that many ASP specifications have been used for reference in the process of formulating JSP specifications.
Those who have written ASP and are familiar with the Java language should be able to quickly master JSP
EJB // Enterprise JavaBean
EJB container Components
With the passage of time, people found that ordinary JavaBean does not seem to meet the needs of enterprise-level applications.
The most typical is the garbage collection mechanism provided by the virtual machine, that is, the GC is not complete.
There is a lot of room for optimization. In this case, EJB came into being.
EJB is the same as other components, but it follows some rules.
However, these specifications mainly aim to make full use of machines and improve performance.
A simple example
For example, a web server has 100 users connected
Because network connections are transient connections, the concurrency is not as large as 100 in many cases.
30 requests may have been sent and processed in the previous second.
In the next second, only 10 requests can be sent and processed.
Only in extreme cases can 100 requests be sent and processed at the same time.
So do we need to keep 100 so many objects in the server's memory to process these requests?
Obviously, no. Most of the time, // or even all the time, I don't believe in such extreme situations.
We only need to save 10-30%, so when 20% and 50% are required
Even 100%, this process is handed over to the container for management. This is what the EJB container is doing every day.
Manage active objects in memory
Well, it must be emphasized that due to immature use
We often mix normative terms and specific applications.
For a simple example, Servlet specifications are very likely to be used.
It may also be a specific servlet. This depends on the situation.
The same is true for EJB and JSP.
JDBC
Database Connection
Strictly speaking, this is a matter of concern to database developers.
How to connect the appserver to the database
However, developers also need to do something, because the appserver does not know when the component needs to use the database.
At the same time, developers need to tell the appserver what database they are using, IP addresses, and so on.
JDBC is the specification for this set of things.
What interfaces should database providers provide?
How should I connect to the appserver application server?
How Should developers configure these connections?
There are also some data sources, connection pools, and other concepts. Refer to the relevant data here and I will not repeat it here
Other specifications, such as JMX, are not very relevant to developers.
This type of advanced applications is only important to appserver application server vendors
It's no longer arrogant.
---------
I have heard of such a statement.
I don't know when I was a freshman, I don't know when I was a sophomore, I don't know why when I was a junior, but I knew why when I was a freshman, I didn't know anything, normally, everyone is the same
When I was a sophomore or junior, I started to get started with my knowledge. Although I still didn't understand it, I began to learn it slowly and began to accumulate it.
After a while, I know that I know it. // This is the senior of the previous statement.
Start to fart, start to drag very much, feel that you are not pregnant with talent, qianqianma is difficult to find the feeling of bole
Some people start to be jealous after their senior year and are more savvy. They start to be jealous in their junior year.
This is almost an inevitable stage for every beginner after learning for a period of time.
In any case, getting started is not a bad thing.
But in the end, everyone will know what they don't know, that is, the fourth stage of the last statement.
// The guys in the previous statement are estimated to be clear after work.
Because any discipline is profound and profound, you can understand it in two or three years.
It's not just about bragging, it's just about taking a look at the sky. So are Java, C, and C ++.
So in the seventh episode of this series, what stage should a cute reader be?
Congratulations, after reading this article, you are basically at the stage of knowing you don't know.
There is still a long way to go, because you have not learned and accumulated some basic knowledge.
However, it is not a problem for the managers of state-owned enterprises in mengmeng to cheat the layman.