struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kevin Viet <vi...@activia.net>
Subject Re: DAO or ... ?
Date Mon, 14 Oct 2002 14:59:14 GMT
Le lun 14/10/2002 à 16:55, V. Cekvenich a écrit :
> "Avoid persistence in Action code as much as you can."
> Yes.
> And a way to do that is to say in action something like:
> 
> formBean.save()
> 
> where the formBean has something like this in save() {getDAO().update()}
> 
> and the DAo does the save for the bean.
> 
But I'v read that the domain  objects needn't know that are persitent,
if you implement a save method that means that ur object know it can be
persisted

> .V
> 
> Lacerda, Wellington (AFIS) wrote:
> > Hi Kevin
> > 
> > Avoid persistence in Action code as much as you can.
> > 
> > This is the general recommendation.
> > 
> > Wellington Silva
> > Author of "JSP and Tag Libraries for Web Development"
> > FAO of the UN - Consultant
> > 
> > -----Original Message-----
> > From: Kevin Viet [mailto:vietk@activia.net]
> > Sent: Monday, October 14, 2002 4:45 PM
> > To: struts-user
> > Subject: DAO or ... ?
> > 
> > 
> > My question is a web app design question. 
> > What pattern you guys follow when you want to save a domain object in
> > the database ?: 
> > 
> > - use the DAO pattern of java blueprint  (persistence layer is called
> > into classes)
> > - call to persistence statements into action code :
> > 	
> > 	// store example
> > 	try {
> > 		PeristenceLayer pl = getPerstitenceLayer();
> > 		pl.save(domainObject);
> > 	}
> > 	catch (Exception
> > 
> > 
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>
-- 
Kevin Viet <vietk@activia.net>
ActiVia Networks




--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message