First of all... as you pointed out I need a
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/basicportal/bP/WEB-INF/src/war/org/apache/scaffoldingXPress/base/SimpleBean.java
for simple search cases, so I just CVSed.
I will add a search example to scaffolding, and a search chapter to my new book(preview in less than a month), and add searching to the labs.

more inline.

Rick Reumann wrote:
On Tue, 27 May 2003 11:00:42 -0400, Vic Cekvenich wrote:

  
Read my other post on search. (The first one... excuse my ADD).

Please let me understand why you think it wiered.
Search has bean, action, form.
You submit search to the action, with search bean populated. (not much 
use for a basebean code here, I think you are saying)

ListEmployees has a page, action, bean.
It needs to receive in (session?) scope (or url properites) the search 
arguments in the action only.
based on it, it populates the bean and page displays it.
    

Well weird probably isn't the word:) At some point I have to pass the
parameters to IBatis based on these parameters bundled in an Object. So
what is first happening is my SearchFormBean gets populated but then I'm
stripping the properties out in the Display action...

ProjectSearchBean searchBean =
(ProjectSearchBean)ae.getSessionBean("projectSearchBean");

ArrayList projectIds = projectSearchBean.getProjectIds();
String someOtherVar = projectSearchBean.getSomeOtherVar();

//now populate based on search params above
projectFormBean.populate( projectIds, someOtherVar );

Looks good to me.

So what I didn't like was that now projectFormBean.populate( ArrayList
projectIds, String someOtherVar ) ends up calling the DAO doRetrieve( ArrayList
projectIds, String someOtherVar ) which ends up having to put the
variables back into some Object again so that it can be passed to IBatis.
The reason I found this weird (annoying would be a better word) is that
intially everything already is in an Object (ProjectSearchBean) - it seems
so much easier to just call

projectFormBean.populate( projectSearchBean.getMap() )
I see now. I like the first thing better.
I just  do not like DAO knowing beans(complex objects), vs just simple strings, collections, etc.
Just a personal preference.  Else you have to import struts into DAO.
I like to keep layers seperate.
.V


vs having to pull out all the variables from projectSearchBean in the
Display action, only to
put them all back into an object later in the DAO. 

  

-- 
Vic Cekvenich,
Struts Instructor,
1-800-917-JAVA

Advanced <a href ="">Struts Training</a> and project recovery in North East. 
Open Source <a href ="">Content Management</a>  basicPortal sofware
Best practice<a href ="">Struts Support</a> v.1.1 helper ScafflodingXPress

Reply via email to