Java术语

http://mattryall.net/blog/2008/06/java-technobabble-explained

总结: JRE包含了JVM和程序跑起来需要的类;  JDK包含了Java编译器和一些实现的API和JRE;

            JSE和JEE感觉像是Sun公司定义的标准,有specification。

JVM: Java Virtual Machine

JVM is the piece of software that runs a Java application. All Java software runs "in" or "on" a JVM. All JVMs provide the same environment for your application to run in, which allows a Java application to run on Windows, Linux, Mac and many other platforms.  Sun develops the most popular JVM implementation and provides it for Windows, Linux and Solaris. The JVM for Mac OS X is developed by Apple. BEA and IBM have implementations of the JVM, and there are a few minor open source ones.

JRE: Java Runtime Environment

JRE means an implementation of the JVM and all the other stuff you need to run a Java application. You might hear people say "the Sun JRE" or "the BEA JRockit JRE" in reference to this.

JSE: Java Platform, Standard Edition

 As mentioned above, JVM provides the same environment that Java applications can be run on different platforms. This environment is called the Java Platform, Standard Edition (JSE), or informally, the JDK. It consists of a framework of about 3700 classes. These classes must be implemented according to this specification in every JDK. Sun defines this specification.

The Java Platform, or JDK, has evolved over time so there are several versions of it. The latest major version is JSE 6 or JDK 6. Our applications are mostly written against either version 1.4 or 5, which are both still supported by Sun.

JDK: Java Development Kit

 As originally defined, the Java Development Kit (JDK) is actually a combination of Java compilation tools and API implementation for a particular version of the Java Platform. It also typically includes a Java runtime (JRE), so that you can run the programs you compile.

JEE/J2EE: Java Enterprise Edition, formerly Java 2 Enterprise Edition, is a collection of APIs which aren't included in the standard JDK but provide functionality which is useful for many server applications. One example is JavaMail, which is a standard way of accessing email from Java. This isn't available with the standard JDK, but Sun has provided a standard API and implementation for people to use in Java applications.

 "JEE application servers" or just "application servers": provide implementations of many of the JEE standards. For example,most important to Atlassian applications are the Java Servlet API, the Java Transaction API and the data source APIs in JEE. 

Java Bean:

https://stackoverflow.com/questions/3295496/what-is-a-javabean-exactly

A JavaBean is just a standard:

  1. All properties private (use getters/setters)
  2. A public no-argument constructor
  3. Implements Serializable.

That's it. It's just a convention. Lots of libraries depend on it though.

With respect to Serializable, from the API documentation:

Serializability of a class is enabled by the class implementing the java.io.Serializable interface. Classes that do not implement this interface will not have any of their state serialized or deserialized. All subtypes of a serializable class are themselves serializable. The serialization interface has no methods or fields and serves only to identify the semantics of being serializable.

In other words, serializable objects can be written to streams, and hence files, object databases, anything really.

Also, there is no syntactic difference between a JavaBean and another class -- a class defines a JavaBean if it follows the standards.

There is a term for it because the standard allows libraries to programmatically do things with class instances you define in a predefined way. For example, if a library wants to stream any object you pass into it, it knows it can because your object is serializable (assuming the lib requires your objects be proper JavaBeans).

EJB: Enterprise JavaBean

EJB是sun的JavaEE服务器端组件模型,设计目标与核心应用是部署分布式应用程序。简单来说就是把已经编写好的程序(即:类)打包放在服务器上执行。凭借java跨平台的优势,用EJB技术部署的分布式系统可以不限于特定的平台。EJB 是J2EE(JEE)的一部分,定义了一个用于开发基于组件的企业多重应用程序的标准。其特点包括网络服务支持和核心开发工具(SDK)。 在J2EE里,Enterprise Java Beans(EJB)称为Java 企业Bean,是Java的核心代码,分别是会话Bean(Session Bean),实体Bean(Entity Bean)和消息驱动Bean(MessageDriven Bean)。在EJB3.0推出以后,实体Bean被单独分了出来,形成了新的规范JPA。

Spring:

Spring是一个轻量级控制反转(IoC)和面向切面(AOP)的容器框架。Spring框架是由于软件开发的复杂性而创建的。Spring使用的是基本的JavaBean来完成以前只可能由EJB完成的事情。然而,Spring的用途不仅仅限于服务器端的开发。从简单性、可测试性和松耦合性角度而言,绝大部分Java应用都可以从Spring中受益。

◆目的:解决企业应用开发的复杂性

◆功能:使用基本的JavaBean代替EJB,并提供了更多的企业应用功能

◆范围:任何Java应用

Spring的一个简单应用场景详细分析:https://blog.csdn.net/ymr0717/article/details/51891109/ 

JEE框架Spring详细简介

https://blog.csdn.net/qq_22583741/article/details/79589910#43%E5%85%A8%E8%87%AA%E5%8A%A8

Spring MVC和boot 转自https://www.jianshu.com/p/42620a0a2c33

Spring MVC是Spring的一部分,Spring 出来以后,大家觉得很好用,于是按照这种模式设计了一个 MVC框架(一些用Spring 解耦的组件),主要用于开发WEB应用和网络接口,它是Spring的一个模块,通过Dispatcher Servlet, ModelAndView 和 View Resolver,让应用开发变得很容易。

Spring boot:初期的Spring通过代码加配置的形式为项目提供了良好的灵活性和扩展性,但随着Spring越来越庞大,其配置文件也越来越繁琐,太多复杂的xml文件也一直是Spring被人诟病的地方,特别是近些年其他简洁的WEB方案层出不穷,如基于Python或Node.Js,几行代码就能实现一个WEB服务器,对比起来,大家渐渐觉得Spring那一套太过繁琐,此时,Spring社区推出了Spring Boot,它的目的在于实现自动配置,降低项目搭建的复杂度。

https://www.jianshu.com/p/42620a0a2c33
 

Jar包:

JAR文件的全称是Java Archive File,意思就是Java档案文件。通常JAR文件是一种压缩文件,与常见的ZIP压缩文件兼容。JAR文件与zip文件的区别就是在JAR文件中默认包含了一个名为META-INF/MANIFEST.MF的清单文件,这个清单文件是在生成JAR文件时系统自动创建的。

当开发了一个应用程序后,这个应用程序包含了很多类,如果需要把这个应用程序提供给别人使用,通常会将这些类文件打包成一个JAR文件,把这个JAR文件提供给别人使用。只要别人在系统的CLASSPATH环境变量中添加这个JAR文件,则Java虚拟机就可以自动在内存中解压这个JAR包,把这个JAR文件当成一个路径,在这个路径中查找所于晓的类或宝层次对应的路径结构。

使用JAR文件有以下好处:

1. 安全。能够对JAR文件进行数字签名,只让能够识别数字签名的用户使用里面的东西。
2. 加快下载速度。在网上使用applet时,如果存在多个文件而不打包,为了能够把每个文件都下载到客户端,需要为每个文件单独建立一个HTTP连接,这是非常耗时的工作。将这些文件压缩成一个JAR包,只要建立一个http连接就能够一次下载所有的文件。
3. 压缩。使文件变小,JAR的压缩机制和zip完全相同
4. 包封装。能够让JAR包里面的文件依赖于统一版本的类文件。
5. 一致性。JAR包作为内嵌在Java平台内部处理的标准,能够在各种平台上直接使用。


JAR包可以有一个特殊的/META-INF/MANIFEST.MF文件来指定Main-Class。把一个JAR文件添加到系统的classpath环境变量中后,Java将会把这个JAR文件当成一个路径来处理。JAR文件通常使用jar命令压缩而成,当使用jar命令压缩生成JAR文件时,可以把一个或者多个路径全部压缩成一个JAR文件。

War包:

Web Application Archive,  War包是一个可以直接运行的web模块,通常用于网站,打成War包部署到容器中。以Tomcat来说,将war包放置在其\webapps\目录下,然后启动Tomcat,这个包就会自动解压,就相当于发布了。War包是Sun提出的一种web应用程序格式,与jar类似,是很多文件的压缩包。war包中的文件按照一定目录结构来组织。根据其根目录下包含有html和jsp文件,或者包含有这两种文件的目录,另外还有WEB-INF目录。通常在WEB-INF目录下含有一个web.xml文件和一个classes目录,web.xml是这个应用的配置文件,而classes目录下则包含编译好的servlet类和jsp,或者servlet所依赖的其他类(如JavaBean)。通常这些所依赖的类也可以打包成jar包放在WEB-INF下的lib目录下。

JEE Security, Apache Shrio, Sprint security 对比

https://www.novatec-gmbh.de/en/blog/java-ee-security-framework-comparison/

Servlet:

Servlet是sun公司提供的一门用于开发动态web资源的技术。
  Sun公司在其API中提供了一个servlet接口,用户若想用发一个动态web资源(即开发一个Java程序向浏览器输出数据),需要完成以下2个步骤:
  1、编写一个Java类,实现servlet接口。
  2、把开发好的Java类部署到web服务器中。
  按照一种约定俗成的称呼习惯,通常我们也把实现了servlet接口的java程序,称之为Servlet

Java Servlet API 是Servlet容器(tomcat)和servlet之间的接口,它定义了serlvet的各种方法,还定义了Servlet容器传送给Servlet的对象类,其中最重要的就是ServletRequest和ServletResponse。所以说我们在编写servlet时,需要实现Servlet接口,按照其规范进行操作。

Tomcat 是Web应用服务器,是一个Servlet/JSP容器. Tomcat 作为Servlet容器,负责处理客户请求,把请求传送给Servlet,并将Servlet的响应传送回给客户.而Servlet是一种运行在支持Java语言的服务器上的组件. Servlet最常见的用途是扩展Java Web服务器功能,提供非常安全的,可移植的,易于使用的CGI替代品. (CGI: 通用网关接口Common Gateway Interface)是一种技术,可以让一个客户端,从浏览器向执行在服务器上的程序请求数据。CGI描述了服务器和请求处理程序之间传输数据的一种标准。)

发布了87 篇原创文章 · 获赞 64 · 访问量 25万+

猜你喜欢

转载自blog.csdn.net/wqfhenanxc/article/details/86650617