• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts 2, OGNL and data abstraction

 
Peter Searls
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

It is my understanding that in Struts 1 we abstracted the data from the J2EE view by copying the data from a form bean to a pojo/dto and that one of the nice additions in Struts 2 is that the OGNL language does that abstraction for you by transferring the data from the form to attributes in the action or a bean you specify. Because of this belief I designed my application this way and now the programmers I work with are telling me that I am wrong and that the system needs to be changed (expensively) to add in the abstraction layer.

So the question is, am I wrong and should just accept it and take the hit to my reputation or am I correct and I should stop them before they make a mess of things. I can accept it if I'm wrong but it doesn't feel that way.

Any help would be appreciated.

Thanks,

Pete
 
Richard Golebiowski
Ranch Hand
Posts: 213
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are correct. I am currently working on a large online application with a few hundred fields in a java object. The object is saved on the session and when new fields are updated and the client clicks save the application is loaded from the session, the appropriate fields are updated by Struts, and the fields are saved to the database.

In Struts 1 we had the tedious task of updating the object from the form fields. In Struts 2 you access the object directly in the action class.
 
Peter Searls
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Richard.

The more replies the better to convince my management/co-workers, so keep'em coming
 
Jesus Mireles
Ranch Hand
Posts: 122
IntelliJ IDE Java Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are correct but without knowing your full architecture who knows why they may be saying what they are saying. I've worked for clients that even though this feature exists they still have Data Objects for the Presentation tier and end up transferring their data from that DO to some other Data Object because it was how they had their Struts1 applications so now they dont want to refractor any DAOs or Hibernate etc ... so each situation can be weird in its own way ...
 
Peter Searls
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Lucas,

I worked on the old struts 1 version and the new struts 2 version. Unfortunately the problem is that a CONSULTANT was brought in to see what we might be doing wrong. Instead of talking to us, the technical leads who designed the system he decided to meet with a contractor who helped us. That contractor understood the basics of struts 2 but not the nuance of what OGNL provided. So the CONSULTANT who admits he doesn't know struts 2 took all of his input from a contractor who really doesn't know struts 2 ;~D

I don't know about where you work but at my company it seems that outsiders are automatically assumed to know more than the people who have worked there for years.

Pete
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic