-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Validate and Action - Object Retrieval Architecture Help
PostPosted: Sun Mar 06, 2005 2:36 pm 
Beginner
Beginner

Joined: Thu Nov 20, 2003 1:30 pm
Posts: 27
Using struts to do form validation, this is a simple architecture question.

Example: Forgot Password feature of website.

1. Need to validate e-mail address exists in database.
2. Send password to e-mail address.

With a struts Form, I can validate the e-mail address in the form object, then send the e-mail in the Action class.

Although this means, I need to either have 2 database calls, one to check if the e-mail address exists in the Form class, then one to retrieve the password in the Action object. Or I can retrieve the whole object in the Form class, validate, then in the Action retrieve it again, and it should be cached since it will be the same Session. Or I can just do the validation and retrieval in the Action class, but I would like to avoid that to abstract validation out of the Action.

I just wanted to know what is done in a situation like this? I'm leaning towards retrieving the whole object twice because that seems like less database work. But, then do I have to cache the retrieval query too? "select o from Member o where o.emailaddress = 'xxx@aaa.com'

Abstraction is great, but creates more problems, any ideas?

Thanks for your help


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.