The funny thing is that they gave them these names so we (developers) could communicate better. ;) It was one of the reasons for the book. ----- Original Message ----- From: "Chappell, Simon P" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" <[EMAIL PROTECTED]> Sent: Monday, October 14, 2002 1:53 PM Subject: RE: DAO or ... ?
You know, patterns are wonderful, but am I the only person who thinks that the names that were selected by the GoF are terrible? I may just be old fashioned, but I think in terms like wrapper, API and controller, not facade and command. Oh well. At least I can use patterns even I can't remember for the life of me what the official name for it is! :-) Simon ----------------------------------------------------------------- Simon P. Chappell [EMAIL PROTECTED] Java Programming Specialist www.landsend.com Lands' End, Inc. (608) 935-4526 >-----Original Message----- >From: Couball, James [mailto:[EMAIL PROTECTED]] >Sent: Monday, October 14, 2002 1:21 PM >To: 'Struts Users Mailing List' >Subject: RE: DAO or ... ? > > >That was it, the Command pattern was what I was thinking of... >but Session >Façade had a bit more to it. > >Thanks for the info. > >James. > >> -----Original Message----- >> From: Jamie M [mailto:[EMAIL PROTECTED]] >> Sent: Monday, October 14, 2002 10:37 AM >> To: Struts Users Mailing List >> Subject: RE: DAO or ... ? >> >> How about the Command Pattern: >> >> http://www.javaworld.com/javaworld/javatips/jw-javatip68.html >> >> An EJB version is mentioned in 'EJB Design Patterns' >> (http://www2.theserverside.com/books/EJBDesignPatterns/index.jsp) >> too. >> >> jamie >> >> --- "Couball, James" <[EMAIL PROTECTED]> >> wrote: >> > I recommend taking a look at the Session Façade >> > pattern in the Java Blue >> > Prints. No matter if you use EJBs or not, this >> > pattern encapsulates the >> > ideas that Simon was mentioning. >> > >> > Does anyone know the name of the more general >> > pattern that doesn't involve >> > Session Beans specifically? >> > >> > One of my general concerns is "design to test". I >> > like to be able to test >> > the (business/persistence) layer that the actions >> > will call independently of >> > struts, actions, etc. Encapsulating that layer in >> > an API (or wrapping with >> > a session bean) makes this possible. >> > >> > Sincerely, >> > James. >> > >> > > -----Original Message----- >> > > From: Andrew Hill >> > [mailto:[EMAIL PROTECTED]] >> > > Sent: Monday, October 14, 2002 8:16 AM >> > > To: Struts Users Mailing List >> > > Subject: RE: DAO or ... ? >> > > >> > > But you still call the API from the action right - >> > is this not invoking >> > > the >> > > functionality that persists your data? >> > > >> > > Seems a bit like semantic juggling to me... (after >> > all the persistance >> > > layer >> > > is just an abstraction API on top of writing to >> > db/disk/punchcard >> > > itself...) >> > > ;-) >> > > >> > > I would however agree that there ought to be some >> > sort of abstracting >> > > layer >> > > between the view and the implementation specific >> > details of the p-tier... >> > > >> > > -----Original Message----- >> > > From: Chappell, Simon P >> > [mailto:[EMAIL PROTECTED]] >> > > Sent: Monday, October 14, 2002 23:04 >> > > To: Struts Users Mailing List; >> > [EMAIL PROTECTED] >> > > Subject: RE: DAO or ... ? >> > > >> > > >> > > You invoke your persistence code in the same place >> > that you would invoke >> > > any >> > > other code ... not in the Action! >> > > >> > > Write all your core application code (business >> > rules, persistence, >> > > communications etc) in a way that has no >> > connection to the view portion of >> > > your system and then create a API to it. This way >> > you can have any client >> > > you like call into your core code and your core >> > code doesn't need to worry >> > > about what calls it, only about acting upon >> > requests. >> > > >> > > Then use the actions to call into the API and pass >> > the API return values >> > > to >> > > the JSPs. Works great. >> > > >> > > /------\ /---\ /----\ >> > > |Client|--> |API|-->|Core| >> > > |Code | | | |Code| >> > > \------/ \---/ \----/ >> > > >> > > The API is now your fire break. Nothing on the >> > Core Code side has to worry >> > > about displaying anything and nothing in the >> > Client Code has to worry >> > > about >> > > calculating anything. >> > > >> > > Simon >> > > >> > > >> > >> ----------------------------------------------------------------- >> > > Simon P. Chappell >> > [EMAIL PROTECTED] >> > > Java Programming Specialist >> > www.landsend.com >> > > Lands' End, Inc. >> > (608) 935-4526 >> > > >> > > >> > > >-----Original Message----- >> > > >From: Andrew Hill >> > [mailto:[EMAIL PROTECTED]] >> > > >Sent: Monday, October 14, 2002 9:57 AM >> > > >To: Struts Users Mailing List >> > > >Subject: RE: DAO or ... ? >> > > > >> > > > >> > > >So where should one invoke the persistance layer? >> > > > >> > > >-----Original Message----- >> > > >From: Lacerda, Wellington (AFIS) >> > [mailto:[EMAIL PROTECTED]] >> > > >Sent: Monday, October 14, 2002 22:51 >> > > >To: 'Struts Users Mailing List' >> > > >Subject: RE: DAO or ... ? >> > > >Importance: High >> > > > >> > > > >> > > >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:[EMAIL PROTECTED]] >> > > >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 >> > > > >> > > > >> > > >-- >> > > >Kevin Viet <[EMAIL PROTECTED]> >> > > >ActiVia Networks >> > > > >> > > > >> > > > >> > > > >> > > >-- >> > > >To unsubscribe, e-mail: >> > > >> > ><mailto:[EMAIL PROTECTED]> >> > > >For additional commands, e-mail: >> > > ><mailto:[EMAIL PROTECTED]> >> > > > >> > > > >> > > >-- >> > > >To unsubscribe, e-mail: >> > > >> > ><mailto:[EMAIL PROTECTED]> >> > > >For additional commands, e-mail: >> > > ><mailto:[EMAIL PROTECTED]> >> > > > >> > > > >> > > >-- >> > > >To unsubscribe, e-mail: >> > > >> > <mailto:[EMAIL PROTECTED]> >> > > For additional commands, e-mail: >> > > <mailto:[EMAIL PROTECTED]> >> > > >> > > >> > > -- >> > > To unsubscribe, e-mail: >> > > >> > <mailto:[EMAIL PROTECTED]> >> > > For additional commands, e-mail: >> > > <mailto:[EMAIL PROTECTED]> >> > > >> > > >> > > -- >> > > To unsubscribe, e-mail: <mailto:struts-user- >> > > [EMAIL PROTECTED]> >> > > For additional commands, e-mail: >> > <mailto:struts-user- >> > >> === message truncated === >> >> >> __________________________________________________ >> Do you Yahoo!? >> Faith Hill - Exclusive Performances, Videos & More >> http://faith.yahoo.com >> >> -- >> To unsubscribe, e-mail: <mailto:struts-user- >> [EMAIL PROTECTED]> >> For additional commands, e-mail: <mailto:struts-user- >> [EMAIL PROTECTED]> > >-- >To unsubscribe, e-mail: ><mailto:struts-user->[EMAIL PROTECTED]> >For >additional commands, >e-mail: <mailto:[EMAIL PROTECTED]> > > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>