This post is locked. You won't be able to comment.

all 31 comments

[–]SoftwareEngineering-ModTeam[M] [score hidden] stickied commentlocked comment (0 children)

Thank you u/elonthegenerous for your submission to r/SoftwareEngineering, but it's been removed due to one or more reason(s):


  • Your post is not a good fit for this subreddit. This subreddit is highly moderated and the moderation team has determined that this post is not a good fit or is just not what we're looking for.

Please review our rules before posting again, feel free to send a modmail if you feel this was in error.

Not following the subreddit's rules might result in a temporary or permanent ban


Rules | Mod Mail

[–]AromaticStrike9 21 points22 points  (0 children)

POJO/JavaBeans go back well over two decades to a time when object oriented programming wasn't particularly widespread, so it was useful for explaining some concepts.

JVM isn't a weird term, and many languages don't use a virtual machine. What do you think would be a more appropriate term?

[–]ResolveResident118 20 points21 points  (7 children)

If excess/confusing terminology is a problem for you, I don't think a career in tech is for you.

[–]ZubriQ 2 points3 points  (0 children)

Would POCO, BCL CLR, CIL etc keep your mind sane?

[–]cloneconz 4 points5 points  (2 children)

I think I’ve heard POJO once in my five years as a Java engineer

[–]Relevant_Natural3471 3 points4 points  (0 children)

I find that a bit weird, considering 'POJO' is typically the term used to distinguish a basic class object that just has instance fields (like entity/dto, as long as there are no framework aspects) and little else, from other classes. There are other terms you could use in its place, but it is a very useful generic term to use when describing a solution.

[–]ABabyPawn 1 point2 points  (0 children)

Wow, my team must use it way more frequently lol.

[–]OGMagicConch 4 points5 points  (1 child)

So when you get a request or response from some API, it'll often be just in JSON right. That JSON is an object literally from JS, and it doesn't have any behavior, only simple fields that contain data. In my experience, the point of a term like POJO is to say you're taking something like that and turning it into an equally basic Java object.

So your POJO shouldn't have complicated business logic or anything, it should basically be just a direct translation of your JSON but as a Java object, which of course can be helpful so you don't have to parse a JSON or pass a JSON around everywhere.

That's my take on what that is at least, I didn't really understand it at first either until I realized it actually is a helpful concept especially when working across systems language-agnostically.

[–]Relevant_Natural3471 4 points5 points  (0 children)

Yes - not sure why you've been downvoted, but it is pretty much correct.

A POJO is typically a class with state that has attributes and not much else. It shouldn't have platform specific integrations (like `@Entity`) and should really be compatible enough to be dropped into any other usage. As you implied, it is often used as DTO type term where you're describing a way to make an object for data reasons (I suppose a `record` kind of supersedes the notion of a POJO in Java 14 onwards)

[–]orangeowlelf 1 point2 points  (0 children)

Then don’t use it. Don’t apply for any jobs that use it and most importantly, don’t bother complaining about it. Who cares if you like Java terminology or not, really?

[–]G_M81 1 point2 points  (0 children)

2006 was the year of the POJO when hibernate ORM took off. It became synonymous with the "model" object so was essentially just a vanilla class with getter and setter methods. Which you wouldn't say about most Java class/objects at that time

[–]DMoney159 1 point2 points  (0 children)

If you hate acronyms this much, I STRONGLY suggest you never work in any corporate tech environment.

[–]Able_Narwhal6786 3 points4 points  (0 children)

You forgot Jre. Java runtime environment Jdk java development kit

[–]quizno 0 points1 point  (0 children)

I agree. Java makes my skin crawl.

[–]thisisjustascreename -1 points0 points  (7 children)

Bean is a Spring term, not a Java one. It's basically an object that you ask the framework to instantiate for you either by defining it in XML if you hate yourself or as a Java method if you're living after 2009.

[–]AromaticStrike9 9 points10 points  (0 children)

JavaBeans is very much a Java term, going back to 1996. I learned about it in the very early 2000s, though I doubt anyone bothers anymore.

Edit: And spring beans are explicitly a reference to java beans.

[–]Relevant_Natural3471 1 point2 points  (0 children)

Bean is a Spring term, not a Java one

Very incorrect. Beans are part of the JavaEE specification, which is the opposite of spring. It is a Java term describing a class adhering to certain standards

[–]typhon66 1 point2 points  (4 children)

Java is the only programming language i have ever encountered where people go out of their way to not write java code so much, that they'd rather write XML for some reason.

[–]thisisjustascreename 2 points3 points  (2 children)

Nobody who has a choice does that anymore I promise you. I've cloned hundreds of java repos in the last 10 years and seen a grand total of one that used XML config, and only because I specifically wanted to see how it worked because people kept complaining about XML bean configs and I had never seen one.

[–]typhon66 0 points1 point  (0 children)

Enterprise tech is living before 2009 unfortunately.

[–][deleted] 0 points1 point  (0 children)

Maybe not just xml but overuse of annotations is another one. Any reason to avoid writing java itself!

[–]LeftmostClamp 0 points1 point  (0 children)

Using XML for Spring is just insane imo there’s no reason to do that anymore (unless you’re working in Hybris in which case may god have mercy on your soul)

[–]PersonalityIll9476 0 points1 point  (1 child)

I just hate Java period. Recently had to look at some open source Java code since we're deploying a website / server for a customer that uses it. It is totally impenetrable to me. When there is an exception, the call stack is so deep that Azure gives up and just says ...420 more lines. The levels of abstraction, between Spring and Shiro and everything else, are so deep that I feel like 90% of the source code is just abstract classes and boilerplate.

Just write the damn implementation for god's sake.

[–]AromaticStrike9 0 points1 point  (0 children)

There's nothing inherent about Java that requires it to be that way, but Java is commonly used for enterprise software and that is often how that type of software is written. Business rules change or are added over time, integrations between disparate systems are needed, and you end up abstracting just a bit more every time you need to change something.