Class vs package vs module vs component vs container vs service vs platform in the Java world

I am new to the Java world (7 years of low level C).

When I started reading sites related to Java:

I was confused by the existing terminology:

  • class
  • package
  • Module
  • component
  • container
  • services
  • framework
  • platform

I found many resources about defining terms (and much more):

but each of these resources defines them for its own purpose, and I still cannot distinguish, for example, a module from a component in the general case.

Please explain what these conditions mean in the big picture (there may be a one-class platform, how many modules are required to create a container, etc.).

+37
java java-ee terminology architecture enterprise
Oct 31 '12 at 11:56
source share
2 answers

class class is a project for creating objects in object-oriented programming based on classes; you must learn the basics of OOP and understand what an object is, what a class is, what inheritance, polymorphism, encapsulation is before you learn anything else about Java.

package A package is a namespace; this allows you to handle name conflicts. This basically allows you to have two classes named Employee if they are in different packages.

module This probably refers to the way Java libraries are distributed and used - JAR, WAR, EAR.

component Can be considered as a base GUI class in AWT (or JComponent in Swing) or can be considered as an EJB type - POJO (simple old Java object) that satisfies some requirements; it is possible to have other meanings and depends on the context.

container In an enterprise application, you obviously use some libraries and Java EE; the point in the Java EE library is that it provides an API, not an implementation. Then the application that you wrote and created is deployed to the container server, which comes with the Java EE API implementation. There are two types of containers: web containers (only for implementing web technologies) and full Java EE containers (comes with the introduction of web technologies and other Java EE technologies - naming services, persistence, transactions, etc.).

service There is no special meaning in Java. This could be due to web services, which basically provide a high-level approach to Inter Process Communication over the network.

platform In Java there is no special meaning; it can be considered as a basic development platform (Windows, Linux) or a cloud trend, which can refer to the platform as a service where the cloud provider comes with infrastructure and other basic software (OS, database, container).

+35
Oct 31 '12 at 12:08
source share
  • Grade:
    it is a regular java file that has the extension .java and contains the entire object, method or etc. that are necessary to create the application, and also implements or extends other objects or methods from another file.

  • Packing: This is a bunch of class file (.java), which is separated by their function or their name. so it also helps for naming.

  • Module: Large applications are usually built in several parts that are more tightly connected to each other than outside. Therefore, I would like to provide these parts with more access to each other than the outside world. It is also possible that these parts are reused at many points in the system without worrying about synchronizing shared data. this part is called a module in java. WAR, jar, etc. They are called modules in the Java language.

  • component: A component is an identifiable part of a larger program or design. Typically, a component provides a specific function or group of related functions. In object-oriented programming and technology of distributed objects, a component is a reusable program creation unit that can be combined with other components on the same or other computers in a distributed network to form an application. A component works in a context called a container.

  • Container: A component works in a context called a container. A container is an essential component of web applications in Java EE technology. He is responsible for maintaining individual server-side components, including Java servlets, Java server pages (JSP), and Java server faces (JSF). How the provision of services and access to them is determined by the contract, which is the agreement between the web application and the container. This provides a significant degree of security in the Java EE infrastructure because client applications are not aware of the existence of the container and therefore cannot be accessed directly. Thus, the web container is responsible for initializing the components of the web application and calling client requests for the components.

  • Services: Service is an evolution of distributed computing based on a request / response design paradigm for synchronous and asynchronous applications. The application business logic or individual functions are modular and are presented as services for consumer / client applications.

  • Structure: Frameworks imposes a specific structure on the code that uses them, while the library does not. The software in the frame contains reusable software, which forms the basis for the application. Frameworks helps programmers quickly build an application. It used to be very difficult to develop complex web applications. It is now very easy to develop such an application using various types of frameworks such as Struts, Struts 2, Hibernate, JSF, Spring, etc.

  • Platform: The platform covers the entire Java development and execution environment from Sun. Java programs are executed by the execution engine (the Java virtual machine), which is located on the target computer. Since Java contains its own operating environment, it has been called the "platform" in contrast to other programming languages, which, after compilation, run on their own. See Java, Java 2, Java Virtual Machine, and Java Runtime Environment.

+27
Oct 31 '12 at 12:35
source share



All Articles