Hi,
I have an architectural sort of question about how best to mix Struts & EJB. I am building an application in which I am using a Struts-like framework to handle the view and controller (i.e. I use beans to handle form processing and actions to control the flow), and I am using CMP EJBs to handle database access.
As I said, I'm using beans to populate HTML forms with information from the database, but now I'm wondering about how best to populate the beans themselves. Is there a better way of doing it than simply using an action or something to get the fields from my EJB session bean and set their complimentary fields in the form bean? What about using the form bean as a "facade" for my Session EJB (which is in turn a facade for my Entity EJB)? The idea here would be that each get method in my form bean would simply call its complimentary get method in my session bean. Conversely, after validation, each set method would call its accompanying set method in the session bean.
Does this make sense, or would it have some kind of performance cost or other gotcha?
Thanks,
Buzz
I have an architectural sort of question about how best to mix Struts & EJB. I am building an application in which I am using a Struts-like framework to handle the view and controller (i.e. I use beans to handle form processing and actions to control the flow), and I am using CMP EJBs to handle database access.
As I said, I'm using beans to populate HTML forms with information from the database, but now I'm wondering about how best to populate the beans themselves. Is there a better way of doing it than simply using an action or something to get the fields from my EJB session bean and set their complimentary fields in the form bean? What about using the form bean as a "facade" for my Session EJB (which is in turn a facade for my Entity EJB)? The idea here would be that each get method in my form bean would simply call its complimentary get method in my session bean. Conversely, after validation, each set method would call its accompanying set method in the session bean.
Does this make sense, or would it have some kind of performance cost or other gotcha?
Thanks,
Buzz