Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Daniel,</p> <p>I have used one controller per page, one service and one dao per entity.</p> <ul> <li>Use case logic goes in the controller</li> <li>Entity specific business logic goes in entity service. </li> <li>Actions which span multiple entities you can create a facade service - something which sits between controller and entity services</li> </ul> <p>While the above is a good and practical approach, ideally:</p> <ul> <li>you could break out any non MVC code from controller into its own service class, ie. 1 service class per page</li> <li>you should only access the entity dao via the entity service. </li> </ul> <p>Here's how the control would flow:</p> <p>Ideally: UI -> PageController.java -> PageService.java -> EntityService.java -> EntityDao.java</p> <p>Practically, you could trim down a few layers: UI -> PageController.java -> EntityService.java</p> <p>Or for actions touching multiple entities: UI -> PageController.java -> Facade.java -> Entity1Service.java,Entity2Service.java</p> <p>PageController.java would be a Seam @Component and in your ui you can refer it as: <code>#{pageController}</code> and pull the data from the view.</p> <p>In architecture, the most important thing is how you layer things in the stack is avoid circular dependencies between layers. For example, Entity Service should not reference Controller and so on.</p> <p>The other important thing is to be consistent about layering in the entire application. Use code generators if you can to keep your code consistent across the application, it really pays off for large projects. Look into <a href="http://www.clickframes.org" rel="nofollow noreferrer">Clickframes</a> if you are interested in code generation (Clickframes generates starter code for Seam apps with full JPA/valdiation/security support which you can then modify). See this <a href="http://code.google.com/p/clickframes-seam-issuetracker-demo/" rel="nofollow noreferrer">Seam demo</a> build with Clickframes if interested.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload