I was wondering if there exists such thing as Java SE MVC framework. I've been confused about Hibernate and Spring, these 2 framworks are for Java EE web applications and i like to program in Java SE (Core) and was wondering if there exists MVC framework for it or if anyone can give a tutorial link how to build one in Java SE.
-
Spring is an MVC web framework. In the other hand, Hibernate is not an MVC framework nor even a web framework, is a data access framework and can be used in Java SE applications as well (yes, you can use Hibernate in a console application too). – Luiggi Mendoza Oct 08 '12 at 02:00
-
But how is Hibernate different if its not MVC, it has some built in functions that can be used? – Giorgi Oct 08 '12 at 02:02
-
when would you use hibernate and when would you not, i mean for what kind of applications would you use hibernate? – Giorgi Oct 08 '12 at 02:03
-
can you do a Google and gain some basic understanding on what these two frameworks actually is, before asking here? – Adrian Shum Oct 08 '12 at 02:09
-
i did google search but could not find anything to the question when would you use hibernate framework. i do have basic understanding what they do – Giorgi Oct 08 '12 at 02:10
-
Two articles to read: [Java SE Application Design With MVC](http://www.oracle.com/technetwork/articles/javase/mvc-136693.html) and [MVC Pattern in Java Swing?](http://stackoverflow.com/q/2529217/1065197). Pretty easy to look on google by the way. You need to practice your google searching skills :). – Luiggi Mendoza Oct 08 '12 at 02:12
-
See also this [example](http://stackoverflow.com/a/3072979/230513). – trashgod Oct 08 '12 at 02:18
1 Answers
Hibernate is an ORM Framework that maps objects to tables in a relational database. From the Hibernate Documentation:
Hibernate is an Object/Relational Mapping solution for Java environments. The term Object/Relational Mapping refers to the technique of mapping data between an object model representation to a relational data model representation. See http://en.wikipedia.org/wiki/Object-relational_mapping for a good high-level discussion.
Hibernate takes care of the mapping from Java classes to database tables, and from Java data types to SQL data types. In addition, it provides data query and retrieval facilities. It can significantly reduce development time otherwise spent with manual data handling in SQL and JDBC. Hibernate’s design goal is to relieve the developer from 95% of common data persistence-related programming tasks by eliminating the need for manual, hand-crafted data processing using SQL and JDBC. However, unlike many other persistence solutions, Hibernate does not hide the power of SQL from you and guarantees that your investment in relational technology and knowledge is as valid as always.
Spring MVC is a request-based framework that adheres to the MVC architecture. You can read more about it in the Spring MVC Documentation. I'd also recommend checking out the Spring in Action, 3rd Edition book to learn about the Spring Framework and Spring MVC.

- 2,048
- 18
- 14
-
3I don't understand how can this be an answer for OP question without explaining **MVC framework in Java SE**. – Luiggi Mendoza Oct 08 '12 at 02:20
-
Note that while hibernate itself is not JavaEE, it has the capability of acting as a JPA Entity Manager, which makes it JavaEE compliant. – Matt Oct 08 '12 at 02:42