r/learnjava • u/nomorerice01 • Aug 14 '20
What's the difference between web application and enterprise application? What applications can I make in JavaEE that does not use web applications or websites?
Upon reading, I learned that web application executes in a web container such as Tomcat while enterprise is in the EJB server with extra functionality which also communicates to the web container.
However, I am still confused. I can create a website using JavaEE than jsp&servlets. Then why used JavaEE over web applications? Let's say, I will create an eCommerce site using JavaEE. The web container will be my view and all the logic behind it will be put in an EJB server. Even though, I can use JSP and servlet or put everything (view and logic) inside the web container I still choose JavaEE. Then what are the benefits if I used JavaEE than JSP?
What else can I make in the JavaEE that is not a website or desktop application communicating to an enterprise server?
I'm sorry. I just can't seem to understand. Please anyone give me a very clear explanation.
7
u/MrGooglr Aug 14 '20
Enterprise application is also a web application which follows EE standard. An Enterprise web application is more than just serving frontend pages and executing server side logic. With Enterprise web applications, we try to achieve most performance specific changes. Database pooling and in memory data grids just works better in EE environment than in normal web container. You’re right that EE server internally contains the web container (servlet and jsp container), but if we are going to build a web application that want to use all the EE specifications it’s better to opt for EE application methodology for better overall performance.
3
u/natnit555 Aug 14 '20 edited Aug 14 '20
From here:
https://en.wikipedia.org/wiki/Enterprise_software -> https://www.perlmonks.org/?node_id=504043
I'm citing the definition there:
Look again at that middle quote. Does anyone recognize that? It's from the Perl 5 Enterprise Environment (p5ee) documentation. I didn't realize its source as I was reading it. Curiously, p5ee actually laid out a definition of what it considers "enterprise software" to be.
Availability - the assurance that a service/resource is always accessible
Scalability - the ability to support the required quality of service as the load increases
Reliability - the assurance of the integrity and consistency of the application and all of its transactions. The ability to provide a required reliability service level depends on the close coordination of the hardware, networking, operating system, storage subsystem, application framework, and application software.
Security - the ability to allow access to application functions and data to some users and deny them to others
Interoperability - the ability of the system to share data with external systems and interface to external systems.
Leveragability - the ability that stored data, programmed logic, and other system resources available anywhere in the enterprise should be accessible from everywhere in the enterprise
Maintainability - the ability to correct flaws in the existing functionality without impacting other components/systems
Extensibility - the ability to add/modify functionality without impacting existing functionality
Manageability - the ability to manage the system in order to ensure the continued health of a system with respect to scalability, reliability, availability, performance, and security.
Portability - the ability of the software to run on a variety of hardware and operating system configurations
Accessibility - the ability to access system functions through different user agents and in different human languages
That's why the same simple create/update/delete page that probably only few lines in python Flask framework, but once you pull whole bunch requirements of Enterprise Software as mentioned above, it gets fairly complex, and you'll need these kind of "container" (JavaEE). These requirements are what the JavaEE covers. And that's why it is huge.
Sorry if the eplanation is very imprecise.
What applications can I make in JavaEE that does not use web applications or websites?
An example is middleware application that process messages in asynchronous fashion (https://en.wikipedia.org/wiki/Jakarta_Messaging)
1
Aug 14 '20
I assume you are using web container as a synonym for servlet container.
You can have services communicate from one server to another.
As an example:
Think about a weather service that calls two other sepatate services: the temperature forecast service and the rain forecast service, and combines both responses into 1.
19
u/Nephyst Aug 14 '20 edited Aug 14 '20
A lot of the examples you use are honestly outdated and not really used much anymore.
JSPs are used for server side rendering of HTML. This was important when computers were slow, but today it's massively more common to use something like react or angular to render HTML on the front end.
EJBs are also dead. They were overly complex and solved a problem no one really had while adding a ton of extra issues. They were generally horrible to work with. Today it's much simpler to just use REST APIs to accomplish the same thing.
Unless you are trying to get a job supporting legacy applications there isn't much reason to learn j2ee. I think the parts that are still relevant (jdbc/jpa) are also in j2se.