0

I have a question about MVC architecture in an application based on Spring+Hibernate+IceFaces. If we choose MVC pattern + ajax, What kind of data should the model passed to the view hold in MVC?

Do I have to create domain objects pulling data from Hibernate? If I just use Hibernate DAO/pojo as model data, does it hurt?

On the front end, we have value objects for the view. But, we need to do a lot to make VO sync up with the Hibernate persistent entities. This is not good for AJAX calls. If we just use POJO as view objects, the only thing I need to worry about is serialization. That looks simple. Not quite sure if this works. Pros and cons? Any suggestions?

Nathan Hughes
  • 94,330
  • 19
  • 181
  • 276
  • What's wrong working with detached objects? Why you need extra VO and headaches converting one into another? – Roman C Mar 14 '13 at 18:37
  • This is more of a discussion topid than a question. But the main issues with persistent objects in the view is if the persistence changes so must the view (and vice/versa). And also detached objects may have a large amount of lazyloaded values giving you inconsistent object population in your view. I'm sure there are lots of other pros and cons, but that's just off the top of my head – Daniel Moses Mar 14 '13 at 18:55
  • Model is a layer that contains all of the business logic, rules and laws. It contains different structures, one of which usually are storage abstractions. If you can bare reading php examples, the you might find [this](http://stackoverflow.com/a/5864000/727208) answer relevant. – tereško Mar 14 '13 at 19:36

0 Answers0