You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Rao, Nagraj" <NR...@e-gatematrix.com> on 2003/02/05 20:57:41 UTC
Struts best pracice
Hi all,
We are planning the framwork for struts and the genral opinion is hat we
have the following layers
[Web]=(form beans)==>[Action class]=(conversion from form to Value
Objects)=> [EJBs]
and Vice-versa for results..
But the above approach need a lot of conversions
Example:
getting stuff from "Forms" and setting it into Value Objects before we call
the EJB.
* Is'nt this crumbsome given that there will be around 80-100 screens
*Also is there a pattern to convert the Form bean attributes in to some sort
of a generic "QueryObjects" and have the EJBs decipher the QueryObjects and
thus make it really generic.
I was tring to design a QueryObject which was something like :
public interface RequestSearchCriteria {
public void addCondition(Condition condition);
public Vector getCriteria();
}
Where COndition is:
public abstract class Condition {
/* list of Conditions */
EQUALTO =1
NOTEQUALTO =2
GREATERTHAN =3
LESSTHAN =4
SORTBY =5
public Condition(String attribute, Object value, boolean needsValue, int
condition)
{
this.attribute = attribute;
this.value = value;
this.needsValue = needsValue;
this.condition = condition;
}
}
But it never really took me anywhere as each EJB seem to have specific
queries and the fear that we might not be able to make it generic enough..
I was wondering if anyone had some ideas or statergies which are good.
Much appreciated,
Naggi
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org