0

I'm new in Java EE, and in my internship I need to work with:

  • the frameworks: Struts2 , Hibernate;
  • the application server: Tomcat;
  • the IDE: Eclipse;
  • the database: Oracle;

First, is there any nice tutorial which includes all these technologies together?

Second, what is the best way to divide the project into packages? In a sample but not explained one, they divided the resources into the following packages : dao, domain, mapping, web. But they didn't explained at all the characteristics of any one.

Arjan Tijms
  • 37,782
  • 12
  • 108
  • 140

1 Answers1

2

Just try these 2 link, they both will give you clear idea how to integrate Struts2 and hibernate.

http://www.mkyong.com/struts2/struts-2-hibernate-integration-example/

http://viralpatel.net/blogs/tutorial-struts2-hibernate-example-eclipse/

DAO is basically Data Access Object which are mapped with your Database tables, its just contains gettter/setter of each column of a table. Domain is where you write your business logic either before sending data to Database or after getting data from database. Web is where you keep your java script, jsp, css files.....

hope this will help.

Tapan Upadhyay
  • 109
  • 1
  • 1
  • 9
  • 1
    I think you forgot to add the links? – CoreCode Jul 06 '12 at 00:50
  • 1
    DAOs don't contain getters/setters for fields, that's an @Entity. DAOs control reading and writing entities to the database. – Steven Benitez Jul 06 '12 at 13:50
  • Sorry Steven, I Explained DTO instead DAO, Arjan here is the definition of DTO and DAO – Tapan Upadhyay Jul 09 '12 at 01:27
  • 1
    A Data Transfer Object (DTO) is just as data container which is used to transport data between layers and tiers. It mainly contains of attributes. Actually you can even use public attributes without any getters / setters, but this will probably cause too much meetings and discussions . DTOs are anemic in general and do not contain any business logic. DTOs are often java.io.Serializable-its only needed if you are going to transfer the data across JVMs.you can also find more details in this thread http://stackoverflow.com/questions/1612334/difference-between-dto-vo-pojo-javabeans – Tapan Upadhyay Jul 09 '12 at 01:33
  • 1
    A data access object (DAO) is an object that provides an abstract interface to some type of database or persistence mechanism, providing some specific operations without exposing details of the database. It provides a mapping from application calls to the persistence layer. This isolation separates the concerns of what data accesses the application needs, in terms of domain-specific objects and data types (the public interface of the DAO), and how these needs can be satisfied with a specific DBMS, databas schema, etc.
    Hope this will help.
    – Tapan Upadhyay Jul 09 '12 at 01:34
  • Thank you a lot for these explainations. Of course this helped me. :) +1 to All –  Aug 09 '12 at 00:36