views:

66

answers:

1

I'm in the planning stages of a web site project and deciding on whether to go for OSIV and not use dao(eao)/dto (used dao/dto for an existing project)

im wondering if, with OSIV, the entities should be accessible in the view (for example, with struts2, i could push the entities on to the valuestack and use OGNL in the view templates)

has anyone had success with OSIV and did you allow the entities to be accessed by the view directly?

thanks

(btw: I'm suprised OSIV is not a valid tag)

+2  A: 

Some frameworks completely eliminate the need for DTOs and encourage users to just use entities directly in their views and controllers. For example this is the natural/recommended approach for developing JSF+Seam applications. I had used the OSIV pattern years ago with WebWork and we didn't encounter any blocking problems back then.

Besides, OSIV and DAO patterns can be used together.

Bytecode Ninja
@Bytecode Ninja Better Than DAO and ActiveRecord pattern *which maintains domain model objects and persistence implementation coupled tightly together* is The Mediator pattern. Seam in Action book covers in detail how it works.
Arthur Ronald F D Garcia
@Arthur Thanks. Will have a look at it. Hadn't seen the Mediator pattern used in this context. Should be interesting.
Bytecode Ninja
@Bytecode Chapter 10. Seam Framework. read carefully
Arthur Ronald F D Garcia