Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

I want implement a Swing/Hibernate application  RSS feed

 
Bill Ant
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hello,

i want implement a Swing application that use Hibernate for persisting objects of domain...

What pattern I do see?
Naturally, I divise application in Model, View and Contro (MVC)...

I do appy Observer pattern: best documentation? source code?
 
Pierre Sugar
Ranch Hand
Posts: 62
Java Ruby Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to write a pojo of your object to be saved with hibernate in a table (you have to decide whether to use JPA or Hibernate xml-scripts). Than have a class that is doing the CURD operations (persistence layer). In your Swing application you address the database over your CRUD-object.
 
Bill Ant
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pierre Sugar wrote:You need to write a pojo of your object to be saved with hibernate in a table (you have to decide whether to use JPA or Hibernate xml-scripts). Than have a class that is doing the CURD operations (persistence layer). In your Swing application you address the database over your CRUD-object.


Persistence layer is very simple.

Examples, resources that describe pattern Observer, Dao on Swing?
 
Pierre Sugar
Ranch Hand
Posts: 62
Java Ruby Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you want to listen on? Swing has a lot of event listeners already available. You usally don't need to write your own observer. So what is your use case?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!