Java web applaton layout, please explain some principles / design patterns

I am looking at this java application using hibernate, jsp and spring. (what can I say!)

The file format is as follows:

classes/com/example/project1

inside the project1

/dao
    _entity_Dao.java
/dao/hibernate/
    _entity_DaoHibernate.java
/factory
     DaoFactory.java
      DaoFactoryImpl.java
/managers
      _entity_Manager.java
/managers/impl
      _entity_ManagerImpl.java
/model
      _entity_.java
/service
      _xxxx_Service.java
/service/impl/
      _xxxx_ServiceImpl.java

Have you guys read about this type of layout somewhere? Is this the best practice?

What is the difference between Factory and Manager and Service? (high level)

+3
source share
2 answers

For a typical build of an application built using Spring, I would look at an example of the web applications that come with it (which means Spring).

, DaoFactory, , Daos . , Spring . -, Spring xml / ( Singleton-scope , , daos , , , ).

Spring Bean, , . , , , daos , daos Spring , .

, , . , .

+1

. , , , . , (, .. JPA/JDBC/Hibernate, Axis2/CXF ..). , . , , - Spring (,) .

, , , :

Interface Project
   dao
      EntityDao    
   types
      Entity

HibernateImpl Project
   dao
      EntityHibernateDao
   src/main/resources/
      EntityMapping.cfg.xml
0

Source: https://habr.com/ru/post/1726722/


All Articles