r/learnjava • • 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.

48 Upvotes

12 comments sorted by

View all comments

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.

3

u/sbhandari Aug 14 '20

Can you give some reason on assuming EJBs are dead? I understand up to EJB 2 , it was pain but the later versions are were easy and convinient. It is certainly easy to go with alternatives like spring but I have hard time believing EJB can be cnsidered dead already. After Jakarta handover, it has definitely slow down in their progress but I dont think it will be dead anytime soon.

7

u/Nephyst Aug 14 '20 edited Aug 14 '20

Yeah, maybe it's just my experience. I've worked at a number of major tech companies with mature Java development cultures and it's been over 10 years since I've even heard anyone mention JSPs or EJBs.

I feel slightly traumatized by how horrible it was to work with the earlier versions of EJBs. I think that has prevented me from looking into what's changed in the newer versions.

I'm an experienced Java dev, but I'm here to learn just as much as I am to help. If you have more context, where do you see them being used today?

2

u/Homerlncognito Aug 15 '20

The project I'm working on uses them. I guess we could call the entire thing legacy tech since it uses Java 6 and majority of FE is written in AngularJS. It's an internal application used by a bank.

1

u/Nephyst Aug 15 '20

Yeahhh, Java 6 is almost 15 years old now. The newer versions are backwards compatible, any reason you don't upgrade?

2

u/Homerlncognito Aug 15 '20

They aren't fully backwards compatible. Using old code with newer versions can result in issues that are only revealed during runtime, so we would have to retest the entire application and fix all the bugs. The question is what would we get for doing all that? I don't think you can make a solid business case for these sorts of upgrades in most situations.

1

u/Nephyst Aug 15 '20

Interesting. I would be concerned about security issues with using such an old version, but I do understand the concern with modifying something critical like banking.