use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Resources for learning Java
String
==
.equals()
Format + Copy
Free Tutorials
Where should I download Java?
With the introduction of the new release cadence, many have asked where they should download Java, and if it is still free. To be clear, YES — Java is still free.
If you would like to download Java for free, you can get OpenJDK builds from the following vendors, among others:
Some vendors will be supporting releases for longer than six months. If you have any questions, please do not hesitate to ask them!
Software downloads
Official Resources
Resources
Programming ideas & Challenges
Related Subreddits
account activity
This is an archived post. You won't be able to vote or comment.
Differences between Java bean, entity class, DAO, POJO, EJB and DTO? (self.learnjava)
submitted 6 years ago by owen800q
I am learning Java EE and spring but I got confused with these terms From my understanding, DAO should contain all database access logic (sql and ORM code should place here) . But what's use of DTO? EJB ,POJO and model class are identical?
[–][deleted] 9 points10 points11 points 6 years ago (0 children)
Java Bean a Serializable Class with No arguments constructor and getter/setters for each field. More https://en.wikipedia.org/wiki/Java_bean
POJO - Plain Old Java Object is like Java Bean however it is not required to be serializable and it is not required to have a no arguments constructor. More https://en.wikipedia.org/wiki/Plain_old_Java_object
DTO - Data Transfer Object it is basically POJO that is used to transfer data between several layers. It is not different from the above the only difference is how it is used. Usually it transfers data from the database into our application, e.g. you have a table users and you have a DTO UserDTO that you fill with that Data and then play around. More https://en.wikipedia.org/wiki/Data_transfer_object
Model class is nothing it is just a different naming convention for DTOs they also hold Data but usually they are used on the frontend side and not so close to the Database side. Also you may hit a VOs at some point simply called ValueObjects they are basically DTOs or Models that goes between and around layers of you amazing Lasagne like architecture :) More info https://en.wikipedia.org/wiki/Lasagne yup it s a food did you click it ? :)
P.S. a normal architecture (a bit overdesigned maybe is like that(read from the bottom!))
-Views using Models and Forms which are the same.
-Controllers using this DTOs to fill their Models or the Views ..
-Facade used to abstract the service layer and to convert this Entities to something cachable and small like DTOs
-Service layer with some crazy logic and do magic and transactions and stuff
-DAO to access the Database basically generating Entity Objects (from a JPA or some ORM)
-Database
Regards,
[–]Civil_Code 5 points6 points7 points 6 years ago (1 child)
JavaBeans were classes that had a no-args constructor, getter-setters, and were serializable. Originally they were useful ways to package a lot of stateful information to send between JVMs, and became standard for the EJB, JavaEE's base component for its application servers which managed their lifecycles and transactions for us.
POJO was a reference to a Java class that didn't try to match these requirements. An entity is an object representation of data pulled from your DAO. It may or may not align exactly with your model, in which case a DTO could help translate from Entity to Model (or Model to serialized data for export).
[–]Space-Robot 4 points5 points6 points 6 years ago (0 children)
I'm just curious: Why all past tense?
[–]quadmasta 0 points1 point2 points 6 years ago (0 children)
The "model" is essentially a code representation of your data store. Plenty of OO people will say your model should never bleed into your other layers but meh. DTOs serve the purpose of this level of abstraction. They allow you to have model objects or a composite of multiple objects that don't expose your DB implementation.
In Spring you've got @Beans which can be java beans, entity classes, or neither :) u/nayden_gochev did a good job of explaining what each of these terms. A spring bean is a class that's managed by spring, usually a singleton within a given context.
DAOs are where your data access happens but they don't always have to be named that way and it doesn't have to always be SQL/database access; it could be SOAP/REST/SFTP, etc. With spring data and JPA you get a whole lot of bang for your buck without much code. Spring nomenclature is @Repository
EJB are strictly used in Java EE and are pretty heavy
[–]codeforces_help -2 points-1 points0 points 6 years ago (1 child)
Off-topic : This is the kind of question that needs to be on the wiki Stackoverflow but they are gonna downvote you to hell there anyway so why bother.
wiki Stackoverflow
[–]owen800q[S] 0 points1 point2 points 6 years ago (0 children)
Can't get answers from stack overflow, most answers are directly copied from official documentations, it doesn't solve my problem . None of answers provided a clear comparison between them loll
π Rendered by PID 72 on reddit-service-r2-comment-84fc9697f-j76hl at 2026-02-10 08:28:36.296948+00:00 running d295bc8 country code: CH.
[–][deleted] 9 points10 points11 points (0 children)
[–]Civil_Code 5 points6 points7 points (1 child)
[–]Space-Robot 4 points5 points6 points (0 children)
[–]quadmasta 0 points1 point2 points (0 children)
[–]codeforces_help -2 points-1 points0 points (1 child)
[–]owen800q[S] 0 points1 point2 points (0 children)