  | Mailing List | | Home | | Forum Home | | JBoss - Java Application Server | | Tomcat - JSP/Servlet container | | Struts - A MVC web framework | | iText - An open source PDF Java Library | | JDOM - JDOM XML Parser | | JSP - A mailing list about Java Server Pages specification and reference | | J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition | | J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog | | Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology | |
Struts & Hibernate
|
|
|
  | | | Cache | Cache 2005-07-18 - By Rumpa Giri
Back Since the table has read-only data and not many records, I just created a static variable holding onto the collection of objects. For example, we have a list of Payers
public class PayerCache { private static Collection PAYERS = null; static { PayerDAO dao = new PayerDAO(); PAYERS = dao.searchPayers(); } private PayerCache() { //do not instantiate } public static Collection searchPayers() { return PAYERS; } }
Hope this helps. Thanks Rgiri
Yasir Sufyan <ysufyan@(protected)> wrote: Hye Rigri, Can u eloborate in detial, how you implemented the caching... references/code sinppets etc..... I want myself to imlement it.
Yasir.
==================================================================== Companion Site: http://www.corej2eepatterns.com J2EE BluePrints: http://java.sun.com/blueprints/corej2eepatterns List Archive: http://archives.java.sun.com/archives/j2eepatterns-interest.html Unsubscribing: email "signoff J2EEPATTERNS-INTEREST" to listserv@(protected)
__ ____ ____ ____ ____ ____ ____ ____ ____ ____ __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
==================================================================== Companion Site: http://www.corej2eepatterns.com J2EE BluePrints: http://java.sun.com/blueprints/corej2eepatterns List Archive: http://archives.java.sun.com/archives/j2eepatterns-interest.html Unsubscribing: email "signoff J2EEPATTERNS-INTEREST" to listserv@(protected) <DIV>Since the table has read-only data and not many records, I just created a static variable holding onto the collection of objects. For example, we have a list of Payers</DIV> <DIV> </DIV> <DIV>public class PayerCache {</DIV> <DIV> private static Collection PAYERS = null;</DIV> <DIV> static {<BR> PayerDAO dao = new PayerDAO();<BR> PAYERS = dao.searchPayers();<BR> }</DIV> <DIV> private PayerCache() {<BR>   ; //do not instantiate<BR> }</DIV> <DIV> public static Collection searchPayers() {<BR> return PAYERS;<BR> }<BR>} </DIV> <DIV> </DIV> <DIV>Hope this helps.</DIV> <DIV>Thanks</DIV> <DIV>Rgiri<BR><BR><B><I>Yasir Sufyan <ysufyan@(protected)></I></B> wrote:</DIV> <BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER -LEFT: #1010ff 2px solid">Hye Rigri,<BR>Can u eloborate in detial, how you implemented the caching...<BR>references/code sinppets etc..... I want myself to imlement it.<BR><BR>Yasir.<BR><BR>========================================== ==========================<BR>Companion Site: http://www.corej2eepatterns.com<BR >J2EE BluePrints: http://java.sun.com/blueprints/corej2eepatterns<BR>List Archive: http://archives.java.sun.com/archives/j2eepatterns-interest.html<BR >Unsubscribing: email "signoff J2EEPATTERNS-INTEREST" to listserv@(protected) <BR></BLOCKQUOTE><p>__ ____ ____ ____ ____ ____ ____ ____ ____ ____ __<br>Do You Yahoo!?<br>Tired of spam? Yahoo! Mail has the best spam protection around <br >http://mail.yahoo.com ==================================================================== Companion Site: http://www.corej2eepatterns.com J2EE BluePrints: http://java.sun.com/blueprints/corej2eepatterns List Archive: http://archives.java.sun.com/archives/j2eepatterns-interest.html Unsubscribing: email "signoff J2EEPATTERNS-INTEREST" to listserv@(protected)
|
|
 |