Rick Reumann wrote:

Dave Newton wrote the following on 7/12/2005 1:57 PM:

Rick Reumann wrote:

For what it's worth, I found a way I can get around passing my ActionForm to another layer, but in theory, I'm not convinced that doing so would really mean that I'd be breaking the seperation of components.

How so? If I have to include the Struts libraries to compile my business layer (like if I wrote a standalone/non-web client app or utility, which I do fairly frequently) or mock a Struts object to test the business layer then they're clearly not separated.

What I'm saying is adding another component that is called from your Action doesn't mean it's *automatically* the business layer. For example I have a UIHelper class that I use to get certain things from the request and session and to certain "View" like things. Just because it's called from an Action class doesn't mean it's the business layer.

Of course not. But you just said that you're passing an ActionForm to another layer--perhaps you consider, as in my example, a utility class with static factory methods that construct (for example) business objects from an ActionForm as another layer, but I don't, it's just glue. If an ActionForm goes directly to a different layer (business, say) then they're coupled. If the data _in_ an ActionForm goes to the business layer via a POJO or a helper then it's not coupled: I can still use by BO in (for example) a non-Struts app w/o any issues whatsoever.

Granted this simple, and I often do like the above, but I don't see it as 'wrong' if instead you had....

//EmployeeUpdateAction
employeeUIHelper.update( form );

No, in fact, that's exactly right, if you've seen my other post. What's wrong was the original example I responded to where the constructor of a business object needed an ActionForm, which automatically couples my business layer to Struts--this BO is then useless to me in a standalone application, utility, etc.

Dave



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to